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; } |