Index: src/core/SkReadBuffer.cpp |
diff --git a/src/core/SkReadBuffer.cpp b/src/core/SkReadBuffer.cpp |
index 6823a6cd8e7c1d51c9aebc531b895b5081fa0ea1..59d5172f8144a66e5e9dafff6b6a9f775b73020a 100644 |
--- a/src/core/SkReadBuffer.cpp |
+++ b/src/core/SkReadBuffer.cpp |
@@ -298,11 +298,11 @@ SkImage* SkReadBuffer::readImage() { |
return nullptr; |
} |
- SkAutoTUnref<SkData> encoded(this->readByteArrayAsData()); |
+ sk_sp<SkData> encoded(this->readByteArrayAsData()); |
if (encoded->size() == 0) { |
// The image could not be encoded at serialization time - return an empty placeholder. |
- return SkImage::NewFromGenerator( |
- new EmptyImageGenerator(SkImageInfo::MakeN32Premul(width, height))); |
+ return SkImage::MakeFromGenerator( |
+ new EmptyImageGenerator(SkImageInfo::MakeN32Premul(width, height))).release(); |
} |
int originX = this->read32(); |
@@ -313,13 +313,13 @@ SkImage* SkReadBuffer::readImage() { |
} |
const SkIRect subset = SkIRect::MakeXYWH(originX, originY, width, height); |
- SkImage* image = SkImage::NewFromEncoded(encoded, &subset); |
+ SkImage* image = SkImage::MakeFromEncoded(std::move(encoded), &subset).release(); |
if (image) { |
return image; |
} |
- return SkImage::NewFromGenerator( |
- new EmptyImageGenerator(SkImageInfo::MakeN32Premul(width, height))); |
+ return SkImage::MakeFromGenerator( |
+ new EmptyImageGenerator(SkImageInfo::MakeN32Premul(width, height))).release(); |
} |
SkTypeface* SkReadBuffer::readTypeface() { |