calc: on editing invalidation of view with different zoom is wrong
[LibreOffice.git] / external / skia / tdf148624.patch.1
blobc42beca22903af40079705c5972b1d9be5a817b5
1 commit b2cecde549c76cbd1c8b7d0cee2c6799936c1e7a
2 Author: Greg Daniel <egdaniel@google.com>
3 Date:   Thu Jun 16 11:29:08 2022 -0400
5     Fix not using texture barrier on StrokeTessOp.
6     
7     Previously we were overwriting the renderpassXferBarriers flag on
8     ProgramInfo to set it to kNone. This flag is meant to say whether or not
9     the entire render pass uses barriers or not. This is needed in Vulkan
10     because all pipelines in a render pass that has an input attachment
11     must bind the input attachment regardless if it is used or not. So the
12     pipeline must be created with a layout for an input attachment
13     descriptor set.
14     
15     This change just removes to performance optimization to only use the
16     barrier on the stencil and not fill draw. This use case shouldn't
17     come up too often and also shouldn't be a big perf hit regardless.
18     The way GrAppliedClip is created/used it is hard for us to create
19     multiple different Pipeline objects: one for stencil and one for the
20     fill.
21     
22     Bug: skia:13402
23     Change-Id: I15ce74b4d41b90d3dd4169a1f4fb77ed87c8b26d
24     Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549898
25     Reviewed-by: Michael Ludwig <michaelludwig@google.com>
26     Commit-Queue: Greg Daniel <egdaniel@google.com>
28 diff --git a/src/gpu/ganesh/ops/StrokeTessellateOp.cpp b/src/gpu/ganesh/ops/StrokeTessellateOp.cpp
29 index 8f47441eb9..de8153cd0f 100644
30 --- a/src/gpu/ganesh/ops/StrokeTessellateOp.cpp
31 +++ b/src/gpu/ganesh/ops/StrokeTessellateOp.cpp
32 @@ -179,7 +179,12 @@ void StrokeTessellateOp::prePrepareTessellator(GrTessellationShader::ProgramArgs
33          fStencilProgram = GrTessellationShader::MakeProgram(args, fTessellationShader, pipeline,
34                                                              &kMarkStencil);
35          fillStencil = &kTestAndResetStencil;
36 -        args.fXferBarrierFlags = GrXferBarrierFlags::kNone;
37 +        // TODO: Currently if we have a texture barrier for a dst read it will get put in before
38 +        // both the stencil draw and the fill draw. In reality we only really need the barrier
39 +        // once to guard the reads of the color buffer in the fill from the previous writes. Maybe
40 +        // we can investigate how to remove one of these barriers but it is probably not something
41 +        // that is required a lot and thus the extra barrier shouldn't be too much of a perf hit to
42 +        // general Skia use.
43      }
45      fFillProgram = GrTessellationShader::MakeProgram(args, fTessellationShader, pipeline,
46 diff --git a/src/gpu/ganesh/vk/GrVkPipelineStateBuilder.cpp b/src/gpu/ganesh/vk/GrVkPipelineStateBuilder.cpp
47 index 54bc7f857a..0d61b8c4cb 100644
48 --- a/src/gpu/ganesh/vk/GrVkPipelineStateBuilder.cpp
49 +++ b/src/gpu/ganesh/vk/GrVkPipelineStateBuilder.cpp
50 @@ -279,6 +279,10 @@ GrVkPipelineState* GrVkPipelineStateBuilder::finalize(const GrProgramDesc& desc,
51          }
52      }
54 +    // The vulkan spec says that if a subpass has an input attachment, then the input attachment
55 +    // descriptor set must be bound to all pipelines in that subpass. This includes pipelines that
56 +    // don't actually use the input attachment. Thus we look at the renderPassBarriers and not just
57 +    // the DstProxyView barrier flags to determine if we use the input attachment.
58      bool usesInput = SkToBool(fProgramInfo.renderPassBarriers() & GrXferBarrierFlags::kTexture);
59      uint32_t layoutCount =
60          usesInput ? GrVkUniformHandler::kDescSetCount : (GrVkUniformHandler::kDescSetCount - 1);