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

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: more improved testing 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 | « src/gpu/GrReducedClip.h ('k') | 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..251155bbcbc36121ba88cbd7caeb8a1d06a6e62f 100644
--- a/src/gpu/GrReducedClip.cpp
+++ b/src/gpu/GrReducedClip.cpp
@@ -316,15 +316,6 @@ static GrReducedClip::InitialState reduced_stack_walker(const SkClipStack& stack
}
*requiresAA = numAAElements > 0;
- if (0 == result->count()) {
- if (initialState == InitialTriState::kAllIn) {
- *resultGenID = SkClipStack::kWideOpenGenID;
- } else {
- *resultGenID = SkClipStack::kEmptyGenID;
- }
- }
-
- SkASSERT(SkClipStack::kInvalidGenID != *resultGenID);
SkASSERT(InitialTriState::kUnknown != initialState);
return static_cast<GrReducedClip::InitialState>(initialState);
}
@@ -338,11 +329,6 @@ take a rect in case the caller knows a bound on what is to be drawn through this
*/
GrReducedClip::GrReducedClip(const SkClipStack& stack, const SkRect& queryBounds) {
SkASSERT(!queryBounds.isEmpty());
-
- // The clip established by the element list might be cached based on the last
- // generation id. When we make early returns, we do not know what was the generation
- // id that lead to the state. Make a conservative guess.
- fGenID = stack.getTopmostGenID();
fHasIBounds = false;
if (stack.isWideOpen()) {
@@ -387,6 +373,7 @@ GrReducedClip::GrReducedClip(const SkClipStack& stack, const SkRect& queryBounds
// Implement the clip with an AA rect element.
fElements.addToHead(stackBounds, SkRegion::kReplace_Op, true/*doAA*/);
+ fElementsGenID = stack.getTopmostGenID();
fRequiresAA = true;
fInitialState = InitialState::kAllOut;
@@ -406,6 +393,6 @@ GrReducedClip::GrReducedClip(const SkClipStack& stack, const SkRect& queryBounds
// Now that we have determined the bounds to use and filtered out the trivial cases, call the
// helper that actually walks the stack.
- fInitialState = reduced_stack_walker(stack, tighterQuery, fIBounds, &fElements, &fGenID,
+ fInitialState = reduced_stack_walker(stack, tighterQuery, fIBounds, &fElements, &fElementsGenID,
&fRequiresAA);
}
« no previous file with comments | « src/gpu/GrReducedClip.h ('k') | tests/ClipStackTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698