Support scaled color emojis for SDF fallback
This patch enables scaling for overlarge color emojis when trying to
render with SDFs, i.e. between 162 and 324 point in normal text
rendering mode. Also ensures that we only try to render blobs with
bitmap/SDF when the text size will fit in the atlas.
Bug: skia:
Change-Id: Ib675d99ef22bf66368dc8737ef63db4a5d3d5a9f
Reviewed-on: https://skia-review.googlesource.com/94361
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
diff --git a/src/gpu/text/GrAtlasTextContext.h b/src/gpu/text/GrAtlasTextContext.h
index 9c44128..b03ffa3 100644
--- a/src/gpu/text/GrAtlasTextContext.h
+++ b/src/gpu/text/GrAtlasTextContext.h
@@ -44,8 +44,8 @@
static std::unique_ptr<GrAtlasTextContext> Make(const Options& options);
- bool canDraw(const SkPaint&, const SkMatrix& viewMatrix, const SkSurfaceProps&,
- const GrShaderCaps&);
+ bool canDraw(const GrAtlasGlyphCache* fontCache, const SkPaint&, const SkMatrix& viewMatrix,
+ const SkSurfaceProps&, const GrShaderCaps&);
void drawText(GrContext*, GrTextUtils::Target*, const GrClip&, const SkPaint&,
const SkMatrix& viewMatrix, const SkSurfaceProps&, const char text[],
@@ -131,7 +131,7 @@
const SkMatrix& viewMatrix) const;
static void BmpAppendGlyph(GrAtlasTextBlob*, int runIndex, GrAtlasGlyphCache*,
- GrAtlasTextStrike**, const SkGlyph&, int left, int top,
+ GrAtlasTextStrike**, const SkGlyph&, SkScalar sx, SkScalar sy,
GrColor color, SkGlyphCache*, SkScalar textRatio);
static void DfAppendGlyph(GrAtlasTextBlob*, int runIndex, GrAtlasGlyphCache*,