aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2016-02-16 10:36:53 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-16 10:36:53 -0800
commit96880d9e366d58e5960aa0ee6aa67260797679eb (patch)
tree4aec09d45ade79453eaedb86b676b9dbf5d60952 /include
parent3341d428d3e49803e4f31f439a193e9e2c199daa (diff)
Create GrPathRenderingDrawContext
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrDrawContext.h40
1 files changed, 23 insertions, 17 deletions
diff --git a/include/gpu/GrDrawContext.h b/include/gpu/GrDrawContext.h
index 4c884154e3..bf0de334ab 100644
--- a/include/gpu/GrDrawContext.h
+++ b/include/gpu/GrDrawContext.h
@@ -52,17 +52,17 @@ public:
// TODO: it is odd that we need both the SkPaint in the following 3 methods.
// We should extract the text parameters from SkPaint and pass them separately
// akin to GrStrokeInfo (GrTextInfo?)
- void drawText(const GrClip&, const GrPaint&, const SkPaint&,
- const SkMatrix& viewMatrix, const char text[], size_t byteLength,
- SkScalar x, SkScalar y, const SkIRect& clipBounds);
- void drawPosText(const GrClip&, const GrPaint&, const SkPaint&,
- const SkMatrix& viewMatrix, const char text[], size_t byteLength,
- const SkScalar pos[], int scalarsPerPosition,
- const SkPoint& offset, const SkIRect& clipBounds);
- void drawTextBlob(const GrClip&, const SkPaint&,
- const SkMatrix& viewMatrix, const SkTextBlob*,
- SkScalar x, SkScalar y,
- SkDrawFilter*, const SkIRect& clipBounds);
+ virtual void drawText(const GrClip&, const GrPaint&, const SkPaint&,
+ const SkMatrix& viewMatrix, const char text[], size_t byteLength,
+ SkScalar x, SkScalar y, const SkIRect& clipBounds);
+ virtual void drawPosText(const GrClip&, const GrPaint&, const SkPaint&,
+ const SkMatrix& viewMatrix, const char text[], size_t byteLength,
+ const SkScalar pos[], int scalarsPerPosition,
+ const SkPoint& offset, const SkIRect& clipBounds);
+ virtual void drawTextBlob(const GrClip&, const SkPaint&,
+ const SkMatrix& viewMatrix, const SkTextBlob*,
+ SkScalar x, SkScalar y,
+ SkDrawFilter*, const SkIRect& clipBounds);
/**
* Provides a perfomance hint that the render target's contents are allowed
@@ -282,14 +282,20 @@ public:
// Functions intended for internal use only.
void internal_drawBatch(const GrPipelineBuilder& pipelineBuilder, GrDrawBatch* batch);
-private:
- friend class GrAtlasTextBlob; // for access to drawBatch
- friend class GrDrawingManager; // for ctor
+protected:
+ GrDrawContext(GrContext*, GrDrawingManager*, GrRenderTarget*,
+ const SkSurfaceProps* surfaceProps, GrAuditTrail*, GrSingleOwner*);
+ GrDrawingManager* drawingManager() { return fDrawingManager; }
+ GrAuditTrail* auditTrail() { return fAuditTrail; }
+ const SkSurfaceProps& surfaceProps() const { return fSurfaceProps; }
+
+ SkDEBUGCODE(GrSingleOwner* singleOwner() { return fSingleOwner; })
SkDEBUGCODE(void validate() const;)
- GrDrawContext(GrContext*, GrDrawingManager*, GrRenderTarget*,
- const SkSurfaceProps* surfaceProps, GrAuditTrail*, GrSingleOwner*);
+private:
+ friend class GrAtlasTextBlob; // for access to drawBatch
+ friend class GrDrawingManager; // for ctor
void internalDrawPath(GrPipelineBuilder*,
const SkMatrix& viewMatrix,
@@ -310,7 +316,7 @@ private:
// In MDB-mode the drawTarget can be closed by some other drawContext that has picked
// it up. For this reason, the drawTarget should only ever be accessed via 'getDrawTarget'.
GrDrawTarget* fDrawTarget;
- GrTextContext* fTextContext; // lazily gotten from GrContext::DrawingManager
+ GrTextContext* fAtlasTextContext; // lazily gotten from GrContext::DrawingManager
GrContext* fContext;
SkSurfaceProps fSurfaceProps;