Index: gm/textblobrandomfont.cpp |
diff --git a/gm/textblobrandomfont.cpp b/gm/textblobrandomfont.cpp |
index 51dbfceab3331c578c82cbf04e12272eb5163304..267fe7a320c79e77d2b98434698d0cc4c44a066b 100644 |
--- a/gm/textblobrandomfont.cpp |
+++ b/gm/textblobrandomfont.cpp |
@@ -39,12 +39,13 @@ |
paint.setLCDRenderText(true); |
// Setup our random scaler context |
- sk_sp<SkTypeface> orig(sk_tool_utils::create_portable_typeface("sans-serif", |
- SkTypeface::kBold)); |
+ SkAutoTUnref<SkTypeface> orig(sk_tool_utils::create_portable_typeface("sans-serif", |
+ SkTypeface::kBold)); |
if (nullptr == orig) { |
- orig = SkTypeface::MakeDefault(); |
+ orig.reset(SkTypeface::RefDefault()); |
} |
- paint.setTypeface(sk_make_sp<SkRandomTypeface>(orig, paint, false)); |
+ SkAutoTUnref<SkTypeface> random(new SkRandomTypeface(orig, paint, false)); |
+ paint.setTypeface(random); |
SkRect bounds; |
paint.measureText(text, strlen(text), &bounds); |
@@ -65,14 +66,16 @@ |
sk_tool_utils::add_to_text_blob(&builder, bigtext2, paint, 0, offset); |
// color emoji |
- sk_sp<SkTypeface> origEmoji = sk_tool_utils::emoji_typeface(); |
+ SkAutoTUnref<SkTypeface> origEmoji; |
+ sk_tool_utils::emoji_typeface(&origEmoji); |
const char* osName = sk_tool_utils::platform_os_name(); |
// The mac emoji string will break us |
if (origEmoji && (!strcmp(osName, "Android") || !strcmp(osName, "Ubuntu"))) { |
const char* emojiText = sk_tool_utils::emoji_sample_text(); |
paint.measureText(emojiText, strlen(emojiText), &bounds); |
offset += bounds.height(); |
- paint.setTypeface(sk_make_sp<SkRandomTypeface>(orig, paint, false)); |
+ SkAutoTUnref<SkTypeface> randomEmoji(new SkRandomTypeface(orig, paint, false)); |
+ paint.setTypeface(randomEmoji); |
sk_tool_utils::add_to_text_blob(&builder, emojiText, paint, 0, offset); |
} |