From 12e42565886ac6b28cbcae40d63ee093bde3e630 Mon Sep 17 00:00:00 2001 From: Herb Derby Date: Sat, 28 Jul 2018 14:27:48 -0400 Subject: Make a glyphrun version of DrawBmpPosTextAsPaths Make a copy of DrawBmpPosTextAsPaths called DrawBmpGlyphRunAsPaths which uses a glyph run instead of having to process all the text types. In addition, rearrange the other loops to be located closely in the code. So, only DrawBmpGlyphRunAsPaths is changed code. Change-Id: Ic19678ee59189341d2151ccf55f78c8e111f8f4c Reviewed-on: https://skia-review.googlesource.com/144300 Reviewed-by: Jim Van Verth Commit-Queue: Jim Van Verth Auto-Submit: Herb Derby --- src/gpu/text/GrTextContext.h | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'src/gpu/text/GrTextContext.h') diff --git a/src/gpu/text/GrTextContext.h b/src/gpu/text/GrTextContext.h index 21657469c5..6bfa718712 100644 --- a/src/gpu/text/GrTextContext.h +++ b/src/gpu/text/GrTextContext.h @@ -151,6 +151,24 @@ private: // Determines if we need to use fake gamma (and contrast boost): static SkScalerContextFlags ComputeScalerContextFlags(const GrColorSpaceInfo&); + void drawDFGlyphRun(GrTextBlob* blob, int runIndex, GrGlyphCache*, + const SkSurfaceProps&, const GrTextUtils::Paint& paint, + SkScalerContextFlags scalerContextFlags, + const SkMatrix& viewMatrix, const SkGlyphRun& glyphRun, + const SkPoint& offset) const; + + static void DrawBmpGlyphRunAsPaths(GrTextBlob*, int runIndex, GrGlyphCache*, + const SkSurfaceProps&, const GrTextUtils::Paint& paint, + SkScalerContextFlags scalerContextFlags, + const SkMatrix& viewMatrix, + const SkGlyphRun& glyphRun, + const SkPoint& offset); + + static void DrawBmpGlyphRun(GrTextBlob*, int runIndex, GrGlyphCache*, + const SkSurfaceProps&, const GrTextUtils::Paint& paint, + SkScalerContextFlags scalerContextFlags, const SkMatrix& viewMatrix, + const SkGlyphRun& glyphRun, const SkPoint& offset); + void regenerateGlyphRunList(GrTextBlob* bmp, GrGlyphCache*, const GrShaderCaps&, @@ -178,10 +196,7 @@ private: const char text[], size_t byteLength, const SkScalar pos[], int scalarsPerPosition, const SkPoint& offset); - static void DrawBmpGlyphRun(GrTextBlob*, int runIndex, GrGlyphCache*, - const SkSurfaceProps&, const GrTextUtils::Paint& paint, - SkScalerContextFlags scalerContextFlags, const SkMatrix& viewMatrix, - const SkGlyphRun& glyphRun, const SkPoint& offset); + static void DrawBmpPosTextAsPaths(GrTextBlob*, int runIndex, GrGlyphCache*, const SkSurfaceProps&, const GrTextUtils::Paint& paint, @@ -199,11 +214,6 @@ private: size_t byteLength, const SkScalar pos[], int scalarsPerPosition, const SkPoint& offset) const; - void drawDFGlyphRun(GrTextBlob* blob, int runIndex, GrGlyphCache*, - const SkSurfaceProps&, const GrTextUtils::Paint& paint, - SkScalerContextFlags scalerContextFlags, - const SkMatrix& viewMatrix, const SkGlyphRun& glyphRun, - const SkPoint& offset) const; static void BmpAppendGlyph(GrTextBlob*, int runIndex, GrGlyphCache*, sk_sp*, const SkGlyph&, SkScalar sx, SkScalar sy, -- cgit v1.2.3