aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/drawlooper.cpp
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@google.com>2014-07-31 08:58:44 -0400
committerGravatar Cary Clark <caryclark@google.com>2014-07-31 08:58:44 -0400
commit992c7b03ef7914a18bfd78e965b0b4c99a5f5672 (patch)
tree2158c7f9db5da4989dc591f0aabe4a6302f3bb63 /gm/drawlooper.cpp
parent3f22e8c44a16d93377c0a3881f936e692b5b3320 (diff)
Add standard fonts to all GMs.
Allow GM results to be compared across machines and platforms by standardizing the fonts used by all tests. This adds runtime flags to DM to use either the system font context (the default), the fonts in the resources directory ( --resourceFonts ) or a set of canonical paths generated from the fonts ( --portableFonts ). This CL should leave the current DM results unchanged by default. If the portable font data or resource font is missing when DM is run, it falls back to using the system font context. The create_test_font tool generates the paths and metrics read by DM with the --portableFonts flag set, and generates the font substitution tables read by DM with the --resourceFonts flag set. If DM is run in SkDebug mode with the --reportUsedChars flag set, it generates the corresponding data compiled into the create_test_font tool. All GM tests set their typeface information by calling either sk_tool_utils::set_portable_typeface or sk_tool_utils::portable_typeface . (The former takes the paint, the latter returns a SkTypeface.) These calls can be removed in the future when the Font Manager can be superceded. BUG=skia:2687 R=mtklein@google.com Review URL: https://codereview.chromium.org/407183003
Diffstat (limited to 'gm/drawlooper.cpp')
-rw-r--r--gm/drawlooper.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/gm/drawlooper.cpp b/gm/drawlooper.cpp
index 67e280e4c4..a1b55bbc3f 100644
--- a/gm/drawlooper.cpp
+++ b/gm/drawlooper.cpp
@@ -40,6 +40,7 @@ protected:
SkPaint paint;
paint.setAntiAlias(true);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(SkIntToScalar(72));
paint.setLooper(fLooper);