Index: src/gpu/GrDrawTarget.cpp |
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp |
index 173617ebe60986ddc9214654672ba5e1e4a4b713..fc8c71b443cfdcef3b558cacbf776e85b9d0c140 100644 |
--- a/src/gpu/GrDrawTarget.cpp |
+++ b/src/gpu/GrDrawTarget.cpp |
@@ -221,13 +221,25 @@ void GrDrawTarget::reset() { |
fBatches.reset(); |
} |
-void GrDrawTarget::drawBatch(const GrPipelineBuilder& pipelineBuilder, GrDrawBatch* batch) { |
+void GrDrawTarget::drawBatch(const GrPipelineBuilder& pipelineBuilder, |
+ GrDrawBatch* batch, |
+ const SkIRect* scissorRect) { |
// Setup clip |
GrPipelineBuilder::AutoRestoreStencil ars; |
GrAppliedClip clip; |
- if (!fClipMaskManager->setupClipping(pipelineBuilder, &ars, &batch->bounds(), &clip)) { |
- return; |
+ |
+ if (scissorRect) { |
+ SkASSERT(GrClip::kWideOpen_ClipType == pipelineBuilder.clip().clipType()); |
+ if (!fClipMaskManager->setupScissorClip(pipelineBuilder, &ars, *scissorRect, |
+ &batch->bounds(), &clip)) { |
+ return; |
+ } |
+ } else { |
+ if (!fClipMaskManager->setupClipping(pipelineBuilder, &ars, &batch->bounds(), &clip)) { |
+ return; |
+ } |
} |
+ |
GrPipelineBuilder::AutoRestoreFragmentProcessorState arfps; |
if (clip.clipCoverageFragmentProcessor()) { |
arfps.set(&pipelineBuilder); |