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

Unified Diff: src/gpu/GrClipMaskManager.cpp

Issue 985783002: Clip scissor to RT bounds (Closed) Base URL: https://skia.googlesource.com/skia.git@norect
Patch Set: fix Created 5 years, 9 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 | « no previous file | no next file » | 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 b58c56566eda169770e467d4bd018f49ad34c786..66d817ec00c74f44c04300e4b546dd268a0bf4d8 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -240,10 +240,15 @@ bool GrClipMaskManager::setupClipping(GrPipelineBuilder* pipelineBuilder,
case GrClip::kWideOpen_ClipType:
SkFAIL("Should have caught this with clip.isWideOpen()");
return true;
- case GrClip::kIRect_ClipType:
- scissorState->set(clip.irect());
- this->setPipelineBuilderStencil(pipelineBuilder, ars);
- return true;
+ case GrClip::kIRect_ClipType: {
+ SkIRect scissor = clip.irect();
+ if (scissor.intersect(clipSpaceRTIBounds)) {
+ scissorState->set(scissor);
+ this->setPipelineBuilderStencil(pipelineBuilder, ars);
+ return true;
+ }
+ return false;
+ }
case GrClip::kClipStack_ClipType: {
clipSpaceRTIBounds.offset(clip.origin());
GrReducedClip::ReduceClipStack(*clip.clipStack(),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698