Move SkTypeface to sk_sp.
Review-Url: https://codereview.chromium.org/1933393002
diff --git a/gm/pdf_never_embed.cpp b/gm/pdf_never_embed.cpp
index ef7974e..4fba40e 100644
--- a/gm/pdf_never_embed.cpp
+++ b/gm/pdf_never_embed.cpp
@@ -25,16 +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(typeface);
+ p.setTypeface(MakeResourceAsTypeface("fonts/Roboto2-Regular_NoEmbed.ttf"));
p.setAntiAlias(true);
+ if (!p.getTypeface()) {
+ return;
+ }
+
const char text[] = "HELLO, WORLD!";
canvas->drawColor(SK_ColorWHITE);