Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Unified Diff: src/gpu/GrDistanceFieldTextContext.cpp

Issue 703463002: Improve quality of distance field rendering (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Ignore GMs Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrAADistanceFieldPathRenderer.cpp ('k') | src/gpu/effects/GrDistanceFieldTextureEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDistanceFieldTextContext.cpp
diff --git a/src/gpu/GrDistanceFieldTextContext.cpp b/src/gpu/GrDistanceFieldTextContext.cpp
index 6ffa3c3cacb1bf5a2d02cec32bc3c37b2eb2e99c..5c9019b2b2cec504ced08180303c85b1c966d845 100755
--- a/src/gpu/GrDistanceFieldTextContext.cpp
+++ b/src/gpu/GrDistanceFieldTextContext.cpp
@@ -34,9 +34,9 @@ SK_CONF_DECLARE(bool, c_DumpFontCache, "gpu.dumpFontCache", false,
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;
+static const int kMediumDFFontSize = 78;
+static const int kMediumDFFontLimit = 78;
+static const int kLargeDFFontSize = 192;
namespace {
// position + texture coord
@@ -153,12 +153,24 @@ inline void GrDistanceFieldTextContext::init(const GrPaint& paint, const SkPaint
if (scaledTextSize <= kSmallDFFontLimit) {
fTextRatio = textSize / kSmallDFFontSize;
fSkPaint.setTextSize(SkIntToScalar(kSmallDFFontSize));
+#if DEBUG_TEXT_SIZE
bsalomon 2014/11/03 21:45:23 cool!
+ fSkPaint.setColor(SkColorSetARGB(0xFF, 0x00, 0x00, 0xFF));
+ fPaint.setColor(GrColorPackRGBA(0x00, 0x00, 0xFF, 0xFF));
+#endif
} else if (scaledTextSize <= kMediumDFFontLimit) {
fTextRatio = textSize / kMediumDFFontSize;
fSkPaint.setTextSize(SkIntToScalar(kMediumDFFontSize));
+#if DEBUG_TEXT_SIZE
+ fSkPaint.setColor(SkColorSetARGB(0xFF, 0x00, 0xFF, 0x00));
+ fPaint.setColor(GrColorPackRGBA(0x00, 0xFF, 0x00, 0xFF));
+#endif
} else {
fTextRatio = textSize / kLargeDFFontSize;
fSkPaint.setTextSize(SkIntToScalar(kLargeDFFontSize));
+#if DEBUG_TEXT_SIZE
+ fSkPaint.setColor(SkColorSetARGB(0xFF, 0xFF, 0x00, 0x00));
+ fPaint.setColor(GrColorPackRGBA(0xFF, 0x00, 0x00, 0xFF));
+#endif
}
fUseLCDText = fSkPaint.isLCDRenderText();
« no previous file with comments | « src/gpu/GrAADistanceFieldPathRenderer.cpp ('k') | src/gpu/effects/GrDistanceFieldTextureEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698