Index: gm/typeface.cpp |
diff --git a/gm/typeface.cpp b/gm/typeface.cpp |
index d88efa51bf50edbad15489461a9cbdbfe8635729..e77d27747f27b31de84236c157416e06de46c72f 100644 |
--- a/gm/typeface.cpp |
+++ b/gm/typeface.cpp |
@@ -90,7 +90,7 @@ static const struct { |
static const int gFaceStylesCount = SK_ARRAY_COUNT(gFaceStyles); |
class TypefaceStylesGM : public skiagm::GM { |
- SkTypeface* fFaces[gFaceStylesCount]; |
+ sk_sp<SkTypeface> fFaces[gFaceStylesCount]; |
bool fApplyKerning; |
public: |
@@ -99,16 +99,10 @@ public: |
memset(fFaces, 0, sizeof(fFaces)); |
} |
- virtual ~TypefaceStylesGM() { |
- for (int i = 0; i < gFaceStylesCount; i++) { |
- SkSafeUnref(fFaces[i]); |
- } |
- } |
- |
protected: |
void onOnceBeforeDraw() override { |
for (int i = 0; i < gFaceStylesCount; i++) { |
- fFaces[i] = SkTypeface::CreateFromName( |
+ fFaces[i] = SkTypeface::MakeFromName( |
sk_tool_utils::platform_font_name(gFaceStyles[i].fName), gFaceStyles[i].fStyle); |
} |
} |