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

Unified Diff: src/utils/SkBitmapSourceDeserializer.cpp

Issue 2187613002: Deserialize pictures with custom image-deserializer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix legacy case, remove null-check Created 4 years, 4 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/image/SkImageShader.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkBitmapSourceDeserializer.cpp
diff --git a/src/utils/SkBitmapSourceDeserializer.cpp b/src/utils/SkBitmapSourceDeserializer.cpp
index bf4ec6021911d4ec15b3d3f00459bfd66279f50a..1f8cc1c7bd8cea31b7e740c8949f3c6fd77952f3 100644
--- a/src/utils/SkBitmapSourceDeserializer.cpp
+++ b/src/utils/SkBitmapSourceDeserializer.cpp
@@ -23,11 +23,9 @@ sk_sp<SkFlattenable> SkBitmapSourceDeserializer::CreateProc(SkReadBuffer& buffer
SkRect src, dst;
buffer.readRect(&src);
buffer.readRect(&dst);
- SkBitmap bitmap;
- if (!buffer.readBitmap(&bitmap)) {
- return nullptr;
+ sk_sp<SkImage> image = buffer.readBitmapAsImage();
+ if (image) {
+ return SkImageSource::Make(std::move(image), src, dst, filterQuality);
}
- bitmap.setImmutable();
-
- return SkImageSource::Make(SkImage::MakeFromBitmap(bitmap), src, dst, filterQuality);
+ return nullptr;
}
« no previous file with comments | « src/image/SkImageShader.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698