Index: src/codec/SkCodec_wbmp.cpp |
diff --git a/src/codec/SkCodec_wbmp.cpp b/src/codec/SkCodec_wbmp.cpp |
index ba4dc9af8995f2c9093889158a79b3a8990122d5..7d87123e63700c2160a7a5e9b2bddfc30768e0e5 100644 |
--- a/src/codec/SkCodec_wbmp.cpp |
+++ b/src/codec/SkCodec_wbmp.cpp |
@@ -70,8 +70,8 @@ bool SkWbmpCodec::onRewind() { |
return read_header(this->stream(), nullptr); |
} |
-SkSwizzler* SkWbmpCodec::initializeSwizzler(const SkImageInfo& info, |
- const SkPMColor* ctable, const Options& opts) { |
+SkSwizzler* SkWbmpCodec::initializeSwizzler(const SkImageInfo& info, const SkPMColor* ctable, |
+ const Options& opts, int subsetLeft, int subsetWidth) { |
// Create the swizzler based on the desired color type |
switch (info.colorType()) { |
case kIndex_8_SkColorType: |
@@ -82,8 +82,8 @@ SkSwizzler* SkWbmpCodec::initializeSwizzler(const SkImageInfo& info, |
default: |
return nullptr; |
} |
- return SkSwizzler::CreateSwizzler(SkSwizzler::kBit, ctable, info, |
- opts.fZeroInitialized); |
+ return SkSwizzler::CreateSwizzler(SkSwizzler::kBit, ctable, info, opts.fZeroInitialized, |
+ subsetLeft, subsetWidth); |
} |
bool SkWbmpCodec::readRow(uint8_t* row) { |
@@ -121,7 +121,7 @@ SkCodec::Result SkWbmpCodec::onGetPixels(const SkImageInfo& info, |
setup_color_table(info.colorType(), ctable, ctableCount); |
// Initialize the swizzler |
- fSwizzler.reset(this->initializeSwizzler(info, ctable, options)); |
+ fSwizzler.reset(this->initializeSwizzler(info, ctable, options, 0,info.width())); |
if (nullptr == fSwizzler.get()) { |
return kInvalidConversion; |
} |
@@ -169,7 +169,8 @@ int SkWbmpCodec::onGetScanlines(void* dst, int count, size_t dstRowBytes) { |
} |
SkCodec::Result SkWbmpCodec::onStartScanlineDecode(const SkImageInfo& dstInfo, |
- const Options& options, SkPMColor inputColorTable[], int* inputColorCount) { |
+ const Options& options, SkPMColor inputColorTable[], int* inputColorCount, int subsetLeft, |
+ int subsetWidth) { |
if (options.fSubset) { |
// Subsets are not supported. |
return kUnimplemented; |
@@ -188,8 +189,8 @@ SkCodec::Result SkWbmpCodec::onStartScanlineDecode(const SkImageInfo& dstInfo, |
} |
// Initialize the swizzler |
- fSwizzler.reset(this->initializeSwizzler(dstInfo, |
- get_color_ptr(fColorTable.get()), options)); |
+ fSwizzler.reset(this->initializeSwizzler(dstInfo, get_color_ptr(fColorTable.get()), options, |
+ subsetLeft, subsetWidth)); |
if (nullptr == fSwizzler.get()) { |
return kInvalidConversion; |
} |