Chromium Code Reviews| 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()); |
|
bsalomon
2016/03/01 17:38:55
Maybe this warrants a separate entry with clearer
robertphillips
2016/03/01 20:11:57
I would like to hold off on that until the drawBat
|
| + 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); |