Index: include/core/SkClipStack.h |
diff --git a/include/core/SkClipStack.h b/include/core/SkClipStack.h |
index 2f2e940c8c6c74b6ad1e8c80d08ff746ab7a1943..fb0b278405b3e35cb545d8746b7fd3bcfba7491a 100644 |
--- a/include/core/SkClipStack.h |
+++ b/include/core/SkClipStack.h |
@@ -333,8 +333,13 @@ public: |
* by the clip. A return value of false does not guarantee that the (r)rect |
* is not contained by the clip. |
*/ |
- bool quickContains(const SkRect& devRect) const; |
- bool quickContains(const SkRRect& devRRect) const; |
+ bool quickContains(const SkRect& devRect) const { |
+ return this->isWideOpen() || this->internalQuickContains(devRect); |
+ } |
+ |
+ bool quickContains(const SkRRect& devRRect) const { |
+ return this->isWideOpen() || this->internalQuickContains(devRRect); |
+ } |
/** |
* Flattens the clip stack into a single SkPath. Returns true if any of |
@@ -357,7 +362,7 @@ public: |
* isWideOpen returns true if the clip state corresponds to the infinite |
* plane (i.e., draws are not limited at all) |
*/ |
- bool isWideOpen() const; |
+ bool isWideOpen() const { return this->getTopmostGenID() == kWideOpenGenID; } |
/** |
* The generation ID has three reserved values to indicate special |
@@ -479,6 +484,9 @@ private: |
// invalid ID. |
static int32_t gGenID; |
+ bool internalQuickContains(const SkRect& devRect) const; |
+ bool internalQuickContains(const SkRRect& devRRect) const; |
+ |
/** |
* Helper for clipDevPath, etc. |
*/ |