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

Unified Diff: src/gpu/GrReducedClip.cpp

Issue 27170003: Turn clear-to-white-then-intersect clips into clear-to-black-then-replace (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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/GrReducedClip.cpp
diff --git a/src/gpu/GrReducedClip.cpp b/src/gpu/GrReducedClip.cpp
index da42e8cff87c098c4827705aa83ca579a202d4b7..2b6583e3e328f2a5454620a3c2ae68b3a992c7de 100644
--- a/src/gpu/GrReducedClip.cpp
+++ b/src/gpu/GrReducedClip.cpp
@@ -355,7 +355,13 @@ void reduced_stack_walker(const SkClipStack& stack,
break;
case SkRegion::kIntersect_Op:
// intersecting with the empty set yields the empty set
- skippable = kAllOut_InitialState == *initialState;
+ if (kAllOut_InitialState == *initialState) {
+ skippable = true;
+ } else {
+ // We can clear to zero and then simply draw the clip element.
+ *initialState = kAllOut_InitialState;
+ element->setOp(SkRegion::kReplace_Op);
+ }
break;
case SkRegion::kUnion_Op:
if (kAllIn_InitialState == *initialState) {
« 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