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

Unified Diff: src/pdf/SkPDFFont.cpp

Issue 2188623004: SkPDF: SkPDFStream takes a unique_ptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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/SkPDFDocument.cpp ('k') | src/pdf/SkPDFFormXObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFFont.cpp
diff --git a/src/pdf/SkPDFFont.cpp b/src/pdf/SkPDFFont.cpp
index f088ed5941d1e0e026cb4e2cdb030f2c5c358488..2f7137fd99cefae9e51c36e1b4f66a3b71aa7c39 100644
--- a/src/pdf/SkPDFFont.cpp
+++ b/src/pdf/SkPDFFont.cpp
@@ -640,7 +640,7 @@ static size_t get_subset_font_stream(const char* fontName,
fontData->rewind();
// Fail over: just embed the whole font.
- *fontStream = new SkPDFStream(fontData.get());
+ *fontStream = new SkPDFStream(std::move(fontData));
return fontSize;
}
#endif
@@ -1356,11 +1356,9 @@ bool SkPDFType3Font::populate(uint16_t glyphID) {
SkPDFUtils::PaintPath(paint.getStyle(), path->getFillType(),
&content);
}
- std::unique_ptr<SkMemoryStream> glyphStream(new SkMemoryStream());
- glyphStream->setData(content.copyToData())->unref();
-
charProcs->insertObjRef(
- characterName, sk_make_sp<SkPDFStream>(glyphStream.get()));
+ characterName, sk_make_sp<SkPDFStream>(
+ std::unique_ptr<SkStreamAsset>(content.detachAsStream())));
}
encoding->insertObject("Differences", std::move(encDiffs));
« no previous file with comments | « src/pdf/SkPDFDocument.cpp ('k') | src/pdf/SkPDFFormXObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698