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

Unified Diff: src/pdf/SkPDFDevice.cpp

Issue 2253283004: SkPDF: in-place font subsetting (Closed) Base URL: https://skia.googlesource.com/skia.git@SkPdfCacheMetrics
Patch Set: 2016-08-18 (Thursday) 16:02:16 EDT Created 4 years, 4 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 | « src/pdf/SkPDFDevice.h ('k') | src/pdf/SkPDFDocument.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFDevice.cpp
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index 290c1c4f565ae0f02e6ffc47bdbd5af72554766b..edf17280ef7b4220ab2d0128e562825f9d8a76e2 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;
}
« no previous file with comments | « src/pdf/SkPDFDevice.h ('k') | src/pdf/SkPDFDocument.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698