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
This commit is contained in:
jvanverth 2015-06-19 11:06:28 -07:00 committed by Commit bot
parent 393551e338
commit 97c595f304

View File

@ -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;
}