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

Unified Diff: src/pdf/SkPDFBitmap.cpp

Issue 1775143002: Revert of SkPDF: Add sk_sp setters; .release() becomes std::move() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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/doc/SkDocument_PDF.cpp ('k') | src/pdf/SkPDFDevice.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFBitmap.cpp
diff --git a/src/pdf/SkPDFBitmap.cpp b/src/pdf/SkPDFBitmap.cpp
index 6c97fbbce0cf9f9c973952395ca6fe550d5a5a02..1e2e26aa71131feb0b883c028aee5654600687fa 100644
--- a/src/pdf/SkPDFBitmap.cpp
+++ b/src/pdf/SkPDFBitmap.cpp
@@ -297,8 +297,8 @@
}
}
-static sk_sp<SkPDFArray> make_indexed_color_space(const SkColorTable* table) {
- auto result = sk_make_sp<SkPDFArray>();
+static SkPDFArray* make_indexed_color_space(const SkColorTable* table) {
+ SkPDFArray* result = new SkPDFArray;
result->reserve(4);
result->appendName("Indexed");
result->appendName("DeviceRGB");
@@ -308,7 +308,7 @@
char shortTableArray[3] = {0, 0, 0};
SkString tableString(shortTableArray, SK_ARRAY_COUNT(shortTableArray));
result->appendString(tableString);
- return std::move(result);
+ return result;
}
result->appendInt(table->count() - 1); // maximum color index.
@@ -324,13 +324,13 @@
}
SkString tableString(tableArray, 3 * table->count());
result->appendString(tableString);
- return std::move(result);
+ return result;
}
static void emit_image_xobject(SkWStream* stream,
const SkImage* image,
bool alpha,
- const sk_sp<SkPDFObject>& smask,
+ SkPDFObject* smask,
const SkPDFObjNumMap& objNumMap,
const SkPDFSubstituteMap& substitutes) {
SkBitmap bitmap;
@@ -364,7 +364,7 @@
pdfDict.insertName("ColorSpace", "DeviceRGB");
}
if (smask) {
- pdfDict.insertObjRef("SMask", smask);
+ pdfDict.insertObjRef("SMask", SkRef(smask));
}
pdfDict.insertInt("BitsPerComponent", 8);
pdfDict.insertName("Filter", "FlateDecode");
@@ -404,7 +404,7 @@
void emitObject(SkWStream* stream,
const SkPDFObjNumMap& objNumMap,
const SkPDFSubstituteMap& subs) const override {
- emit_image_xobject(stream, fImage.get(), false, fSMask, objNumMap, subs);
+ emit_image_xobject(stream, fImage.get(), false, fSMask.get(), objNumMap, subs);
}
void addResources(SkPDFObjNumMap* catalog,
const SkPDFSubstituteMap& subs) const override {
« no previous file with comments | « src/doc/SkDocument_PDF.cpp ('k') | src/pdf/SkPDFDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698