| Index: src/codec/SkBmpCodec.cpp
|
| diff --git a/src/codec/SkBmpCodec.cpp b/src/codec/SkBmpCodec.cpp
|
| index 1aa43f583cbcc2a536c6f1b8e8fb6dd15acb7be5..d455db45688fe819deeff2f23b4eb721892d8036 100644
|
| --- a/src/codec/SkBmpCodec.cpp
|
| +++ b/src/codec/SkBmpCodec.cpp
|
| @@ -535,10 +535,18 @@ SkBmpCodec::SkBmpCodec(const SkImageInfo& info, SkStream* stream,
|
| : INHERITED(info, stream)
|
| , fBitsPerPixel(bitsPerPixel)
|
| , fRowOrder(rowOrder)
|
| + , fSubsetLeft(0)
|
| + , fSubsetWidth(this->getInfo().width())
|
| {}
|
|
|
| bool SkBmpCodec::onRewind() {
|
| - return SkBmpCodec::ReadHeader(this->stream(), this->inIco(), nullptr);
|
| + if (!SkBmpCodec::ReadHeader(this->stream(), this->inIco(), nullptr)) {
|
| + return false;
|
| + }
|
| +
|
| + fSubsetLeft = 0;
|
| + fSubsetWidth = this->getInfo().width();
|
| + return true;
|
| }
|
|
|
| int32_t SkBmpCodec::getDstRow(int32_t y, int32_t height) const {
|
| @@ -563,7 +571,8 @@ uint32_t SkBmpCodec::computeNumColors(uint32_t numColors) {
|
| }
|
|
|
| SkCodec::Result SkBmpCodec::onStartScanlineDecode(const SkImageInfo& dstInfo,
|
| - const SkCodec::Options& options, SkPMColor inputColorPtr[], int* inputColorCount) {
|
| + const SkCodec::Options& options, SkPMColor inputColorPtr[], int* inputColorCount,
|
| + int subsetLeft, int subsetWidth) {
|
| if (options.fSubset) {
|
| // Subsets are not supported.
|
| return kUnimplemented;
|
| @@ -573,7 +582,9 @@ SkCodec::Result SkBmpCodec::onStartScanlineDecode(const SkImageInfo& dstInfo,
|
| return kInvalidConversion;
|
| }
|
|
|
| - return prepareToDecode(dstInfo, options, inputColorPtr, inputColorCount);
|
| + this->fSubsetLeft = subsetLeft;
|
| + this->fSubsetWidth = subsetWidth;
|
| + return this->prepareToDecode(dstInfo, options, inputColorPtr, inputColorCount);
|
| }
|
|
|
| int SkBmpCodec::onGetScanlines(void* dst, int count, size_t rowBytes) {
|
|
|