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

Unified Diff: include/core/SkClipStack.h

Issue 2263373002: check for wide-open inside quickContains (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « no previous file | src/core/SkClipStack.cpp » ('j') | src/gpu/GrClipStackClip.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
*/
« no previous file with comments | « no previous file | src/core/SkClipStack.cpp » ('j') | src/gpu/GrClipStackClip.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698