Index: src/gpu/GrDistanceFieldTextContext.cpp |
diff --git a/src/gpu/GrDistanceFieldTextContext.cpp b/src/gpu/GrDistanceFieldTextContext.cpp |
index 638ec597074bbef9010c3faaea188000af41c4e1..1faa7507a48bff048e6ac1ef7e80048f90ac3cb0 100755 |
--- a/src/gpu/GrDistanceFieldTextContext.cpp |
+++ b/src/gpu/GrDistanceFieldTextContext.cpp |
@@ -23,7 +23,12 @@ |
static const int kGlyphCoordsAttributeIndex = 1; |
-static const int kBaseDFFontSize = 32; |
+static const int kSmallDFFontSize = 32; |
+static const int kSmallDFFontLimit = 32; |
+static const int kMediumDFFontSize = 64; |
+static const int kMediumDFFontLimit = 64; |
+static const int kLargeDFFontSize = 128; |
robertphillips
2014/04/01 17:55:43
Do we need kLargeDFFontLimit?
jvanverth1
2014/04/01 18:06:06
Done.
|
+static const int kLargeDFFontLimit = 256; // 128 pt can scale up better than 32 or 64 |
SK_CONF_DECLARE(bool, c_DumpFontCache, "gpu.dumpFontCache", false, |
"Dump the contents of the font cache before every purge."); |
@@ -31,7 +36,7 @@ SK_CONF_DECLARE(bool, c_DumpFontCache, "gpu.dumpFontCache", false, |
#if SK_FORCE_DISTANCEFIELD_FONTS |
static const bool kForceDistanceFieldFonts = true; |
#else |
robertphillips
2014/04/01 17:55:43
Are we ready for this?
jvanverth1
2014/04/01 18:06:06
Whoops, reverted.
|
-static const bool kForceDistanceFieldFonts = false; |
+static const bool kForceDistanceFieldFonts = true; |
#endif |
GrDistanceFieldTextContext::GrDistanceFieldTextContext(GrContext* context, |
@@ -303,9 +308,17 @@ inline void GrDistanceFieldTextContext::init(const GrPaint& paint, const SkPaint |
fVertices = NULL; |
fMaxVertices = 0; |
- fTextRatio = fSkPaint.getTextSize()/kBaseDFFontSize; |
+ if (fSkPaint.getTextSize() <= kSmallDFFontLimit) { |
+ fTextRatio = fSkPaint.getTextSize()/kSmallDFFontSize; |
+ fSkPaint.setTextSize(SkIntToScalar(kSmallDFFontSize)); |
+ } else if (fSkPaint.getTextSize() <= kMediumDFFontLimit) { |
+ fTextRatio = fSkPaint.getTextSize()/kMediumDFFontSize; |
+ fSkPaint.setTextSize(SkIntToScalar(kMediumDFFontSize)); |
+ } else { |
+ fTextRatio = fSkPaint.getTextSize()/kLargeDFFontSize; |
+ fSkPaint.setTextSize(SkIntToScalar(kLargeDFFontSize)); |
+ } |
- fSkPaint.setTextSize(SkIntToScalar(kBaseDFFontSize)); |
fSkPaint.setLCDRenderText(false); |
fSkPaint.setAutohinted(false); |
fSkPaint.setSubpixelText(true); |