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

Unified Diff: src/gpu/GrReducedClip.h

Issue 2246113002: Convert GrAppliedClip interface to builder style (Closed) Base URL: https://skia.googlesource.com/skia.git@fixstencilpath
Patch Set: Convert GrAppliedClip interface to builder style 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 | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrReducedClip.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrReducedClip.h
diff --git a/src/gpu/GrReducedClip.h b/src/gpu/GrReducedClip.h
index 07e06694a1764197d55de8139b06a2d5f91f17e3..d7b7ea88811c3671389af313b80102142809fff7 100644
--- a/src/gpu/GrReducedClip.h
+++ b/src/gpu/GrReducedClip.h
@@ -25,14 +25,20 @@ public:
int32_t genID() const { return fGenID; }
/**
- * Bounding box within which the reduced clip is valid. The caller must not draw any pixels
- * outside this box.
+ * If hasIBounds() is true, this is the bounding box within which the reduced clip is valid, and
+ * the caller must not modify any pixels outside this box. Undefined if hasIBounds() is false.
*/
- const SkIRect& iBounds() const { return fIBounds; }
- int left() const { return this->iBounds().left(); }
- int top() const { return this->iBounds().top(); }
- int width() const { return this->iBounds().width(); }
- int height() const { return this->iBounds().height(); }
+ const SkIRect& ibounds() const { SkASSERT(fHasIBounds); return fIBounds; }
+ int left() const { return this->ibounds().left(); }
+ int top() const { return this->ibounds().top(); }
+ int width() const { return this->ibounds().width(); }
+ int height() const { return this->ibounds().height(); }
+
+ /**
+ * Indicates whether ibounds() are defined. They will always be defined if the elements() are
+ * nonempty.
+ */
+ bool hasIBounds() const { return fHasIBounds; }
typedef SkTLList<SkClipStack::Element, 16> ElementList;
@@ -51,14 +57,12 @@ public:
kAllOut
};
- /**
- * The initial state of the clip within iBounds().
- */
InitialState initialState() const { return fInitialState; }
private:
int32_t fGenID;
SkIRect fIBounds;
+ bool fHasIBounds;
ElementList fElements;
bool fRequiresAA;
InitialState fInitialState;
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrReducedClip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698