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

Unified Diff: src/gpu/GrDistanceFieldTextContext.cpp

Issue 261783004: Add flag for SkGpuSurface creation to enable distance fields. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 8 months 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/GrDistanceFieldTextContext.h ('k') | src/gpu/SkGpuDevice.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 238bcca46b4be737e884672d49edc8724cbce5cf..512420eb672090a205e665a47973fe3dd5892ec6 100755
--- a/src/gpu/GrDistanceFieldTextContext.cpp
+++ b/src/gpu/GrDistanceFieldTextContext.cpp
@@ -33,15 +33,15 @@ static const int kLargeDFFontSize = 128;
SK_CONF_DECLARE(bool, c_DumpFontCache, "gpu.dumpFontCache", false,
"Dump the contents of the font cache before every purge.");
+GrDistanceFieldTextContext::GrDistanceFieldTextContext(GrContext* context,
+ const SkDeviceProperties& properties,
+ bool enable)
+ : GrTextContext(context, properties) {
#if SK_FORCE_DISTANCEFIELD_FONTS
-static const bool kForceDistanceFieldFonts = true;
+ fEnableDFRendering = true;
#else
-static const bool kForceDistanceFieldFonts = false;
+ fEnableDFRendering = enable;
#endif
-
-GrDistanceFieldTextContext::GrDistanceFieldTextContext(GrContext* context,
- const SkDeviceProperties& properties)
- : GrTextContext(context, properties) {
fStrike = NULL;
fCurrTexture = NULL;
@@ -56,7 +56,7 @@ GrDistanceFieldTextContext::~GrDistanceFieldTextContext() {
}
bool GrDistanceFieldTextContext::canDraw(const SkPaint& paint) {
- if (!kForceDistanceFieldFonts && !paint.isDistanceFieldTextTEMP()) {
+ if (!fEnableDFRendering && !paint.isDistanceFieldTextTEMP()) {
return false;
}
« no previous file with comments | « src/gpu/GrDistanceFieldTextContext.h ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698