Index: src/core/SkPicture.cpp |
diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp |
index 8247336d49e96d3d7698dbb8bdaf61a1a9498b41..04f2f93ba73ea3270e43aa4e77c4502f9538081a 100644 |
--- a/src/core/SkPicture.cpp |
+++ b/src/core/SkPicture.cpp |
@@ -6,6 +6,7 @@ |
*/ |
#include "SkAtomics.h" |
+#include "SkImageGenerator.h" |
#include "SkMessageBus.h" |
#include "SkPicture.h" |
#include "SkPictureData.h" |
@@ -138,6 +139,16 @@ SkPicture* SkPicture::Forwardport(const SkPictInfo& info, const SkPictureData* d |
return r.endRecording(); |
} |
+static bool default_install(const void* src, size_t length, SkBitmap* dst) { |
+ SkAutoTUnref<SkData> encoded(SkData::NewWithCopy(src, length)); |
+ return encoded && SkDEPRECATED_InstallDiscardablePixelRef( |
+ SkImageGenerator::NewFromEncoded(encoded), dst); |
+} |
+ |
+SkPicture* SkPicture::CreateFromStream(SkStream* stream) { |
+ return CreateFromStream(stream, &default_install, nullptr); |
+} |
+ |
SkPicture* SkPicture::CreateFromStream(SkStream* stream, InstallPixelRefProc proc) { |
return CreateFromStream(stream, proc, nullptr); |
} |