Index: src/codec/SkCodec_wbmp.cpp |
diff --git a/src/codec/SkCodec_wbmp.cpp b/src/codec/SkCodec_wbmp.cpp |
index 86dce5cc89e95590f8d0d138df9bda352994f95d..fe06b5989006201ba1844121dd8f2c57e7ee0621 100644 |
--- a/src/codec/SkCodec_wbmp.cpp |
+++ b/src/codec/SkCodec_wbmp.cpp |
@@ -9,6 +9,7 @@ |
#include "SkCodecPriv.h" |
#include "SkColorPriv.h" |
#include "SkColorTable.h" |
+#include "SkScaledCodec.h" |
#include "SkStream.h" |
#include "SkCodec_wbmp.h" |
@@ -88,8 +89,8 @@ SkSwizzler* SkWbmpCodec::initializeSwizzler(const SkImageInfo& info, |
case kIndex_8_SkColorType: |
case kN32_SkColorType: |
case kGray_8_SkColorType: |
- return SkSwizzler::CreateSwizzler( |
- SkSwizzler::kBit, ctable, info, opts.fZeroInitialized); |
+ return SkSwizzler::CreateSwizzler(SkSwizzler::kBit, ctable, info, opts.fZeroInitialized, |
+ this->getInfo().width()); |
default: |
return NULL; |
} |
@@ -205,7 +206,9 @@ public: |
return SkCodec::kUnimplemented; |
} |
if (dstInfo.dimensions() != this->getInfo().dimensions()) { |
- return SkCodec::kInvalidScale; |
+ if (!SkScaledCodec::DimensionsSupportedForSampling(this->getInfo(), dstInfo)) { |
+ return SkCodec::kInvalidScale; |
+ } |
} |
// Fill in the color table |
@@ -226,6 +229,10 @@ public: |
return SkCodec::kSuccess; |
} |
+ SkEncodedFormat onGetEncodedFormat() const { |
+ return kWBMP_SkEncodedFormat; |
+ } |
+ |
private: |
SkAutoTDelete<SkWbmpCodec> fCodec; |
SkAutoTUnref<SkColorTable> fColorTable; |