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

Unified Diff: gm/typeface.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 | « gm/textblobrandomfont.cpp ('k') | gm/variedtext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
« no previous file with comments | « gm/textblobrandomfont.cpp ('k') | gm/variedtext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698