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