aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/ports
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2016-05-12 10:09:30 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-05-12 10:09:31 -0700
commit13b9c95295f4c5732e34574789e721a6bc08f7b4 (patch)
treec3ef0aa2af9890c03cb79968f32166af39fba9ba /include/ports
parent40d21de8b6620d724f34bdc85af1dcb593d33fe0 (diff)
Move SkTypeface to sk_sp.
Diffstat (limited to 'include/ports')
-rw-r--r--include/ports/SkFontConfigInterface.h9
1 files changed, 6 insertions, 3 deletions
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<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