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

Unified Diff: src/pdf/SkPDFStream.h

Issue 2190643002: SkPDF: refactor font subset: fewer copies (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-07-27 (Wednesday) 16:22:36 EDT 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/SkPDFGraphicState.cpp ('k') | tests/PDFPrimitivesTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFStream.h
diff --git a/src/pdf/SkPDFStream.h b/src/pdf/SkPDFStream.h
index 0cc2d4295e68fd1df4ed4d1dabfc096562acf808..32632c6699d07cc246af5a5515fa7d99199f698e 100644
--- a/src/pdf/SkPDFStream.h
+++ b/src/pdf/SkPDFStream.h
@@ -22,9 +22,11 @@ class SkPDFStream : public SkPDFDict {
public:
/** Create a PDF stream. A Length entry is automatically added to the
* stream dictionary.
- * @param data The data part of the stream. Will not take ownership.
- */
- explicit SkPDFStream(SkData* data) { this->setData(data); }
+ * @param data The data part of the stream. */
+ explicit SkPDFStream(sk_sp<SkData> data) {
+ this->setData(std::unique_ptr<SkStreamAsset>(
+ new SkMemoryStream(std::move(data))));
+ }
/** Create a PDF stream. A Length entry is automatically added to the
* stream dictionary.
@@ -50,9 +52,6 @@ protected:
/** Only call this function once. */
void setData(std::unique_ptr<SkStreamAsset> stream);
- void setData(SkData* data) {
- this->setData(std::unique_ptr<SkStreamAsset>(new SkMemoryStream(data)));
- }
private:
std::unique_ptr<SkStreamAsset> fCompressedData;
« no previous file with comments | « src/pdf/SkPDFGraphicState.cpp ('k') | tests/PDFPrimitivesTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698