aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrTextContext.h
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2015-06-16 12:23:47 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-16 12:23:47 -0700
commit5b16e740fe6ab6d679083d06f07651602265081b (patch)
tree3a6be38dc79d0bb7316a3fd71943403e2edf3171 /src/gpu/GrTextContext.h
parent48297f72fb852bed08d4af4de23366dfae39c245 (diff)
Make GrTextContext be owned by the GrDrawContext
This CL makes the GrTextContext be owned (and hidden) by the GrDrawContext. This funnels all the drawText* calls through the GrDrawContext and hides the (dispreferred) GrPipelineBuilder drawText variant. Some consequences of this are: GrDrawContext now has to get the text drawing settings (i.e., SkDeviceProperties & useDFT). This means that we need a separate GrDrawContext for each combination of pixel geometry and DFT-use. All the GrTextContext-derived classes now get a back pointer to the originating GrDrawContext so their method calls no longer take one. Review URL: https://codereview.chromium.org/1175553002
Diffstat (limited to 'src/gpu/GrTextContext.h')
-rw-r--r--src/gpu/GrTextContext.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gpu/GrTextContext.h b/src/gpu/GrTextContext.h
index f4c0982ed4..775203e544 100644
--- a/src/gpu/GrTextContext.h
+++ b/src/gpu/GrTextContext.h
@@ -48,6 +48,7 @@ protected:
GrContext* fContext;
SkDeviceProperties fDeviceProperties;
+ GrDrawContext* fDrawContext; // owning drawContext
SkAutoTUnref<GrRenderTarget> fRenderTarget;
GrClip fClip;
SkIRect fClipRect;
@@ -55,27 +56,27 @@ protected:
GrPaint fPaint;
SkPaint fSkPaint;
- GrTextContext(GrContext*, const SkDeviceProperties&);
+ GrTextContext(GrContext*, GrDrawContext*, const SkDeviceProperties&);
virtual bool canDraw(const GrRenderTarget*, const GrClip&, const GrPaint&,
const SkPaint&, const SkMatrix& viewMatrix) = 0;
- virtual void onDrawText(GrDrawContext*, GrRenderTarget*, const GrClip&,
+ virtual void onDrawText(GrRenderTarget*, const GrClip&,
const GrPaint&, const SkPaint&,
const SkMatrix& viewMatrix, const char text[], size_t byteLength,
SkScalar x, SkScalar y, const SkIRect& clipBounds) = 0;
- virtual void onDrawPosText(GrDrawContext*, GrRenderTarget*, const GrClip&,
+ virtual void onDrawPosText(GrRenderTarget*, 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) = 0;
- void drawTextAsPath(GrDrawContext*, GrRenderTarget*, const GrClip& clip,
+ void drawTextAsPath(GrRenderTarget*, const GrClip& clip,
const SkPaint& origPaint, const SkMatrix& viewMatrix,
const char text[], size_t byteLength, SkScalar x, SkScalar y,
const SkIRect& clipBounds);
- void drawPosTextAsPath(GrDrawContext*, GrRenderTarget*, const GrClip& clip,
+ void drawPosTextAsPath(GrRenderTarget*, const GrClip& clip,
const SkPaint& origPaint, const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
const SkScalar pos[], int scalarsPerPosition,