Fix ClipMaskManager's SW-fallback logic
'useSWOnlyPath' was not correctly toggling between stencil and color draws so there was a mismatch with the behavior in createAlphaClipMask (i.e., we were inadvertently rendering some of the elements in a clip using SW but using stenciling for others - precisely what 'useSWOnlyPath' was intended to prevent).
Review URL: https://codereview.chromium.org/1421533007
diff --git a/src/gpu/GrPathRendererChain.cpp b/src/gpu/GrPathRendererChain.cpp
index b1eb320..c846dee 100644
--- a/src/gpu/GrPathRendererChain.cpp
+++ b/src/gpu/GrPathRendererChain.cpp
@@ -40,7 +40,7 @@
}
GrPathRenderer* GrPathRendererChain::getPathRenderer(const GrShaderCaps* shaderCaps,
- const GrPipelineBuilder* pipelineBuilder,
+ const GrPipelineBuilder& pipelineBuilder,
const SkMatrix& viewMatrix,
const SkPath& path,
const GrStrokeInfo& stroke,
@@ -66,15 +66,15 @@
minStencilSupport = GrPathRenderer::kNoSupport_StencilSupport;
}
+ GrPathRenderer::CanDrawPathArgs args;
+ args.fShaderCaps = shaderCaps;
+ args.fPipelineBuilder = &pipelineBuilder;
+ args.fViewMatrix = &viewMatrix;
+ args.fPath = &path;
+ args.fStroke = &stroke;
+ args.fAntiAlias = antiAlias;
for (int i = 0; i < fChain.count(); ++i) {
- GrPathRenderer::CanDrawPathArgs args;
- args.fShaderCaps = shaderCaps;
- args.fPipelineBuilder = pipelineBuilder;
- args.fViewMatrix = &viewMatrix;
- args.fPath = &path;
- args.fStroke = &stroke;
- args.fAntiAlias = antiAlias;
if (fChain[i]->canDrawPath(args)) {
if (GrPathRenderer::kNoSupport_StencilSupport != minStencilSupport) {
GrPathRenderer::StencilSupport support =