Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Unified Diff: src/gpu/GrClipMaskManager.cpp

Issue 678683005: Scissor rect on drawinfo (Closed) Base URL: https://skia.googlesource.com/skia.git@clip_to_target
Patch Set: rebase on master Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrClipMaskManager.h ('k') | src/gpu/GrDrawTarget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrClipMaskManager.cpp
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index 0738108ab8b6cd015776a60e09359d10a920e51c..1d193a59d9bc299162ab3ea45c1d737619001f58 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -211,9 +211,10 @@ bool GrClipMaskManager::installClipEffects(const GrReducedClip::ElementList& ele
// sort out what kind of clip mask needs to be created: alpha, stencil,
// scissor, or entirely software
bool GrClipMaskManager::setupClipping(const GrClipData* clipDataIn,
+ const SkRect* devBounds,
GrDrawState::AutoRestoreEffects* are,
- GrDrawState::AutoRestoreStencil* asr,
- const SkRect* devBounds) {
+ GrDrawState::AutoRestoreStencil* ars,
+ GrDrawTarget::ScissorState* scissorState) {
fCurrClipMaskType = kNone_ClipMaskType;
GrReducedClip::ElementList elements(16);
@@ -249,8 +250,7 @@ bool GrClipMaskManager::setupClipping(const GrClipData* clipDataIn,
}
if (ignoreClip) {
- fGpu->disableScissor();
- this->setDrawStateStencil(asr);
+ this->setDrawStateStencil(ars);
return true;
}
@@ -271,11 +271,9 @@ bool GrClipMaskManager::setupClipping(const GrClipData* clipDataIn,
scissorSpaceIBounds.offset(-clipDataIn->fOrigin);
if (NULL == devBounds ||
!SkRect::Make(scissorSpaceIBounds).contains(*devBounds)) {
- fGpu->enableScissor(scissorSpaceIBounds);
- } else {
- fGpu->disableScissor();
+ scissorState->set(scissorSpaceIBounds);
}
- this->setDrawStateStencil(asr);
+ this->setDrawStateStencil(ars);
return true;
}
}
@@ -306,8 +304,7 @@ bool GrClipMaskManager::setupClipping(const GrClipData* clipDataIn,
rtSpaceMaskBounds.offset(-clipDataIn->fOrigin);
are->set(fGpu->drawState());
setup_drawstate_aaclip(fGpu, result, rtSpaceMaskBounds);
- fGpu->disableScissor();
- this->setDrawStateStencil(asr);
+ this->setDrawStateStencil(ars);
return true;
}
// if alpha clip mask creation fails fall through to the non-AA code paths
@@ -334,8 +331,8 @@ bool GrClipMaskManager::setupClipping(const GrClipData* clipDataIn,
// use both stencil and scissor test to the bounds for the final draw.
SkIRect scissorSpaceIBounds(clipSpaceIBounds);
scissorSpaceIBounds.offset(clipSpaceToStencilSpaceOffset);
- fGpu->enableScissor(scissorSpaceIBounds);
- this->setDrawStateStencil(asr);
+ scissorState->set(scissorSpaceIBounds);
+ this->setDrawStateStencil(ars);
return true;
}
« no previous file with comments | « src/gpu/GrClipMaskManager.h ('k') | src/gpu/GrDrawTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698