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

Unified Diff: src/image/SkImage.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/core/SkReadBuffer.cpp ('k') | src/image/SkImageShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage.cpp
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp
index 2d434aee194f675efdb7373e0ad4461e8ba930a1..921bc6f5d7bf99860709f18a355b2e449f7d2308 100644
--- a/src/image/SkImage.cpp
+++ b/src/image/SkImage.cpp
@@ -500,3 +500,14 @@ sk_sp<SkImage> MakeTextureFromMipMap(GrContext*, const SkImageInfo&, const GrMip
int mipLevelCount, SkBudgeted) {
return nullptr;
}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+#include "SkImageDeserializer.h"
+
+sk_sp<SkImage> SkImageDeserializer::makeFromData(SkData* data, const SkIRect* subset) {
+ return SkImage::MakeFromEncoded(sk_ref_sp(data), subset);
+}
+sk_sp<SkImage> SkImageDeserializer::makeFromMemory(const void* data, size_t length,
+ const SkIRect* subset) {
+ return SkImage::MakeFromEncoded(SkData::MakeWithCopy(data, length), subset);
+}
« no previous file with comments | « src/core/SkReadBuffer.cpp ('k') | src/image/SkImageShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698