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/atlastext/SkAtlasTextTarget.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/atlastext/SkAtlasTextTarget.cpp') diff --git a/src/atlastext/SkAtlasTextTarget.cpp b/src/atlastext/SkAtlasTextTarget.cpp index 4d7d65d746..8a382c7233 100644 --- a/src/atlastext/SkAtlasTextTarget.cpp +++ b/src/atlastext/SkAtlasTextTarget.cpp @@ -74,6 +74,8 @@ void SkAtlasTextTarget::concat(const SkMatrix& matrix) { this->accessCTM()->preC ////////////////////////////////////////////////////////////////////////////// static const GrColorSpaceInfo kColorSpaceInfo(nullptr, kRGBA_8888_GrPixelConfig); +static const SkSurfaceProps kProps( + SkSurfaceProps::kUseDistanceFieldFonts_Flag, kUnknown_SkPixelGeometry); ////////////////////////////////////////////////////////////////////////////// @@ -83,7 +85,8 @@ public: int width, int height, void* handle) : GrTextUtils::Target(width, height, kColorSpaceInfo) - , SkAtlasTextTarget(std::move(context), width, height, handle) { + , SkAtlasTextTarget(std::move(context), width, height, handle) + , fGlyphDrawer(kProps, kColorSpaceInfo) { fOpMemoryPool = fContext->internal().grContext()->contextPriv().refOpMemoryPool(); } @@ -109,6 +112,10 @@ public: return this->context()->internal().grContext(); } + SkGlyphRunListDrawer* glyphDrawer() override { + return &fGlyphDrawer; + } + /** SkAtlasTextTarget overrides */ void drawText(const SkGlyphID[], const SkPoint[], int glyphCnt, uint32_t color, @@ -123,6 +130,7 @@ private: using SkAtlasTextTarget::fHeight; SkTArray, true> fOps; sk_sp fOpMemoryPool; + SkGlyphRunListDrawer fGlyphDrawer; }; ////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3