diff options
author | 2018-01-16 16:26:35 -0500 | |
---|---|---|
committer | 2018-01-17 15:45:36 +0000 | |
commit | c65b65dd816b7a9fbd148f577f0271cd555c4df6 (patch) | |
tree | bd6e4ed33675f28f7a478bdc53002d4e8b4413b3 /src/core/SkDraw.cpp | |
parent | 8baaef9f542597fe786df5f9884830376f691fd6 (diff) |
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>
Diffstat (limited to 'src/core/SkDraw.cpp')
-rw-r--r-- | src/core/SkDraw.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp index 5068fb0151..a0f08e5916 100644 --- a/src/core/SkDraw.cpp +++ b/src/core/SkDraw.cpp @@ -1353,7 +1353,7 @@ void SkDraw::drawSprite(const SkBitmap& bitmap, int x, int y, const SkPaint& ori #include "SkTextToPathIter.h" #include "SkUtils.h" -bool SkDraw::ShouldDrawTextAsPaths(const SkPaint& paint, const SkMatrix& ctm) { +bool SkDraw::ShouldDrawTextAsPaths(const SkPaint& paint, const SkMatrix& ctm, SkScalar sizeLimit) { // hairline glyphs are fast enough so we don't need to cache them if (SkPaint::kStroke_Style == paint.getStyle() && 0 == paint.getStrokeWidth()) { return true; @@ -1366,7 +1366,7 @@ bool SkDraw::ShouldDrawTextAsPaths(const SkPaint& paint, const SkMatrix& ctm) { SkMatrix textM; SkPaintPriv::MakeTextMatrix(&textM, paint); - return SkPaint::TooBigToUseCache(ctm, textM); + return SkPaint::TooBigToUseCache(ctm, textM, sizeLimit); } void SkDraw::drawText_asPaths(const char text[], size_t byteLength, SkScalar x, SkScalar y, |