diff options
Diffstat (limited to 'src/pdf/SkPDFDevice.cpp')
-rw-r--r-- | src/pdf/SkPDFDevice.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp index 290c1c4f56..edf17280ef 100644 --- a/src/pdf/SkPDFDevice.cpp +++ b/src/pdf/SkPDFDevice.cpp @@ -1153,7 +1153,6 @@ void SkPDFDevice::internalDrawText( font->multiByteGlyphs(), defaultPositioning, offset); - SkPDFGlyphSetMap* fontGlyphUsage = fDocument->getGlyphUsage(); const SkGlyphID* const glyphsEnd = glyphs + glyphCount; while (glyphs < glyphsEnd) { @@ -1184,7 +1183,7 @@ void SkPDFDevice::internalDrawText( return; } } - fontGlyphUsage->noteGlyphUsage(font, glyphs, stretch); + font->noteGlyphUsage(glyphs, stretch); if (defaultPositioning) { (void)font->glyphsToPDFFontEncoding(glyphs, SkToInt(glyphsEnd - glyphs)); while (stretch-- > 0) { @@ -1318,10 +1317,6 @@ sk_sp<SkPDFDict> SkPDFDevice::makeResourceDict() const { &fonts); } -const SkTDArray<SkPDFFont*>& SkPDFDevice::getFontResources() const { - return fFontResources; -} - sk_sp<SkPDFArray> SkPDFDevice::copyMediaBox() const { auto mediaBox = sk_make_sp<SkPDFArray>(); mediaBox->reserve(4); @@ -1948,9 +1943,9 @@ int SkPDFDevice::getFontResourceIndex(SkTypeface* typeface, uint16_t glyphID) { } int resourceIndex = fFontResources.find(newFont.get()); if (resourceIndex < 0) { + fDocument->registerFont(newFont.get()); resourceIndex = fFontResources.count(); - fFontResources.push(newFont.get()); - newFont.get()->ref(); + fFontResources.push(newFont.release()); } return resourceIndex; } |