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

Unified Diff: include/ports/SkFontConfigInterface.h

Issue 1454343003: SkFontConfigInterface::createTypeface() (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: rename to createTypeface 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..304961fd7862358c6ed257b72aadceb02ab0bfb2 100644
--- a/include/ports/SkFontConfigInterface.h
+++ b/include/ports/SkFontConfigInterface.h
@@ -95,6 +95,18 @@ 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.
+ *
+ * Callers are responsible for unref-ing the result.
+ */
+ virtual SkTypeface* createTypeface(const FontIdentity& identity) {
+ 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