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

Unified Diff: include/ports/SkFontConfigInterface.h

Issue 1454343003: SkFontConfigInterface::createTypeface() (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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 | no next file » | 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 fd5e812a5b49319be5c2be11a2ae0d434e55bbe0..cf2a55bc4f3676bdf0a18c175d12b528cef14b31 100644
--- a/include/ports/SkFontConfigInterface.h
+++ b/include/ports/SkFontConfigInterface.h
@@ -95,6 +95,16 @@ public:
virtual SkStreamAsset* openStream(const FontIdentity&) = 0;
/**
+ * Return an SkTypeface for the given FontIdentity.
+ *
+ * The default implementation simply returns a new typeface built using data obtained from
+ * openStream(), but derived classes may implement more complex caching schemes.
+ */
+ virtual SkTypeface* getTypeface(const FontIdentity& identity) {
reed1 2015/11/20 15:30:14 We usually use get... to return a non-ownership-tr
f(malita) 2015/11/20 15:43:00 Done. (renamed to createTypeface)
+ return SkTypeface::CreateFromStream(this->openStream(identity), identity.fTTCIndex);
+ }
+
+ /**
* Return a singleton instance of a direct subclass that calls into
* libfontconfig. This does not affect the refcnt of the returned instance.
* The mutex may be used to guarantee the singleton is only constructed once.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698