SkStream* SkFontHost::OpenStream(uint32_t fontID) { FamilyTypeface* tf = (FamilyTypeface*)find_from_uniqueID(fontID); SkStream* stream = tf ? tf->openStream() : NULL; if (stream && stream->getLength() == 0) { stream->unref(); stream = NULL; } return stream; }
SkStream* SkFontHost::OpenStream(uint32_t fontID) { SkAutoMutexAcquire ac(gFamilyHeadAndNameListMutex); FamilyTypeface* tf = (FamilyTypeface*)find_from_uniqueID(fontID); SkStream* stream = tf ? tf->openStream() : NULL; if (stream && stream->getLength() == 0) { stream->unref(); stream = NULL; } return stream; }