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; |