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

Unified Diff: src/gpu/GrDrawTarget.h

Issue 683673002: clear stencil clip on draw target (Closed) Base URL: https://skia.googlesource.com/skia.git@aa_rect_takes_gpu
Patch Set: rebase Created 6 years, 2 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/GrClipMaskManager.cpp ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawTarget.h
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index 3c2341a366feab944f03819cf9ebe198f74bf543..3efa6bf3577a564b7bc383411e6d09a31caea074 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -9,6 +9,7 @@
#define GrDrawTarget_DEFINED
#include "GrClipData.h"
+#include "GrClipMaskManager.h"
#include "GrContext.h"
#include "GrDrawState.h"
#include "GrIndexBuffer.h"
@@ -692,15 +693,6 @@ public:
virtual DrawToken getCurrentDrawToken() { return DrawToken(this, 0); }
- // The state of the scissor is controlled by the clip manager, no one else should set
- // Scissor state
- struct ScissorState {
- ScissorState() : fEnabled(false) {}
- void set(const SkIRect& rect) { fRect = rect; fEnabled = true; }
- bool fEnabled;
- SkIRect fRect;
- };
-
protected:
// Extend access to GrDrawState::convertToPEndeingExec to subclasses.
void convertDrawStateToPendingExec(GrDrawState* ds) {
@@ -949,4 +941,19 @@ private:
typedef SkRefCnt INHERITED;
};
+class GrClipTarget : public GrDrawTarget {
+public:
+ GrClipTarget(GrContext* context) : INHERITED(context) {}
+ /**
+ * Clip Mask Manager(and no one else) needs to clear private stencil bits.
+ * ClipTarget subclass sets clip bit in the stencil buffer. The subclass
+ * is free to clear the remaining bits to zero if masked clears are more
+ * expensive than clearing all bits.
+ */
+ virtual void clearStencilClip(const SkIRect& rect, bool insideClip, GrRenderTarget* = NULL) = 0;
+
+private:
+ typedef GrDrawTarget INHERITED;
+};
+
#endif
« no previous file with comments | « src/gpu/GrClipMaskManager.cpp ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698