aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/sk_tool_utils.cpp
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2015-06-10 09:31:09 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-10 09:31:09 -0700
commit83ca628cb6c959524edc3a696d7c3b5f7f1826ba (patch)
treef5b1f9e7030b0331fed666493a9dbba1b4fa08f9 /tools/sk_tool_utils.cpp
parente21585eabf18b9919701b14576b6876c0fd86735 (diff)
Today's gm include many differences caused by platform font implementations.
This experiment replaces the label used in the aaxfermodes gm with aliased text generated from paths common to all platforms. Since there is no way today to generate all dm output from trybots, this will be checked in to confirm that this strategy provides simpler output across devices. This does not introduce a new public interface; instead, dm uses a extern backdoor to install the SkTypeface::CreateFromName handler. Review URL: https://codereview.chromium.org/1163283002
Diffstat (limited to 'tools/sk_tool_utils.cpp')
-rw-r--r--tools/sk_tool_utils.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/sk_tool_utils.cpp b/tools/sk_tool_utils.cpp
index 1a88086a41..6fcd33751f 100644
--- a/tools/sk_tool_utils.cpp
+++ b/tools/sk_tool_utils.cpp
@@ -46,11 +46,20 @@ SkTypeface* create_portable_typeface(const char* name, SkTypeface::Style style)
return face;
}
+SkTypeface* create_portable_typeface_always(const char* name, SkTypeface::Style style) {
+ return create_font(name, style);
+}
+
void set_portable_typeface(SkPaint* paint, const char* name, SkTypeface::Style style) {
SkTypeface* face = create_portable_typeface(name, style);
SkSafeUnref(paint->setTypeface(face));
}
+void set_portable_typeface_always(SkPaint* paint, const char* name, SkTypeface::Style style) {
+ SkTypeface* face = create_font(name, style);
+ SkSafeUnref(paint->setTypeface(face));
+}
+
void write_pixels(SkCanvas* canvas, const SkBitmap& bitmap, int x, int y,
SkColorType colorType, SkAlphaType alphaType) {
SkBitmap tmp(bitmap);