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

Unified Diff: src/gpu/GrClipMaskManager.cpp

Issue 956083002: Revert of Pass clip to context (Closed) Base URL: https://skia.googlesource.com/skia.git@pass_down_rendertarget
Patch Set: Created 5 years, 10 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/GrClip.cpp ('k') | src/gpu/GrContext.cpp » ('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 99c74e3c3f5d09133e1da6b667c9e6452e24e886..b28b75cefb9f8b18210c87c06f8f9ab0f9eb5711 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -231,47 +231,29 @@
bool ignoreClip = clip.isWideOpen(clipSpaceRTIBounds);
if (!ignoreClip) {
// The clip mask manager always draws with a single IRect so we special case that logic here
- // Image filters just use a rect, so we also special case that logic
- switch (clip.clipType()) {
- case GrClip::kWideOpen_ClipType:
- // we should have handled this case above
- SkASSERT(false);
- case GrClip::kIRect_ClipType: {
- initialState = GrReducedClip::kAllIn_InitialState;
- clipSpaceIBounds = clip.irect();
- SkNEW_INSERT_AT_LLIST_HEAD(&elements,
- Element,
- (SkRect::Make(clipSpaceIBounds),
- SkRegion::kIntersect_Op, false));
- } break;
- case GrClip::kRect_ClipType: {
- initialState = GrReducedClip::kAllIn_InitialState;
- clipSpaceIBounds.setLTRB(SkScalarCeilToInt(clip.rect().fLeft),
- SkScalarCeilToInt(clip.rect().fTop),
- SkScalarCeilToInt(clip.rect().fRight),
- SkScalarCeilToInt(clip.rect().fBottom));
- SkNEW_INSERT_AT_LLIST_HEAD(&elements,
- Element,
- (SkRect::Make(clipSpaceIBounds),
- SkRegion::kIntersect_Op, false));
- } break;
- case GrClip::kClipStack_ClipType: {
- clipSpaceRTIBounds.offset(clip.origin());
- GrReducedClip::ReduceClipStack(*clip.clipStack(),
- clipSpaceRTIBounds,
- &elements,
- &genID,
- &initialState,
- &clipSpaceIBounds,
- &requiresAA);
- if (elements.isEmpty()) {
- if (GrReducedClip::kAllIn_InitialState == initialState) {
- ignoreClip = clipSpaceIBounds == clipSpaceRTIBounds;
- } else {
- return false;
- }
+ if (GrClip::kIRect_ClipType == clip.clipType()) {
+ initialState = GrReducedClip::kAllIn_InitialState;
+ clipSpaceIBounds = clip.irect();
+ SkNEW_INSERT_AT_LLIST_HEAD(&elements,
+ Element,
+ (SkRect::Make(clipSpaceIBounds),
+ SkRegion::kIntersect_Op, false));
+ } else {
+ clipSpaceRTIBounds.offset(clip.origin());
+ GrReducedClip::ReduceClipStack(*clip.clipStack(),
+ clipSpaceRTIBounds,
+ &elements,
+ &genID,
+ &initialState,
+ &clipSpaceIBounds,
+ &requiresAA);
+ if (elements.isEmpty()) {
+ if (GrReducedClip::kAllIn_InitialState == initialState) {
+ ignoreClip = clipSpaceIBounds == clipSpaceRTIBounds;
+ } else {
+ return false;
}
- } break;
+ }
}
}
« no previous file with comments | « src/gpu/GrClip.cpp ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698