Index: gm/gammatext.cpp |
diff --git a/gm/gammatext.cpp b/gm/gammatext.cpp |
index bc5feb3375b512dce9405098f7591b9d0324debb..c7d4309f970de134b2839250aa8cc902cc9bcfa6 100644 |
--- a/gm/gammatext.cpp |
+++ b/gm/gammatext.cpp |
@@ -19,12 +19,8 @@ static sk_sp<SkShader> make_heatGradient(const SkPoint pts[2]) { |
} |
static bool setFont(SkPaint* paint, const char name[]) { |
- SkTypeface* tf = SkTypeface::CreateFromName(name, SkTypeface::kNormal); |
- if (tf) { |
- paint->setTypeface(tf)->unref(); |
- return true; |
- } |
- return false; |
+ paint->setTypeface(SkTypeface::MakeFromName(name, SkTypeface::kNormal)); |
+ return SkToBool(paint->getTypeface()); |
} |
/** |
@@ -108,8 +104,7 @@ static sk_sp<SkShader> make_gradient(SkColor c) { |
} |
static void set_face(SkPaint* paint) { |
- SkTypeface* face = SkTypeface::CreateFromName("serif", SkTypeface::kItalic); |
- SkSafeUnref(paint->setTypeface(face)); |
+ paint->setTypeface(SkTypeface::MakeFromName("serif", SkTypeface::kItalic)); |
} |
static void draw_pair(SkCanvas* canvas, SkPaint* paint, const sk_sp<SkShader>& shader) { |