| Index: src/codec/SkBmpCodec.cpp
|
| diff --git a/src/codec/SkBmpCodec.cpp b/src/codec/SkBmpCodec.cpp
|
| index cbba28c172de3e6bf440d0fda9824895764a7f7e..babb17d32e5902dab1c73c558f9c8247bd18f94e 100644
|
| --- a/src/codec/SkBmpCodec.cpp
|
| +++ b/src/codec/SkBmpCodec.cpp
|
| @@ -546,6 +546,7 @@ SkBmpCodec::SkBmpCodec(const SkImageInfo& info, SkStream* stream,
|
| : INHERITED(info, stream)
|
| , fBitsPerPixel(bitsPerPixel)
|
| , fRowOrder(rowOrder)
|
| + , fSrcRowBytes(SkAlign4(compute_row_bytes(info.width(), fBitsPerPixel)))
|
| {}
|
|
|
| bool SkBmpCodec::onRewind() {
|
| @@ -577,3 +578,12 @@ int SkBmpCodec::onGetScanlines(void* dst, int count, size_t rowBytes) {
|
| // Decode the requested rows
|
| return this->decodeRows(rowInfo, dst, rowBytes, this->options());
|
| }
|
| +
|
| +bool SkBmpCodec::skipRows(int count) {
|
| + const size_t bytesToSkip = count * fSrcRowBytes;
|
| + return this->stream()->skip(bytesToSkip) == bytesToSkip;
|
| +}
|
| +
|
| +bool SkBmpCodec::onSkipScanlines(int count) {
|
| + return this->skipRows(count);
|
| +}
|
|
|