Index: src/image/SkImage.cpp |
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp |
index 8796b0328355f1c5049ee0151454197c74acbc57..97e7475a34ff28dc49b6499d5ecaef86c3c8d7fa 100644 |
--- a/src/image/SkImage.cpp |
+++ b/src/image/SkImage.cpp |
@@ -7,6 +7,7 @@ |
#include "SkBitmap.h" |
#include "SkCanvas.h" |
+#include "SkImageGenerator.h" |
#include "SkImagePriv.h" |
#include "SkImage_Base.h" |
#include "SkReadPixelsRec.h" |
@@ -72,6 +73,14 @@ SkData* SkImage::encode(SkImageEncoder::Type type, int quality) const { |
return NULL; |
} |
+SkImage* SkImage::NewFromData(SkData* data) { |
+ if (NULL == data) { |
+ return NULL; |
+ } |
+ SkImageGenerator* generator = SkImageGenerator::NewFromData(data); |
+ return generator ? SkImage::NewFromGenerator(generator) : NULL; |
+} |
+ |
SkSurface* SkImage::newSurface(const SkImageInfo& info, const SkSurfaceProps* props) const { |
if (NULL == props) { |
props = &as_IB(this)->props(); |