size_t SkGPipeCanvas::getInProcessTypefaces(const SkRefCntSet& typefaceSet, TypefaceBuffer* buffer) { // When in-process, we simply write out the typeface pointers. size_t size = typefaceSet.count() * sizeof(SkTypeface*); buffer->reset(size); typefaceSet.copyToArray(reinterpret_cast<SkRefCnt**>(buffer->get())); return size; }
void SkPictureData::WriteTypefaces(SkWStream* stream, const SkRefCntSet& rec) { int count = rec.count(); write_tag_size(stream, SK_PICT_TYPEFACE_TAG, count); SkAutoSTMalloc<16, SkTypeface*> storage(count); SkTypeface** array = (SkTypeface**)storage.get(); rec.copyToArray((SkRefCnt**)array); for (int i = 0; i < count; i++) { array[i]->serialize(stream); } }
void SkPictureData::WriteTypefaces(SkWStream* stream, const SkRefCntSet& rec) { int count = rec.count(); write_tag_size(stream, SK_PICT_TYPEFACE_TAG, count); SkAutoSTMalloc<16, SkTypeface*> storage(count); SkTypeface** array = (SkTypeface**)storage.get(); rec.copyToArray((SkRefCnt**)array); for (int i = 0; i < count; i++) { #ifdef SK_PICTURE_FORCE_FONT_EMBEDDING array[i]->serializeForcingEmbedding(stream); #else // TODO: if (embedFonts) { array[i]->serializeForcingEmbedding(stream) } else array[i]->serialize(stream); #endif } }