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

Unified Diff: src/gpu/GrDrawTarget.h

Issue 683933003: Clip mask manager moved to ClipTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@clear_stencil_clip_on_drawinfo
Patch Set: rebase on master 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/GrDrawTarget.cpp » ('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 3efa6bf3577a564b7bc383411e6d09a31caea074..1f26166f6e9f96ddc66cc744f0346727b1001c61 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -505,6 +505,9 @@ public:
const GrDeviceCoordTexture* dstCopy) {
this->onDrawPaths(pathRange, indices, count, transforms, transformsType, fill, dstCopy);
}
+
+ void getPathStencilSettingsForFillType(SkPath::FillType, GrStencilSettings*);
+
////////////////////////////////////////////////////////////////////////////
/**
@@ -923,6 +926,7 @@ private:
// Check to see if this set of draw commands has been sent out
virtual bool isIssued(uint32_t drawID) { return true; }
+ virtual GrClipMaskManager* getClipMaskManager() = 0;
enum {
kPreallocGeoSrcStateStackCnt = 4,
@@ -941,9 +945,21 @@ private:
typedef SkRefCnt INHERITED;
};
+/*
+ * This class is JUST for clip mask manager. Everyone else should just use draw target above.
+ */
class GrClipTarget : public GrDrawTarget {
public:
- GrClipTarget(GrContext* context) : INHERITED(context) {}
+ GrClipTarget(GrContext* context) : INHERITED(context) {
+ fClipMaskManager.setClipTarget(this);
+ }
+
+ /* Clip mask manager needs access to the context.
+ * TODO we only need a very small subset of context in the CMM.
+ */
+ GrContext* getContext() { return INHERITED::getContext(); }
+ const GrContext* getContext() const { return INHERITED::getContext(); }
+
/**
* Clip Mask Manager(and no one else) needs to clear private stencil bits.
* ClipTarget subclass sets clip bit in the stencil buffer. The subclass
@@ -952,7 +968,12 @@ public:
*/
virtual void clearStencilClip(const SkIRect& rect, bool insideClip, GrRenderTarget* = NULL) = 0;
+protected:
+ GrClipMaskManager fClipMaskManager;
+
private:
+ GrClipMaskManager* getClipMaskManager() { return &fClipMaskManager; }
+
typedef GrDrawTarget INHERITED;
};
« no previous file with comments | « src/gpu/GrClipMaskManager.cpp ('k') | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698