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

Unified Diff: src/core/SkClipStack.cpp

Issue 2241273003: Attempt to throw away rrect clips of rrects. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: fix int to scalar warnings 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 | « include/gpu/GrClip.h ('k') | src/gpu/GrClipStackClip.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkClipStack.cpp
diff --git a/src/core/SkClipStack.cpp b/src/core/SkClipStack.cpp
index 06418b46ba17966a65fea7703eb2125ddc66d739..12ad3bb27c28fc282180558355efbd1864e9f60f 100644
--- a/src/core/SkClipStack.cpp
+++ b/src/core/SkClipStack.cpp
@@ -646,6 +646,31 @@ bool SkClipStack::quickContains(const SkRect& rect) const {
return true;
}
+bool SkClipStack::quickContains(const SkRRect& rrect) const {
+
+ Iter iter(*this, Iter::kTop_IterStart);
+ const Element* element = iter.prev();
+ while (element != nullptr) {
+ if (SkRegion::kIntersect_Op != element->getOp() && SkRegion::kReplace_Op != element->getOp())
+ return false;
+ if (element->isInverseFilled()) {
+ // Part of 'rrect' could be trimmed off by the inverse-filled clip element
+ if (SkRect::Intersects(element->getBounds(), rrect.getBounds())) {
+ return false;
+ }
+ } else {
+ if (!element->contains(rrect)) {
+ return false;
+ }
+ }
+ if (SkRegion::kReplace_Op == element->getOp()) {
+ break;
+ }
+ element = iter.prev();
+ }
+ return true;
+}
+
bool SkClipStack::asPath(SkPath *path) const {
bool isAA = false;
« no previous file with comments | « include/gpu/GrClip.h ('k') | src/gpu/GrClipStackClip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698