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

Unified Diff: src/core/SkRasterClip.h

Issue 443353004: add isRect() check to AAClip, to detect if a soft-clip is really just an irect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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/core/SkAAClip.cpp ('k') | src/core/SkRasterClip.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRasterClip.h
diff --git a/src/core/SkRasterClip.h b/src/core/SkRasterClip.h
index 0c2723314ccb3cc9fe1e3651990c0b8797456b13..29a925f2a283ade5ebc0d0125e40a1d4a2212deb 100644
--- a/src/core/SkRasterClip.h
+++ b/src/core/SkRasterClip.h
@@ -89,11 +89,19 @@ private:
}
bool computeIsRect() const {
- return fIsBW ? fBW.isRect() : false;
+ return fIsBW ? fBW.isRect() : fAA.isRect();
}
- bool updateCacheAndReturnNonEmpty() {
+ bool updateCacheAndReturnNonEmpty(bool detectAARect = true) {
fIsEmpty = this->computeIsEmpty();
+
+ // detect that our computed AA is really just a (hard-edged) rect
+ if (detectAARect && !fIsEmpty && !fIsBW && fAA.isRect()) {
+ fBW.setRect(fAA.getBounds());
+ fAA.setEmpty(); // don't need this guy anymore
+ fIsBW = true;
+ }
+
fIsRect = this->computeIsRect();
return !fIsEmpty;
}
« no previous file with comments | « src/core/SkAAClip.cpp ('k') | src/core/SkRasterClip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698