Index: tools/SkBitmapRegionDecoderInterface.cpp |
diff --git a/tools/SkBitmapRegionDecoderInterface.cpp b/tools/SkBitmapRegionDecoderInterface.cpp |
index 835ed9aa56426cbda09b49b19e814a91e7f21514..4fc7ef77c1d4811b02f828e371909a9f85639600 100644 |
--- a/tools/SkBitmapRegionDecoderInterface.cpp |
+++ b/tools/SkBitmapRegionDecoderInterface.cpp |
@@ -6,11 +6,13 @@ |
*/ |
#include "SkBitmapRegionCanvas.h" |
+#include "SkBitmapRegionCodec.h" |
#include "SkBitmapRegionDecoderInterface.h" |
#include "SkBitmapRegionSampler.h" |
#include "SkCodec.h" |
#include "SkCodecPriv.h" |
#include "SkImageDecoder.h" |
+#include "SkScaledCodec.h" |
SkBitmapRegionDecoderInterface* SkBitmapRegionDecoderInterface::CreateBitmapRegionDecoder( |
SkStreamRewindable* stream, Strategy strategy) { |
@@ -46,6 +48,14 @@ SkBitmapRegionDecoderInterface* SkBitmapRegionDecoderInterface::CreateBitmapRegi |
} |
return new SkBitmapRegionCanvas(codec.detach()); |
} |
+ case kCodec_Strategy: { |
+ SkAutoTDelete<SkCodec> codec = SkScaledCodec::NewFromStream(streamDeleter.detach()); |
+ if (NULL == codec) { |
+ SkCodecPrintf("Error: Failed to create codec.\n"); |
+ return NULL; |
+ } |
+ return new SkBitmapRegionCodec(codec.detach()); |
+ } |
default: |
SkASSERT(false); |
return nullptr; |