Index: samplecode/SampleFontScalerTest.cpp |
diff --git a/samplecode/SampleFontScalerTest.cpp b/samplecode/SampleFontScalerTest.cpp |
index 72371ed8073004f8f10a38f8e0e4d6d0b8621098..ce3b81ee8a7e031c54666e8a0e7fdc5b2c5f84c1 100644 |
--- a/samplecode/SampleFontScalerTest.cpp |
+++ b/samplecode/SampleFontScalerTest.cpp |
@@ -36,14 +36,21 @@ |
static const int gFaceCount = SK_ARRAY_COUNT(gFaces); |
class FontScalerTestView : public SampleView { |
- sk_sp<SkTypeface> fFaces[gFaceCount]; |
+ SkTypeface* fFaces[gFaceCount]; |
public: |
FontScalerTestView() { |
for (int i = 0; i < gFaceCount; i++) { |
- fFaces[i] = SkTypeface::MakeFromName(gFaces[i].fName, gFaces[i].fStyle); |
+ fFaces[i] = SkTypeface::CreateFromName(gFaces[i].fName, |
+ gFaces[i].fStyle); |
} |
// this->setBGColor(0xFFDDDDDD); |
+ } |
+ |
+ virtual ~FontScalerTestView() { |
+ for (int i = 0; i < gFaceCount; i++) { |
+ SkSafeUnref(fFaces[i]); |
+ } |
} |
protected: |
@@ -85,7 +92,7 @@ |
// paint.setSubpixelText(true); |
paint.setAntiAlias(true); |
paint.setLCDRenderText(true); |
- paint.setTypeface(SkTypeface::MakeFromName("Times Roman", SkTypeface::kNormal)); |
+ SkSafeUnref(paint.setTypeface(SkTypeface::CreateFromName("Times Roman", SkTypeface::kNormal))); |
// const char* text = "abcdefghijklmnopqrstuvwxyz"; |
const char* text = "Hamburgefons ooo mmm"; |