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

Unified Diff: trunk/src/ports/SkFontHost_fontconfig.cpp

Issue 12485002: start to plumb ttcIndex into fonthost. For now just add to SkFontStream and its callers. (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/src/core/SkFontStream.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ports/SkFontHost_fontconfig.cpp
===================================================================
--- trunk/src/ports/SkFontHost_fontconfig.cpp (revision 7997)
+++ trunk/src/ports/SkFontHost_fontconfig.cpp (working copy)
@@ -247,16 +247,21 @@
///////////////////////////////////////////////////////////////////////////////
-static SkStream* open_stream(const FontConfigTypeface* face) {
+static SkStream* open_stream(const FontConfigTypeface* face, int* ttcIndex) {
SkStream* stream = face->getLocalStream();
+ int index;
if (stream) {
stream->ref();
+ // should have been provided by CreateFromStream()
+ *ttcIndex = 0;
} else {
SkAutoTUnref<SkFontConfigInterface> fci(RefFCI());
if (NULL == fci.get()) {
return NULL;
}
stream = fci->openStream(face->getIdentity());
+ // ttcIndex should be returned explicitly by openStream()
+ *ttcIndex = (int)face->getIdentity().fIntPtr;
}
return stream;
}
@@ -266,7 +271,10 @@
if (NULL == face) {
return NULL;
}
- return open_stream(face);
+
+ int ttcIndex;
+ // We should return ttcIndex from this call.
+ return open_stream(face, &ttcIndex);
}
size_t SkFontHost::GetFileName(SkFontID fontID, char path[], size_t length,
@@ -292,16 +300,21 @@
///////////////////////////////////////////////////////////////////////////////
int FontConfigTypeface::onGetTableTags(SkFontTableTag tags[]) const {
- SkAutoTUnref<SkStream> stream(open_stream(this));
- return stream.get() ? SkFontStream::GetTableTags(stream, tags) : 0;
+ int ttcIndex;
+ SkAutoTUnref<SkStream> stream(open_stream(this, &ttcIndex));
+ return stream.get()
+ ? SkFontStream::GetTableTags(stream, ttcIndex, tags)
+ : 0;
}
size_t FontConfigTypeface::onGetTableData(SkFontTableTag tag, size_t offset,
size_t length, void* data) const {
- SkAutoTUnref<SkStream> stream(open_stream(this));
- return stream.get() ?
- SkFontStream::GetTableData(stream, tag, offset, length, data) :
- 0;
+ int ttcIndex;
+ SkAutoTUnref<SkStream> stream(open_stream(this, &ttcIndex));
+ return stream.get()
+ ? SkFontStream::GetTableData(stream, ttcIndex,
+ tag, offset, length, data)
+ : 0;
}
void FontConfigTypeface::onGetFontDescriptor(SkFontDescriptor* desc) const {
« no previous file with comments | « trunk/src/core/SkFontStream.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698