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

Unified Diff: src/pdf/SkPDFFormXObject.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/SkPDFFormXObject.h ('k') | src/pdf/SkPDFShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFFormXObject.cpp
diff --git a/src/pdf/SkPDFFormXObject.cpp b/src/pdf/SkPDFFormXObject.cpp
index 25c37807e048b00fa7208e99c32bd3c434e18f68..ba49df8ea8cd0f8c8bc249d0f9c3ae1475f9e884 100644
--- a/src/pdf/SkPDFFormXObject.cpp
+++ b/src/pdf/SkPDFFormXObject.cpp
@@ -20,8 +20,7 @@ SkPDFFormXObject::SkPDFFormXObject(SkPDFDevice* device) {
// resources).
auto resourceDict = device->makeResourceDict();
- auto content = device->content();
- this->setData(content.get());
+ this->setData(device->content());
sk_sp<SkPDFArray> bboxArray(device->copyMediaBox());
this->init(nullptr, resourceDict.get(), bboxArray.get());
@@ -43,10 +42,10 @@ SkPDFFormXObject::SkPDFFormXObject(SkPDFDevice* device) {
/**
* Creates a FormXObject from a content stream and associated resources.
*/
-SkPDFFormXObject::SkPDFFormXObject(SkStreamAsset* content, SkRect bbox,
+SkPDFFormXObject::SkPDFFormXObject(std::unique_ptr<SkStreamAsset> content,
+ SkRect bbox,
SkPDFDict* resourceDict) {
- setData(content);
-
+ this->setData(std::move(content));
sk_sp<SkPDFArray> bboxArray(SkPDFUtils::RectToArray(bbox));
this->init("DeviceRGB", resourceDict, bboxArray.get());
}
« no previous file with comments | « src/pdf/SkPDFFormXObject.h ('k') | src/pdf/SkPDFShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698