Index: gm/typeface.cpp |
diff --git a/gm/typeface.cpp b/gm/typeface.cpp |
index e77d27747f27b31de84236c157416e06de46c72f..d88efa51bf50edbad15489461a9cbdbfe8635729 100644 |
--- a/gm/typeface.cpp |
+++ b/gm/typeface.cpp |
@@ -90,7 +90,7 @@ |
static const int gFaceStylesCount = SK_ARRAY_COUNT(gFaceStyles); |
class TypefaceStylesGM : public skiagm::GM { |
- sk_sp<SkTypeface> fFaces[gFaceStylesCount]; |
+ SkTypeface* fFaces[gFaceStylesCount]; |
bool fApplyKerning; |
public: |
@@ -99,10 +99,16 @@ |
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::MakeFromName( |
+ fFaces[i] = SkTypeface::CreateFromName( |
sk_tool_utils::platform_font_name(gFaceStyles[i].fName), gFaceStyles[i].fStyle); |
} |
} |