Index: src/core/SkImageGenerator.cpp |
diff --git a/src/core/SkImageGenerator.cpp b/src/core/SkImageGenerator.cpp |
index b4a3fc21c8ae835a7adfc77854e7d65ead5bcd38..7da4d40b0ce1da0cb84671b33b78311f0c6982d6 100644 |
--- a/src/core/SkImageGenerator.cpp |
+++ b/src/core/SkImageGenerator.cpp |
@@ -130,3 +130,29 @@ bool SkImageGenerator::onGetPixels(const SkImageInfo& info, void* dst, size_t rb |
return false; |
} |
#endif |
+ |
+/////////////////////////////////////////////////////////////////////////////////////////////////// |
+ |
+#include "SkGraphics.h" |
+ |
+static SkGraphics::ImageGeneratorFromEncodedFactory gImageGeneratorFromEncodedFactory; |
+ |
+SkGraphics::ImageGeneratorFromEncodedFactory SkGraphics::GetImageGeneratorFromEncodedFactory() { |
+ return gImageGeneratorFromEncodedFactory; |
+} |
+ |
+void SkGraphics::SetImageGeneratorFromEncodedFactory(ImageGeneratorFromEncodedFactory factory) { |
+ gImageGeneratorFromEncodedFactory = factory; |
+} |
+ |
+SkImageGenerator* SkImageGenerator::NewFromEncoded(SkData* data) { |
+ if (NULL == data) { |
+ return NULL; |
+ } |
+ if (gImageGeneratorFromEncodedFactory) { |
+ if (SkImageGenerator* generator = gImageGeneratorFromEncodedFactory(data)) { |
+ return generator; |
+ } |
+ } |
+ return SkImageGenerator::NewFromEncodedImpl(data); |
+} |