commit | 13b9c95295f4c5732e34574789e721a6bc08f7b4 | [log] [tgz] |
---|---|---|
author | bungeman <bungeman@google.com> | Thu May 12 10:09:30 2016 -0700 |
committer | Commit bot <commit-bot@chromium.org> | Thu May 12 10:09:31 2016 -0700 |
tree | c3ef0aa2af9890c03cb79968f32166af39fba9ba | |
parent | 40d21de8b6620d724f34bdc85af1dcb593d33fe0 [diff] [blame] |
Move SkTypeface to sk_sp. Committed: https://skia.googlesource.com/skia/+/6296da736fbf40aae881650c239420f64e576c3f GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1933393002 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);