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

Unified Diff: gm/typeface.cpp

Issue 1974783002: Revert of Move SkTypeface to sk_sp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
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);
}
}
« no previous file with comments | « gm/textblobrandomfont.cpp ('k') | gm/variedtext.cpp » ('j') | src/ports/SkFontMgr_android.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698