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

Unified Diff: src/core/SkReadBuffer.cpp

Issue 1783063002: Revert of add Make variations to return SkImage by sk_sp (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/core/SkPictureShader.cpp ('k') | src/core/SkShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkReadBuffer.cpp
diff --git a/src/core/SkReadBuffer.cpp b/src/core/SkReadBuffer.cpp
index 59d5172f8144a66e5e9dafff6b6a9f775b73020a..6823a6cd8e7c1d51c9aebc531b895b5081fa0ea1 100644
--- a/src/core/SkReadBuffer.cpp
+++ b/src/core/SkReadBuffer.cpp
@@ -298,11 +298,11 @@
return nullptr;
}
- sk_sp<SkData> encoded(this->readByteArrayAsData());
+ SkAutoTUnref<SkData> encoded(this->readByteArrayAsData());
if (encoded->size() == 0) {
// The image could not be encoded at serialization time - return an empty placeholder.
- return SkImage::MakeFromGenerator(
- new EmptyImageGenerator(SkImageInfo::MakeN32Premul(width, height))).release();
+ return SkImage::NewFromGenerator(
+ new EmptyImageGenerator(SkImageInfo::MakeN32Premul(width, height)));
}
int originX = this->read32();
@@ -313,13 +313,13 @@
}
const SkIRect subset = SkIRect::MakeXYWH(originX, originY, width, height);
- SkImage* image = SkImage::MakeFromEncoded(std::move(encoded), &subset).release();
+ SkImage* image = SkImage::NewFromEncoded(encoded, &subset);
if (image) {
return image;
}
- return SkImage::MakeFromGenerator(
- new EmptyImageGenerator(SkImageInfo::MakeN32Premul(width, height))).release();
+ return SkImage::NewFromGenerator(
+ new EmptyImageGenerator(SkImageInfo::MakeN32Premul(width, height)));
}
SkTypeface* SkReadBuffer::readTypeface() {
« no previous file with comments | « src/core/SkPictureShader.cpp ('k') | src/core/SkShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698