aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/codec/SkBmpCodec.cpp
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2016-02-11 13:29:36 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-11 13:29:36 -0800
commit9b9497ef14f23562a95afe989d1efe41c603a6f6 (patch)
tree73bcf52cd5174899c13c816d02092faccdc8453d /src/codec/SkBmpCodec.cpp
parentf8289d9bd1faff400728cb8e1ac0b1aa68bfbc32 (diff)
Implement onSkipScanlines() for bmp and wbmp
Diffstat (limited to 'src/codec/SkBmpCodec.cpp')
-rw-r--r--src/codec/SkBmpCodec.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/codec/SkBmpCodec.cpp b/src/codec/SkBmpCodec.cpp
index cbba28c172..babb17d32e 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);
+}