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

Unified Diff: src/gpu/GrDistanceFieldTextContext.cpp

Issue 195213003: Add compile flag to force usage of distance fields for all SkPaints. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Activate distance fields in an internal location Created 6 years, 9 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 | « gyp/common_variables.gypi ('k') | no next file » | 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 04503820b96a3373e33dbb21bf99e872fe2b2b33..03d09a03313748ac8bd0b039b536c71be3a69d76 100755
--- a/src/gpu/GrDistanceFieldTextContext.cpp
+++ b/src/gpu/GrDistanceFieldTextContext.cpp
@@ -28,6 +28,12 @@ static const int kBaseDFFontSize = 32;
SK_CONF_DECLARE(bool, c_DumpFontCache, "gpu.dumpFontCache", false,
"Dump the contents of the font cache before every purge.");
+#if SK_FORCE_DISTANCEFIELD_FONTS
+static const bool kForceDistanceFieldFonts = true;
+#else
+static const bool kForceDistanceFieldFonts = false;
+#endif
+
GrDistanceFieldTextContext::GrDistanceFieldTextContext(GrContext* context,
const SkDeviceProperties& properties)
: GrTextContext(context, properties) {
@@ -45,7 +51,7 @@ GrDistanceFieldTextContext::~GrDistanceFieldTextContext() {
}
bool GrDistanceFieldTextContext::canDraw(const SkPaint& paint) {
- return paint.isDistanceFieldTextTEMP() &&
+ return (kForceDistanceFieldFonts || paint.isDistanceFieldTextTEMP()) &&
!paint.getRasterizer() && !paint.getMaskFilter() &&
paint.getStyle() == SkPaint::kFill_Style &&
fContext->getTextTarget()->caps()->shaderDerivativeSupport() &&
« no previous file with comments | « gyp/common_variables.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698