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

Unified Diff: trunk/include/ports/SkFontConfigInterface.h

Issue 12319150: remove all global associative maps for fontconfig host (Closed) Base URL: http://skia.googlecode.com/svn/
Patch Set: Created 7 years, 10 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 | « trunk/gyp/ports.gyp ('k') | trunk/src/ports/SkFontConfigInterface_direct.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/include/ports/SkFontConfigInterface.h
===================================================================
--- trunk/include/ports/SkFontConfigInterface.h (revision 7879)
+++ trunk/include/ports/SkFontConfigInterface.h (working copy)
@@ -34,27 +34,38 @@
static SkFontConfigInterface* SetGlobal(SkFontConfigInterface*);
/**
- * Given a familyName and style, find the best matching font and return
- * its fileFaceID and actual style (if outStyle is not null) and return
- * true. If no matching font can be found, ignore fileFaceID and outStyle
- * and return false.
+ * This should be treated as private to the impl of SkFontConfigInterface.
+ * Callers should not change or expect any particular values. It is meant
+ * to be a union of possible storage types to aid the impl.
*/
- virtual bool match(const char familyName[], SkTypeface::Style requested,
- unsigned* fileFaceID, SkTypeface::Style* outStyle) = 0;
+ struct FontIdentity {
+ intptr_t fIntPtr;
+ SkString fString;
+ };
/**
- * Given a fileFaceID (returned by match), return the associated familyName
- * and return true. If the associated name cannot be returned, ignore the
- * name parameter, and return false.
+ * Given a familyName and style, find the best match.
+ *
+ * If a match is found, return true and set its outFontIdentifier.
+ * If outFamilyName is not null, assign the found familyName to it
+ * (which may differ from the requested familyName).
+ * If outStyle is not null, assign the found style to it
+ * (which may differ from the requested style).
+ *
+ * If a match is not found, return false, and ignore all out parameters.
*/
- virtual bool getFamilyName(unsigned fileFaceID, SkString* name) = 0;
+ virtual bool matchFamilyName(const char familyName[],
+ SkTypeface::Style requested,
+ FontIdentity* outFontIdentifier,
+ SkString* outFamilyName,
+ SkTypeface::Style* outStyle) = 0;
/**
- * Given a fileFaceID (returned by match), open a stream to access its
- * data, which the caller while take ownership of (and will call unref()
- * when they're through). On failure, return NULL.
+ * Given a FontRef, open a stream to access its data, or return null
+ * if the FontRef's data is not available. The caller is responsible for
+ * calling stream->unref() when it is done accessing the data.
*/
- virtual SkStream* openStream(unsigned fileFaceID) = 0;
+ virtual SkStream* openStream(const FontIdentity&) = 0;
};
#endif
« no previous file with comments | « trunk/gyp/ports.gyp ('k') | trunk/src/ports/SkFontConfigInterface_direct.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698