Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Unified Diff: gm/pdf_never_embed.cpp

Issue 1933393002: Move SkTypeface to sk_sp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Restore deleted Android code. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/mixedtextblobs.cpp ('k') | gm/poly2poly.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/pdf_never_embed.cpp
diff --git a/gm/pdf_never_embed.cpp b/gm/pdf_never_embed.cpp
index ef7974e3d7f131bd9bf534cfda34c3233310e9f3..4fba40e282454a2684cd5ef6af5a418c45a5488d 100644
--- a/gm/pdf_never_embed.cpp
+++ b/gm/pdf_never_embed.cpp
@@ -25,16 +25,15 @@ static void excercise_draw_pos_text(SkCanvas* canvas,
}
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);
« no previous file with comments | « gm/mixedtextblobs.cpp ('k') | gm/poly2poly.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698