diff options
author | jvanverth <jvanverth@google.com> | 2015-06-19 11:06:28 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-19 11:06:28 -0700 |
commit | 97c595f304567abac00dbe4fa6ea9b4d8bf5d89f (patch) | |
tree | 36f73d5b31f7b03ae026af07a40f4c63c428a9df | |
parent | 393551e338a3516606ad10b2d6342e16dd3ac610 (diff) |
Switch to glyphs as paths at a higher point size on Android
The regression occurred when we dropped the maximum DF size from 192
to 162, which meant that any glyph > 324 ended up being rendered as paths
rather than the previous > 384. This pushes the threshold for
rendering paths up to 384. Quality looks fine on high-res devices
which is why this is restricted to Android-only (low-res Android devices
should only rarely have text that large).
BUG=chromium:467569
Committed: https://skia.googlesource.com/skia/+/932d413e69845989fadaecf5bcb8686ec8c05032
Review URL: https://codereview.chromium.org/1183053005
-rw-r--r-- | src/gpu/GrAtlasTextContext.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp index 7252d76ca2..9d59b07515 100644 --- a/src/gpu/GrAtlasTextContext.cpp +++ b/src/gpu/GrAtlasTextContext.cpp @@ -55,7 +55,11 @@ static const int kSmallDFFontLimit = 32; static const int kMediumDFFontSize = 72; static const int kMediumDFFontLimit = 72; static const int kLargeDFFontSize = 162; +#ifdef SK_BUILD_FOR_ANDROID +static const int kLargeDFFontLimit = 384; +#else static const int kLargeDFFontLimit = 2 * kLargeDFFontSize; +#endif SkDEBUGCODE(static const int kExpectedDistanceAdjustTableSize = 8;) static const int kDistanceAdjustLumShift = 5; @@ -438,7 +442,7 @@ inline bool GrAtlasTextContext::canDrawAsDistanceFields(const SkPaint& skPaint, SkScalar scaledTextSize = maxScale*skPaint.getTextSize(); // Hinted text looks far better at small resolutions // Scaling up beyond 2x yields undesireable artifacts - if (scaledTextSize < kMinDFFontSize || scaledTextSize > kLargeDFFontLimit) { + if (scaledTextSize < kMinDFFontSize || scaledTextSize >= kLargeDFFontLimit) { return false; } |