diff options
author | Jim Van Verth <jvanverth@google.com> | 2018-01-16 16:26:35 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-01-17 15:45:36 +0000 |
commit | c65b65dd816b7a9fbd148f577f0271cd555c4df6 (patch) | |
tree | bd6e4ed33675f28f7a478bdc53002d4e8b4413b3 /src/core/SkPaint.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/SkPaint.cpp')
-rw-r--r-- | src/core/SkPaint.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp index 0987c640c1..d659b41410 100644 --- a/src/core/SkPaint.cpp +++ b/src/core/SkPaint.cpp @@ -384,18 +384,18 @@ static bool tooBig(const SkMatrix& m, SkScalar ma2max) { mag2(m[SkMatrix::kMSkewX], m[SkMatrix::kMScaleY]) > ma2max; } -bool SkPaint::TooBigToUseCache(const SkMatrix& ctm, const SkMatrix& textM) { +bool SkPaint::TooBigToUseCache(const SkMatrix& ctm, const SkMatrix& textM, SkScalar maxLimit) { SkASSERT(!ctm.hasPerspective()); SkASSERT(!textM.hasPerspective()); SkMatrix matrix; matrix.setConcat(ctm, textM); - return tooBig(matrix, MaxCacheSize2()); + return tooBig(matrix, MaxCacheSize2(maxLimit)); } -SkScalar SkPaint::MaxCacheSize2() { +SkScalar SkPaint::MaxCacheSize2(SkScalar maxLimit) { // we have a self-imposed maximum, just for memory-usage sanity - const int limit = SkMin32(SkGraphics::GetFontCachePointSizeLimit(), 1024); + const int limit = SkMin32(SkGraphics::GetFontCachePointSizeLimit(), maxLimit); const SkScalar maxSize = SkIntToScalar(limit); return maxSize * maxSize; } |