aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDrawTarget.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-03-02 09:26:36 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-02 09:26:36 -0800
commit391395dcfbff09a83f8f0e9d3e02d38c855ae2e9 (patch)
tree8f03364d3b4939642a597834f7929dce98c7d2b8 /src/gpu/GrDrawTarget.cpp
parent855bd4415c1a26950e946cc2f8756f7e03b61637 (diff)
Begin weaning GrClipMaskManager off of GrDrawTarget (take 2)
Diffstat (limited to 'src/gpu/GrDrawTarget.cpp')
-rw-r--r--src/gpu/GrDrawTarget.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 173617ebe6..fc8c71b443 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);