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

Unified Diff: src/gpu/GrReducedClip.h

Issue 2289363005: Improve usage of window rectangles (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_drawsinreducedclip
Patch Set: Improve usage of window rectangles Created 4 years, 3 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/GrPipeline.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 731d58f61c561d44e15f5ec6ada527d84c81027f..b8413e6df419172a13be12b0f1f9d2b58b1625b2 100644
--- a/src/gpu/GrReducedClip.h
+++ b/src/gpu/GrReducedClip.h
@@ -8,6 +8,7 @@
#ifndef GrReducedClip_DEFINED
#define GrReducedClip_DEFINED
+#include "GrWindowRectangles.h"
#include "SkClipStack.h"
#include "SkTLList.h"
@@ -20,11 +21,11 @@ class GrDrawContext;
*/
class SK_API GrReducedClip {
public:
- GrReducedClip(const SkClipStack& stack, const SkRect& queryBounds);
+ GrReducedClip(const SkClipStack&, const SkRect& queryBounds, int maxWindowRectangles = 0);
/**
- * 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.
+ * If hasIBounds() is true, this is the bounding box within which the clip elements are valid.
+ * The caller must not modify any pixels outside this box. Undefined if hasIBounds() is false.
*/
const SkIRect& ibounds() const { SkASSERT(fHasIBounds); return fIBounds; }
int left() const { return this->ibounds().left(); }
@@ -38,10 +39,16 @@ public:
*/
bool hasIBounds() const { return fHasIBounds; }
+ /**
+ * If nonempty, this is a set of "exclusive" windows within which the clip elements are NOT
+ * valid. The caller must not modify any pixels inside these windows.
+ */
+ const GrWindowRectangles& windowRectangles() const { return fWindowRects; }
+
typedef SkTLList<SkClipStack::Element, 16> ElementList;
/**
- * Populated with a minimal list of elements that implement the clip.
+ * Populated with a minimal list of elements required to fully implement the clip.
*/
const ElementList& elements() const { return fElements; }
@@ -67,15 +74,18 @@ public:
bool drawStencilClipMask(GrContext*, GrDrawContext*, const SkIPoint& clipOrigin) const;
private:
- void walkStack(const SkClipStack&, const SkRect& queryBounds);
+ void walkStack(const SkClipStack&, const SkRect& queryBounds, int maxWindowRectangles);
+ void addInteriorWindowRectangles(int maxWindowRectangles);
+ void addWindowRectangle(const SkRect& elementInteriorRect, bool elementIsAA);
bool intersectIBounds(const SkIRect&);
- SkIRect fIBounds;
- bool fHasIBounds;
- ElementList fElements;
- int32_t fElementsGenID;
- bool fRequiresAA;
- InitialState fInitialState;
+ SkIRect fIBounds;
+ bool fHasIBounds;
+ GrWindowRectangles fWindowRects;
+ ElementList fElements;
+ int32_t fElementsGenID;
+ bool fRequiresAA;
+ InitialState fInitialState;
};
#endif
« no previous file with comments | « src/gpu/GrPipeline.cpp ('k') | src/gpu/GrReducedClip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698