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

Unified Diff: src/pdf/SkPDFBitmap.cpp

Issue 1775043002: SkPDF: Add sk_sp setters; .release() becomes std::move() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix -Wpessimizing-move 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 1e2e26aa71131feb0b883c028aee5654600687fa..fdc33032a9c793d0ada23d4fdd6d5863599775b8 100644
--- a/src/pdf/SkPDFBitmap.cpp
+++ b/src/pdf/SkPDFBitmap.cpp
@@ -297,8 +297,8 @@ static void bitmap_alpha_to_a8(const SkBitmap& bitmap, SkWStream* out) {
}
}
-static SkPDFArray* make_indexed_color_space(const SkColorTable* table) {
- SkPDFArray* result = new SkPDFArray;
+static sk_sp<SkPDFArray> make_indexed_color_space(const SkColorTable* table) {
+ auto result = sk_make_sp<SkPDFArray>();
result->reserve(4);
result->appendName("Indexed");
result->appendName("DeviceRGB");
@@ -330,7 +330,7 @@ static SkPDFArray* make_indexed_color_space(const SkColorTable* table) {
static void emit_image_xobject(SkWStream* stream,
const SkImage* image,
bool alpha,
- SkPDFObject* smask,
+ const sk_sp<SkPDFObject>& smask,
const SkPDFObjNumMap& objNumMap,
const SkPDFSubstituteMap& substitutes) {
SkBitmap bitmap;
@@ -364,7 +364,7 @@ static void emit_image_xobject(SkWStream* stream,
pdfDict.insertName("ColorSpace", "DeviceRGB");
}
if (smask) {
- pdfDict.insertObjRef("SMask", SkRef(smask));
+ pdfDict.insertObjRef("SMask", smask);
}
pdfDict.insertInt("BitsPerComponent", 8);
pdfDict.insertName("Filter", "FlateDecode");
@@ -404,7 +404,7 @@ public:
void emitObject(SkWStream* stream,
const SkPDFObjNumMap& objNumMap,
const SkPDFSubstituteMap& subs) const override {
- emit_image_xobject(stream, fImage.get(), false, fSMask.get(), objNumMap, subs);
+ emit_image_xobject(stream, fImage.get(), false, fSMask, 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