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

Unified Diff: trunk/src/core/SkTypeface.cpp

Issue 12988002: add virtual SkTypeface::onOpenStream and override that for fontconfig (Closed) Base URL: http://skia.googlecode.com/svn/
Patch Set: Created 7 years, 9 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/include/core/SkTypeface.h ('k') | trunk/src/ports/SkFontHost_FreeType.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/core/SkTypeface.cpp
===================================================================
--- trunk/src/core/SkTypeface.cpp (revision 8295)
+++ trunk/src/core/SkTypeface.cpp (working copy)
@@ -123,12 +123,12 @@
}
SkStream* SkTypeface::openStream(int* ttcIndex) const {
- if (ttcIndex) {
- int32_t ndx = 0;
- (void)SkFontHost::GetFileName(fUniqueID, NULL, 0, &ndx);
- *ttcIndex = (int)ndx;
+ int ttcIndexStorage;
+ if (NULL == ttcIndex) {
+ // So our subclasses don't need to check for null param
+ ttcIndex = &ttcIndexStorage;
}
- return SkFontHost::OpenStream(fUniqueID);
+ return this->onOpenStream(ttcIndex);
}
int SkTypeface::getUnitsPerEm() const {
@@ -155,6 +155,15 @@
return upem;
}
+SkStream* SkTypeface::onOpenStream(int* ttcIndex) const {
+ if (ttcIndex) {
+ int32_t ndx = 0;
+ (void)SkFontHost::GetFileName(fUniqueID, NULL, 0, &ndx);
+ *ttcIndex = (int)ndx;
+ }
+ return SkFontHost::OpenStream(fUniqueID);
+}
+
int SkTypeface::onGetTableTags(SkFontTableTag tags[]) const { return 0; }
size_t SkTypeface::onGetTableData(SkFontTableTag, size_t offset,
size_t length, void* data) const { return 0; }
« no previous file with comments | « trunk/include/core/SkTypeface.h ('k') | trunk/src/ports/SkFontHost_FreeType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698