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

Unified Diff: src/gpu/GrReducedClip.cpp

Issue 2244223004: Make GrReducedClip's gen ID only apply to the element list (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix GrReducedClip::fGenID to be kEmpty/kWideOpen when appropriate Created 4 years, 4 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 | tests/ClipStackTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrReducedClip.cpp
diff --git a/src/gpu/GrReducedClip.cpp b/src/gpu/GrReducedClip.cpp
index 132936c64e0c811e422279c8aa9967336fe1146d..8de96e86d8888d363d863146845ee031bf6e3817 100644
--- a/src/gpu/GrReducedClip.cpp
+++ b/src/gpu/GrReducedClip.cpp
@@ -346,6 +346,7 @@ GrReducedClip::GrReducedClip(const SkClipStack& stack, const SkRect& queryBounds
fHasIBounds = false;
if (stack.isWideOpen()) {
+ fGenID = SkClipStack::kWideOpenGenID;
fInitialState = InitialState::kAllIn;
return;
}
@@ -356,26 +357,37 @@ GrReducedClip::GrReducedClip(const SkClipStack& stack, const SkRect& queryBounds
stack.getBounds(&stackBounds, &stackBoundsType, &iior);
if (stackBounds.isEmpty() || GrClip::IsOutsideClip(stackBounds, queryBounds)) {
- bool insideOut = SkClipStack::kInsideOut_BoundsType == stackBoundsType;
- fInitialState = insideOut ? InitialState::kAllIn : InitialState::kAllOut;
+ if (SkClipStack::kInsideOut_BoundsType == stackBoundsType) {
+ fGenID = SkClipStack::kWideOpenGenID;
+ fInitialState = InitialState::kAllIn;
+ } else {
+ fGenID = SkClipStack::kEmptyGenID;
+ fInitialState = InitialState::kAllOut;
+ }
return;
}
if (iior) {
// "Is intersection of rects" means the clip is a single rect indicated by the stack bounds.
- // This should only be true if aa/non-aa status matches among all elements.
SkASSERT(SkClipStack::kNormal_BoundsType == stackBoundsType);
+ if (GrClip::IsInsideClip(stackBounds, queryBounds)) {
+ fGenID = SkClipStack::kWideOpenGenID;
+ fInitialState = InitialState::kAllIn;
+ return;
+ }
+ // iior should only be true if aa/non-aa status matches among all elements.
SkClipStack::Iter iter(stack, SkClipStack::Iter::kTop_IterStart);
if (!iter.prev()->isAA() || GrClip::IsPixelAligned(stackBounds)) {
// The clip is a non-aa rect. This is the one spot where we can actually implement the
// clip (using fIBounds) rather than just telling the caller what it should be.
stackBounds.round(&fIBounds);
- fHasIBounds = true;
- fInitialState = fIBounds.isEmpty() ? InitialState::kAllOut : InitialState::kAllIn;
- return;
- }
- if (GrClip::IsInsideClip(stackBounds, queryBounds)) {
- fInitialState = InitialState::kAllIn;
+ if (fIBounds.isEmpty()) {
+ fGenID = SkClipStack::kEmptyGenID;
+ fInitialState = InitialState::kAllOut;
+ } else {
+ fHasIBounds = true;
+ fInitialState = InitialState::kAllIn;
+ }
return;
}
« no previous file with comments | « no previous file | tests/ClipStackTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698