Index: gm/colortype.cpp |
diff --git a/gm/colortype.cpp b/gm/colortype.cpp |
index c9314de2a456479eecd88b92fcd3cec6c41ac9e1..68dfeee535e28fd84dfecb8fa34aac0f3c397dcf 100644 |
--- a/gm/colortype.cpp |
+++ b/gm/colortype.cpp |
@@ -12,13 +12,7 @@ |
class ColorTypeGM : public skiagm::GM { |
public: |
- ColorTypeGM() |
- : fColorType(nullptr) { |
- } |
- |
- virtual ~ColorTypeGM() { |
- SkSafeUnref(fColorType); |
- } |
+ ColorTypeGM() {} |
protected: |
void onOnceBeforeDraw() override { |
@@ -33,12 +27,11 @@ protected: |
paint.setShader(SkGradientShader::MakeSweep(0, 0, colors, nullptr, SK_ARRAY_COUNT(colors), |
0, &local)); |
- SkTypeface* orig = sk_tool_utils::create_portable_typeface("serif", SkTypeface::kBold); |
+ sk_sp<SkTypeface> orig(sk_tool_utils::create_portable_typeface("serif", SkTypeface::kBold)); |
if (nullptr == orig) { |
- orig = SkTypeface::RefDefault(); |
+ orig = SkTypeface::MakeDefault(); |
} |
- fColorType = new SkGTypeface(orig, paint); |
- orig->unref(); |
+ fColorType = sk_make_sp<SkGTypeface>(std::move(orig), paint); |
} |
SkString onShortName() override { |
@@ -62,7 +55,7 @@ protected: |
} |
private: |
- SkTypeface* fColorType; |
+ sk_sp<SkTypeface> fColorType; |
typedef skiagm::GM INHERITED; |
}; |