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(), |