diff options
author | caryclark <caryclark@google.com> | 2014-06-23 11:25:00 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-06-23 11:25:00 -0700 |
commit | 5fb6bd4b7e8d00b7f2543ca10ec9022b32632f29 (patch) | |
tree | 9212da1f0a1c6bee32c3debd4b8fd1ff61beca60 /tools/sk_tool_utils.h | |
parent | c83780c9ec9fb7dc46abed71a64d83ec0ce7a274 (diff) |
use platform-independent font for gm
Create a custom typeface and scaler to render simple paths the
same on all platforms.
GM tests are modified to explicitly select the custom typeface.
R=reed@google.com, mtklein@google.com, bungeman@google.com
TBR=reed
Author: caryclark@google.com
Review URL: https://codereview.chromium.org/348323003
Diffstat (limited to 'tools/sk_tool_utils.h')
-rw-r--r-- | tools/sk_tool_utils.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tools/sk_tool_utils.h b/tools/sk_tool_utils.h index 2bd42b6076..151325d7d1 100644 --- a/tools/sk_tool_utils.h +++ b/tools/sk_tool_utils.h @@ -8,16 +8,24 @@ #ifndef sk_tool_utils_DEFINED #define sk_tool_utils_DEFINED +#include "SkBitmap.h" +#include "SkCanvas.h" #include "SkImageInfo.h" - -class SkBitmap; -class SkCanvas; +#include "SkPaint.h" +#include "SkTypeface.h" namespace sk_tool_utils { + extern bool gEnablePortableTypeface; + const char* colortype_name(SkColorType); /** + * Sets the paint to use a platform-independent text renderer. + */ + void set_portable_typeface(SkPaint* paint, SkTypeface::Style style = SkTypeface::kNormal); + + /** * Call canvas->writePixels() by using the pixels from bitmap, but with an info that claims * the pixels are colorType + alphaType */ |