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

Unified Diff: include/ports/SkFontConfigInterface.h

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 | « include/core/SkTypeface.h ('k') | public.bzl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/ports/SkFontConfigInterface.h
diff --git a/include/ports/SkFontConfigInterface.h b/include/ports/SkFontConfigInterface.h
index 9f98e356d23c5c82ac62f4975bae3347fede1d85..dfa5bd0b1350b16f23d7e583d73c6d6a907001b9 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<SkTypeface> 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
« no previous file with comments | « include/core/SkTypeface.h ('k') | public.bzl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698