From 13b9c95295f4c5732e34574789e721a6bc08f7b4 Mon Sep 17 00:00:00 2001 From: bungeman Date: Thu, 12 May 2016 10:09:30 -0700 Subject: Move SkTypeface to sk_sp. Committed: https://skia.googlesource.com/skia/+/6296da736fbf40aae881650c239420f64e576c3f GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1933393002 Review-Url: https://codereview.chromium.org/1933393002 --- include/ports/SkFontConfigInterface.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'include/ports') diff --git a/include/ports/SkFontConfigInterface.h b/include/ports/SkFontConfigInterface.h index 9f98e356d2..dfa5bd0b13 100644 --- a/include/ports/SkFontConfigInterface.h +++ b/include/ports/SkFontConfigInterface.h @@ -97,12 +97,15 @@ public: * * The default implementation simply returns a new typeface built using data obtained from * openStream(), but derived classes may implement more complex caching schemes. - * - * Callers are responsible for unref-ing the result. */ + virtual sk_sp makeTypeface(const FontIdentity& identity) { + return SkTypeface::MakeFromStream(this->openStream(identity), identity.fTTCIndex); + } +#ifdef SK_SUPPORT_LEGACY_TYPEFACE_PTR virtual SkTypeface* createTypeface(const FontIdentity& identity) { - return SkTypeface::CreateFromStream(this->openStream(identity), identity.fTTCIndex); + return this->makeTypeface(identity).release(); } +#endif /** * Return a singleton instance of a direct subclass that calls into -- cgit v1.2.3