diff options
author | Brian Salomon <bsalomon@google.com> | 2017-11-07 14:58:55 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-11-07 22:57:36 +0000 |
commit | 52db9400d74dcade2fa94ff08d0e583151144dd4 (patch) | |
tree | 474101ecc612c3a72c1f1cf124c54726bb2d8834 /src/gpu/text/GrTextUtils.h | |
parent | f90a2e6f74e14dc65651676c2894b65e5cc965c7 (diff) |
Move bmp/mask/sdf functionality from GrTextUtils to GrAtlasTextContext
Change-Id: I3924f2f9fd2860749f0404030d0be502a8153faa
Reviewed-on: https://skia-review.googlesource.com/68211
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/text/GrTextUtils.h')
-rw-r--r-- | src/gpu/text/GrTextUtils.h | 68 |
1 files changed, 13 insertions, 55 deletions
diff --git a/src/gpu/text/GrTextUtils.h b/src/gpu/text/GrTextUtils.h index d8d841f051..f72102d6cf 100644 --- a/src/gpu/text/GrTextUtils.h +++ b/src/gpu/text/GrTextUtils.h @@ -124,64 +124,22 @@ public: const SkSurfaceProps& fProps; }; - // Functions for appending BMP text to GrAtlasTextBlob - static void DrawBmpText(GrAtlasTextBlob*, int runIndex, GrAtlasGlyphCache*, - const SkSurfaceProps&, const Paint& paint, uint32_t scalerContextFlags, - const SkMatrix& viewMatrix, const char text[], size_t byteLength, - SkScalar x, SkScalar y); - - static void DrawBmpPosText(GrAtlasTextBlob*, int runIndex, GrAtlasGlyphCache*, - const SkSurfaceProps&, const Paint& paint, - uint32_t scalerContextFlags, const SkMatrix& viewMatrix, - const char text[], size_t byteLength, const SkScalar pos[], - int scalarsPerPosition, const SkPoint& offset); - - // functions for appending distance field text - static bool CanDrawAsDistanceFields(const SkPaint& skPaint, const SkMatrix& viewMatrix, - const SkSurfaceProps& props, const GrShaderCaps& caps); - - static void DrawDFText(GrAtlasTextBlob* blob, int runIndex, GrAtlasGlyphCache*, - const SkSurfaceProps&, const Paint& paint, uint32_t scalerContextFlags, - const SkMatrix& viewMatrix, const char text[], size_t byteLength, - SkScalar x, SkScalar y); - - static void DrawDFPosText(GrAtlasTextBlob* blob, int runIndex, GrAtlasGlyphCache*, - const SkSurfaceProps&, const Paint& paint, - uint32_t scalerContextFlags, const SkMatrix& viewMatrix, - const char text[], size_t byteLength, const SkScalar pos[], - int scalarsPerPosition, const SkPoint& offset); - - // Functions for drawing text as paths - static void DrawTextAsPath(GrContext*, Target*, const GrClip& clip, const SkPaint& paint, - const SkMatrix& viewMatrix, const char text[], size_t byteLength, - SkScalar x, SkScalar y, const SkIRect& clipBounds); - - static void DrawPosTextAsPath(GrContext* context, Target*, const SkSurfaceProps& props, - const GrClip& clip, const SkPaint& paint, - const SkMatrix& viewMatrix, const char text[], size_t byteLength, - const SkScalar pos[], int scalarsPerPosition, - const SkPoint& offset, const SkIRect& clipBounds); - - static bool ShouldDisableLCD(const SkPaint& paint); - - -private: static uint32_t FilterTextFlags(const SkSurfaceProps& surfaceProps, const SkPaint& paint); - static void InitDistanceFieldPaint(GrAtlasTextBlob* blob, - SkPaint* skPaint, - SkScalar* textRatio, - const SkMatrix& viewMatrix); - - static void BmpAppendGlyph(GrAtlasTextBlob*, int runIndex, GrAtlasGlyphCache*, - GrAtlasTextStrike**, const SkGlyph&, int left, int top, - GrColor color, SkGlyphCache*); + static bool ShouldDisableLCD(const SkPaint& paint); - static bool DfAppendGlyph(GrAtlasTextBlob*, int runIndex, GrAtlasGlyphCache*, - GrAtlasTextStrike**, const SkGlyph&, - SkScalar sx, SkScalar sy, GrColor color, - SkGlyphCache* cache, - SkScalar textRatio, const SkMatrix& viewMatrix); + // Functions for drawing text as paths + static void DrawTextAsPath(GrContext*, GrTextUtils::Target*, const GrClip& clip, + const SkPaint& paint, const SkMatrix& viewMatrix, const char text[], + size_t byteLength, SkScalar x, SkScalar y, + const SkIRect& clipBounds); + + static void DrawPosTextAsPath(GrContext* context, GrTextUtils::Target*, + const SkSurfaceProps& props, const GrClip& clip, + const SkPaint& paint, const SkMatrix& viewMatrix, + const char text[], size_t byteLength, const SkScalar pos[], + int scalarsPerPosition, const SkPoint& offset, + const SkIRect& clipBounds); }; #endif |