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

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: feedback inc 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
Index: src/gpu/GrDrawTarget.h
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index 33d5efec4fc9edd3f7062f941f1b083b9291e8d6..92e99c6dd762f27127367aca6f632040c7c38d04 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

Powered by Google App Engine
This is Rietveld 408576698