aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDrawTarget.h
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2014-10-29 12:31:28 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-29 12:31:28 -0700
commit329bf4862e9d5e05363c2b071d8ca475a0ef1952 (patch)
tree168295ee2e6f3a9d92e9e3b9bb88adb70fc9f3e5 /src/gpu/GrDrawTarget.h
parentd50bbc7c057e194713dfccdbc0af6f5e3283a0ea (diff)
BUG=skia:
Diffstat (limited to 'src/gpu/GrDrawTarget.h')
-rw-r--r--src/gpu/GrDrawTarget.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index 3efa6bf357..1f26166f6e 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;
};