From 74c6ed3d1f179209ec90025532310d9c8151999f Mon Sep 17 00:00:00 2001 From: Herb Derby Date: Sat, 28 Jul 2018 18:07:54 -0400 Subject: Move one leaf loop from GPU to glyph drawer Encapsulate the bitmap inner loop of regenerate in the SkGlyphRunListDrawer. This changed required placing an SkGlyphRunListDrawer in the two TextTargets. Change-Id: I7ef7a2d0074fe898fce4da82d26ea1f47e1f7a98 Reviewed-on: https://skia-review.googlesource.com/144302 Reviewed-by: Jim Van Verth Reviewed-by: Brian Salomon Commit-Queue: Herb Derby --- src/core/SkGlyphRun.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/core/SkGlyphRun.h') diff --git a/src/core/SkGlyphRun.h b/src/core/SkGlyphRun.h index 26590c1251..6bdc633091 100644 --- a/src/core/SkGlyphRun.h +++ b/src/core/SkGlyphRun.h @@ -21,7 +21,10 @@ #include "SkTemplates.h" #include "SkTextBlobPriv.h" #include "SkTypes.h" - +#if SK_SUPPORT_GPU +class GrColorSpaceInfo; +class GrRenderTargetContext; +#endif class SkBaseDevice; class SkGlyphRunList; class SkRasterClip; @@ -109,18 +112,26 @@ public: SkGlyphRunListDrawer( const SkSurfaceProps& props, SkColorType colorType, SkScalerContextFlags flags); - using PerMask = std::function; + #if SK_SUPPORT_GPU + SkGlyphRunListDrawer(const SkSurfaceProps&, const GrColorSpaceInfo&); + explicit SkGlyphRunListDrawer(const GrRenderTargetContext& renderTargetContext); + #endif + + using PerMask = std::function; using PerMaskCreator = std::function; using PerPath = std::function; using PerPathCreator = std::function; - void drawForBitmap( + void drawForBitmapDevice( const SkGlyphRunList& glyphRunList, const SkMatrix& deviceMatrix, PerMaskCreator perMaskCreator, PerPathCreator perPathCreator); + void drawUsingMasks( + SkGlyphCache* cache, const SkGlyphRun& glyphRun, SkPoint origin, + const SkMatrix& deviceMatrix, PerMask perMask); private: static bool ShouldDrawAsPath(const SkPaint& paint, const SkMatrix& matrix); bool ensureBitmapBuffers(size_t runSize); - void drawGlyphRunAsPaths( + void drawUsingPaths( const SkGlyphRun& glyphRun, SkPoint origin, const SkSurfaceProps& props, PerPath perPath) const; void drawGlyphRunAsSubpixelMask( -- cgit v1.2.3