Index: src/gpu/GrDrawTarget.cpp |
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp |
index 1edb48c02823a42ea909cd0960214e4f77ea7947..ba0142edca02fba1f2c5d6ae51c9c53de36ac08e 100644 |
--- a/src/gpu/GrDrawTarget.cpp |
+++ b/src/gpu/GrDrawTarget.cpp |
@@ -146,12 +146,17 @@ void GrDrawTarget::reset() { |
void GrDrawTarget::drawBatch(const GrPipelineBuilder& pipelineBuilder, GrDrawBatch* batch) { |
// Setup clip |
GrScissorState scissorState; |
- GrPipelineBuilder::AutoRestoreFragmentProcessorState arfps; |
GrPipelineBuilder::AutoRestoreStencil ars; |
- if (!fClipMaskManager->setupClipping(pipelineBuilder, &arfps, &ars, &scissorState, |
- &batch->bounds())) { |
+ GrAppliedClip clip; |
+ if (!fClipMaskManager->setupClipping(pipelineBuilder, &ars, &scissorState, &batch->bounds(), |
+ &clip)) { |
return; |
} |
+ GrPipelineBuilder::AutoRestoreFragmentProcessorState arfps; |
+ if (clip.clipCoverageFragmentProcessor()) { |
+ arfps.set(&pipelineBuilder); |
+ arfps.addCoverageFragmentProcessor(clip.clipCoverageFragmentProcessor()); |
+ } |
GrPipeline::CreateArgs args; |
if (!this->installPipelineInDrawBatch(&pipelineBuilder, &scissorState, batch)) { |
@@ -206,13 +211,18 @@ void GrDrawTarget::stencilPath(const GrPipelineBuilder& pipelineBuilder, |
// Setup clip |
GrScissorState scissorState; |
- GrPipelineBuilder::AutoRestoreFragmentProcessorState arfps; |
GrPipelineBuilder::AutoRestoreStencil ars; |
- |
- if (!fClipMaskManager->setupClipping(pipelineBuilder, &arfps, &ars, &scissorState, nullptr)) { |
+ GrAppliedClip clip; |
+ if (!fClipMaskManager->setupClipping(pipelineBuilder, &ars, &scissorState, nullptr, &clip)) { |
return; |
} |
+ GrPipelineBuilder::AutoRestoreFragmentProcessorState arfps; |
+ if (clip.clipCoverageFragmentProcessor()) { |
+ arfps.set(&pipelineBuilder); |
+ arfps.addCoverageFragmentProcessor(clip.clipCoverageFragmentProcessor()); |
+ } |
+ |
// set stencil settings for path |
GrStencilSettings stencilSettings; |
GrRenderTarget* rt = pipelineBuilder.getRenderTarget(); |
@@ -261,13 +271,19 @@ void GrDrawTarget::drawPathBatch(const GrPipelineBuilder& pipelineBuilder, |
// batches. |
GrScissorState scissorState; |
- GrPipelineBuilder::AutoRestoreFragmentProcessorState arfps; |
GrPipelineBuilder::AutoRestoreStencil ars; |
- if (!fClipMaskManager->setupClipping(pipelineBuilder, &arfps, &ars, &scissorState, |
- &batch->bounds())) { |
+ GrAppliedClip clip; |
+ if (!fClipMaskManager->setupClipping(pipelineBuilder, &ars, &scissorState, &batch->bounds(), |
+ &clip)) { |
return; |
} |
+ GrPipelineBuilder::AutoRestoreFragmentProcessorState arfps; |
+ if (clip.clipCoverageFragmentProcessor()) { |
+ arfps.set(&pipelineBuilder); |
+ arfps.addCoverageFragmentProcessor(clip.clipCoverageFragmentProcessor()); |
+ } |
+ |
// Ensure the render target has a stencil buffer and get the stencil settings. |
GrStencilSettings stencilSettings; |
GrRenderTarget* rt = pipelineBuilder.getRenderTarget(); |