commit | 9a9a7b29e5e5916a7b6453cd124ca437f14b9da4 | [log] [tgz] |
---|---|---|
author | scroggo <scroggo@google.com> | Thu May 12 06:22:30 2016 -0700 |
committer | Commit bot <commit-bot@chromium.org> | Thu May 12 06:22:30 2016 -0700 |
tree | ad5b560f6ed5da12040e5665282fd2227c305ff8 | |
parent | a1b283345b27fef91908b104a30cb89e6fbdaade [diff] [blame] |
Revert of Move SkTypeface to sk_sp. (patchset #5 id:80001 of https://codereview.chromium.org/1933393002/ ) Reason for revert: fontmgr_iterAndroid failing to draw emoji. E.g. https://gold.skia.org/search2?blame=6296da736fbf40aae881650c239420f64e576c3f&unt=true&head=true&query=source_type%3Dgm Original issue's description: > Move SkTypeface to sk_sp. > > Committed: https://skia.googlesource.com/skia/+/6296da736fbf40aae881650c239420f64e576c3f TBR=reed@google.com,fmalita@chromium.org,tomhudson@google.com,bungeman@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/1974783002
diff --git a/gm/pdf_never_embed.cpp b/gm/pdf_never_embed.cpp index 4fba40e..ef7974e 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) { - SkPaint p; - p.setTextSize(60); - p.setTypeface(MakeResourceAsTypeface("fonts/Roboto2-Regular_NoEmbed.ttf")); - p.setAntiAlias(true); - - if (!p.getTypeface()) { + 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.setAntiAlias(true); const char text[] = "HELLO, WORLD!";