Index: include/gpu/GrClip.h |
diff --git a/include/gpu/GrClip.h b/include/gpu/GrClip.h |
index a6a0a665bdca0174f5937bca753eb662a9a7ee34..26a88b3b7e403eaa6c18bda55f7b15d55556ab63 100644 |
--- a/include/gpu/GrClip.h |
+++ b/include/gpu/GrClip.h |
@@ -10,6 +10,7 @@ |
#include "GrFragmentProcessor.h" |
#include "GrTypesPriv.h" |
+#include "GrWindowRectangles.h" |
class GrDrawContext; |
@@ -25,6 +26,7 @@ public: |
} |
const GrScissorState& scissorState() const { return fScissorState; } |
+ const GrWindowRectangles& windows() const { return fWindows; } |
GrFragmentProcessor* clipCoverageFragmentProcessor() const { return fClipCoverageFP.get(); } |
bool hasStencilClip() const { return fHasStencilClip; } |
@@ -35,6 +37,14 @@ public: |
return fScissorState.intersect(irect) && fClippedDrawBounds.intersect(SkRect::Make(irect)); |
} |
+ /** |
+ * Adds an exclusive window rectangle to the clip. It is not currently supported to switch the |
+ * windows to inclusive mode. |
+ */ |
+ void addWindowRectangle(const SkIRect& window, const GrCaps& caps) { |
+ fWindows.addWindow(window, caps); |
+ } |
+ |
void addCoverageFP(sk_sp<GrFragmentProcessor> fp) { |
SkASSERT(!fClipCoverageFP); |
fClipCoverageFP = fp; |
@@ -53,6 +63,7 @@ public: |
private: |
GrScissorState fScissorState; |
+ GrWindowRectangles fWindows; |
sk_sp<GrFragmentProcessor> fClipCoverageFP; |
bool fHasStencilClip; |
SkRect fClippedDrawBounds; |