Index: gm/pdf_never_embed.cpp |
diff --git a/gm/pdf_never_embed.cpp b/gm/pdf_never_embed.cpp |
index 4fba40e282454a2684cd5ef6af5a418c45a5488d..ef7974e3d7f131bd9bf534cfda34c3233310e9f3 100644 |
--- a/gm/pdf_never_embed.cpp |
+++ b/gm/pdf_never_embed.cpp |
@@ -25,14 +25,15 @@ |
} |
DEF_SIMPLE_GM(pdf_never_embed, canvas, 512, 512) { |
+ const char resource[] = "fonts/Roboto2-Regular_NoEmbed.ttf"; |
+ SkAutoTUnref<SkTypeface> typeface(GetResourceAsTypeface(resource)); |
+ if (!typeface) { |
+ return; |
+ } |
SkPaint p; |
p.setTextSize(60); |
- p.setTypeface(MakeResourceAsTypeface("fonts/Roboto2-Regular_NoEmbed.ttf")); |
+ p.setTypeface(typeface); |
p.setAntiAlias(true); |
- |
- if (!p.getTypeface()) { |
- return; |
- } |
const char text[] = "HELLO, WORLD!"; |