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