Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Unified Diff: samplecode/SampleFontScalerTest.cpp

Issue 1933393002: Move SkTypeface to sk_sp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Restore deleted Android code. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samplecode/SampleFilterFuzz.cpp ('k') | samplecode/SampleSlides.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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";
« no previous file with comments | « samplecode/SampleFilterFuzz.cpp ('k') | samplecode/SampleSlides.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698