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

Unified Diff: gm/coloremoji.cpp

Issue 1239303003: fix typeface leak (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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 | « no previous file | gm/dftext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/coloremoji.cpp
diff --git a/gm/coloremoji.cpp b/gm/coloremoji.cpp
index 029377e8e47a1d5d8f39f7d1732acbebf53073e1..8ef335a1586f0edf26f9aa52166053e3af9331e0 100644
--- a/gm/coloremoji.cpp
+++ b/gm/coloremoji.cpp
@@ -50,11 +50,11 @@ public:
protected:
struct EmojiFont {
- SkTypeface* typeface;
+ SkAutoTUnref<SkTypeface> typeface;
const char* text;
} emojiFont;
virtual void onOnceBeforeDraw() override {
- emojiFont.typeface = sk_tool_utils::emoji_typeface();
+ sk_tool_utils::emoji_typeface(&emojiFont.typeface);
emojiFont.text = sk_tool_utils::emoji_sample_text();
}
@@ -155,10 +155,6 @@ protected:
}
}
-private:
- SkAutoTUnref<SkTypeface> fCBDT_CBLC_Typeface;
- SkAutoTUnref<SkTypeface> fSBIX_Typeface;
-
typedef GM INHERITED;
};
« no previous file with comments | « no previous file | gm/dftext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698