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

Unified Diff: src/pdf/SkPDFBitmap.cpp

Issue 1772493002: SkPDF: AutoTUnref<T> changes in use (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/SkPDFCanon.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 e067ed1c0bb776ed66fe7f0ada974e7477d0b3a5..66124cef3552faa0eec300e6172fc75c9d4ba85c 100644
--- a/src/pdf/SkPDFBitmap.cpp
+++ b/src/pdf/SkPDFBitmap.cpp
@@ -387,7 +387,7 @@ public:
void emitObject(SkWStream* stream,
const SkPDFObjNumMap& objNumMap,
const SkPDFSubstituteMap& subs) const override {
- emit_image_xobject(stream, fImage, true, nullptr, objNumMap, subs);
+ emit_image_xobject(stream, fImage.get(), true, nullptr, objNumMap, subs);
}
private:
@@ -404,7 +404,7 @@ public:
void emitObject(SkWStream* stream,
const SkPDFObjNumMap& objNumMap,
const SkPDFSubstituteMap& subs) const override {
- emit_image_xobject(stream, fImage, false, fSMask, objNumMap, subs);
+ emit_image_xobject(stream, fImage.get(), false, fSMask.get(), objNumMap, subs);
}
void addResources(SkPDFObjNumMap* catalog,
const SkPDFSubstituteMap& subs) const override {
@@ -472,7 +472,7 @@ SkPDFObject* SkPDFCreateBitmapObject(const SkImage* image,
SkPixelSerializer* pixelSerializer) {
SkAutoTUnref<SkData> data(image->refEncoded());
SkJFIFInfo info;
- if (data && SkIsJFIF(data, &info) &&
+ if (data && SkIsJFIF(data.get(), &info) &&
(!pixelSerializer ||
pixelSerializer->useEncodedData(data->data(), data->size()))) {
// If there is a SkPixelSerializer, give it a chance to
@@ -484,7 +484,7 @@ SkPDFObject* SkPDFCreateBitmapObject(const SkImage* image,
#ifdef SK_PDF_IMAGE_STATS
gJpegImageObjects.fetch_add(1);
#endif
- return new PDFJpegBitmap(info.fSize, data, yuv);
+ return new PDFJpegBitmap(info.fSize, data.get(), yuv);
}
}
@@ -493,10 +493,10 @@ SkPDFObject* SkPDFCreateBitmapObject(const SkImage* image,
SkAutoPixmapUnlock apu;
if (as_IB(image)->getROPixels(&bm) && bm.requestLock(&apu)) {
data.reset(pixelSerializer->encode(apu.pixmap()));
- if (data && SkIsJFIF(data, &info)) {
+ if (data && SkIsJFIF(data.get(), &info)) {
bool yuv = info.fType == SkJFIFInfo::kYCbCr;
if (info.fSize == image->dimensions()) { // Sanity check.
- return new PDFJpegBitmap(info.fSize, data, yuv);
+ return new PDFJpegBitmap(info.fSize, data.get(), yuv);
}
}
}
« no previous file with comments | « src/doc/SkDocument_PDF.cpp ('k') | src/pdf/SkPDFCanon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698