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

Unified Diff: src/gpu/GrAppliedClip.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 | « include/private/GrSurfaceProxy.h ('k') | src/gpu/GrClipStackClip.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAppliedClip.h
diff --git a/src/gpu/GrAppliedClip.h b/src/gpu/GrAppliedClip.h
index c02e9d01c268ea7b162c66cc30b47f88ad59fac3..3e98c6cb056985d6cafdd242c9385185b706241d 100644
--- a/src/gpu/GrAppliedClip.h
+++ b/src/gpu/GrAppliedClip.h
@@ -8,8 +8,8 @@
#ifndef GrAppliedClip_DEFINED
#define GrAppliedClip_DEFINED
-#include "GrTypesPriv.h"
-#include "GrWindowRectangles.h"
+#include "GrScissorState.h"
+#include "GrWindowRectsState.h"
class GrFragmentProcessor;
@@ -25,7 +25,7 @@ public:
}
const GrScissorState& scissorState() const { return fScissorState; }
- const GrWindowRectangles& windowRects() const { return fWindowRects; }
+ const GrWindowRectsState& windowRectsState() const { return fWindowRectsState; }
GrFragmentProcessor* clipCoverageFragmentProcessor() const { return fClipCoverageFP.get(); }
bool hasStencilClip() const { return fHasStencilClip; }
@@ -36,12 +36,15 @@ 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) {
- fWindowRects.addWindow(window);
+ void addWindowRectangles(const GrWindowRectsState& windowState) {
+ SkASSERT(!fWindowRectsState.enabled());
+ fWindowRectsState = windowState;
+ }
+
+ void addWindowRectangles(const GrWindowRectangles& windows, const SkIPoint& origin,
+ GrWindowRectsState::Mode mode) {
+ SkASSERT(!fWindowRectsState.enabled());
+ fWindowRectsState.set(windows, origin, mode);
}
void addCoverageFP(sk_sp<GrFragmentProcessor> fp) {
@@ -62,7 +65,7 @@ public:
private:
GrScissorState fScissorState;
- GrWindowRectangles fWindowRects;
+ GrWindowRectsState fWindowRectsState;
sk_sp<GrFragmentProcessor> fClipCoverageFP;
bool fHasStencilClip;
SkRect fClippedDrawBounds;
« no previous file with comments | « include/private/GrSurfaceProxy.h ('k') | src/gpu/GrClipStackClip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698