aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrStencilAndCoverTextContext.h
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2015-06-17 05:43:33 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-17 05:43:33 -0700
commit2334fb655f8d4ef5915770d32bf845c88d3627f4 (patch)
treea4bc1ef4636671f40201f6d4139ef092432d9810 /src/gpu/GrStencilAndCoverTextContext.h
parent48fc0ea272916a04f947bcd5bfce44fdab1f16b4 (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. Committed: https://skia.googlesource.com/skia/+/5b16e740fe6ab6d679083d06f07651602265081b Review URL: https://codereview.chromium.org/1175553002
Diffstat (limited to 'src/gpu/GrStencilAndCoverTextContext.h')
-rw-r--r--src/gpu/GrStencilAndCoverTextContext.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/gpu/GrStencilAndCoverTextContext.h b/src/gpu/GrStencilAndCoverTextContext.h
index d36b60f11c..920f2d7f42 100644
--- a/src/gpu/GrStencilAndCoverTextContext.h
+++ b/src/gpu/GrStencilAndCoverTextContext.h
@@ -23,7 +23,8 @@ class GrPathRange;
*/
class GrStencilAndCoverTextContext : public GrTextContext {
public:
- static GrStencilAndCoverTextContext* Create(GrContext*, const SkDeviceProperties&);
+ static GrStencilAndCoverTextContext* Create(GrContext*, GrDrawContext*,
+ const SkDeviceProperties&, bool fallbackUsesDFT);
virtual ~GrStencilAndCoverTextContext();
@@ -67,16 +68,16 @@ private:
SkMatrix fLocalMatrix;
bool fUsingDeviceSpaceGlyphs;
- GrStencilAndCoverTextContext(GrContext*, const SkDeviceProperties&);
+ GrStencilAndCoverTextContext(GrContext*, GrDrawContext*, const SkDeviceProperties&);
bool canDraw(const GrRenderTarget*, const GrClip&, const GrPaint&,
const SkPaint&, const SkMatrix& viewMatrix) override;
- void onDrawText(GrDrawContext*, GrRenderTarget*, const GrClip&, const GrPaint&, const SkPaint&,
+ void onDrawText(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPaint&,
const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
SkScalar x, SkScalar y, const SkIRect& regionClipBounds) override;
- void onDrawPosText(GrDrawContext*, GrRenderTarget*, const GrClip&, const GrPaint&, const SkPaint&,
+ void onDrawPosText(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPaint&,
const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
const SkScalar pos[], int scalarsPerPosition,
@@ -86,9 +87,9 @@ private:
size_t textByteLength, RenderMode, const SkMatrix& viewMatrix,
const SkIRect& regionClipBounds);
bool mapToFallbackContext(SkMatrix* inverse);
- void appendGlyph(GrDrawContext*, const SkGlyph&, const SkPoint&);
- void flush(GrDrawContext*);
- void finish(GrDrawContext*);
+ void appendGlyph(const SkGlyph&, const SkPoint&);
+ void flush();
+ void finish();
};