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

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: feedback inc 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
Index: src/gpu/GrClipMaskManager.cpp
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index 0738108ab8b6cd015776a60e09359d10a920e51c..1916ab848a83e4e23853b4b317955f0145e53003 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -211,9 +211,9 @@ 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,
+ GrDrawTarget::DrawInfo* drawInfo,
GrDrawState::AutoRestoreEffects* are,
- GrDrawState::AutoRestoreStencil* asr,
- const SkRect* devBounds) {
+ GrDrawState::AutoRestoreStencil* asStencil) {
fCurrClipMaskType = kNone_ClipMaskType;
GrReducedClip::ElementList elements(16);
@@ -249,8 +249,7 @@ bool GrClipMaskManager::setupClipping(const GrClipData* clipDataIn,
}
if (ignoreClip) {
- fGpu->disableScissor();
- this->setDrawStateStencil(asr);
+ this->setDrawStateStencil(asStencil);
return true;
}
@@ -265,17 +264,16 @@ bool GrClipMaskManager::setupClipping(const GrClipData* clipDataIn,
if (elements.count() <= 4) {
SkVector clipToRTOffset = { SkIntToScalar(-clipDataIn->fOrigin.fX),
SkIntToScalar(-clipDataIn->fOrigin.fY) };
+ const SkRect* devBounds = drawInfo->getDevBounds();
if (elements.isEmpty() ||
(requiresAA && this->installClipEffects(elements, are, clipToRTOffset, devBounds))) {
SkIRect scissorSpaceIBounds(clipSpaceIBounds);
scissorSpaceIBounds.offset(-clipDataIn->fOrigin);
if (NULL == devBounds ||
!SkRect::Make(scissorSpaceIBounds).contains(*devBounds)) {
- fGpu->enableScissor(scissorSpaceIBounds);
- } else {
- fGpu->disableScissor();
+ drawInfo->enableScissor(scissorSpaceIBounds);
}
- this->setDrawStateStencil(asr);
+ this->setDrawStateStencil(asStencil);
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(asStencil);
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);
+ drawInfo->enableScissor(scissorSpaceIBounds);
+ this->setDrawStateStencil(asStencil);
return true;
}
« no previous file with comments | « src/gpu/GrClipMaskManager.h ('k') | src/gpu/GrDrawTarget.h » ('j') | src/gpu/GrGpu.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698