Chromium Code Reviews| Index: src/codec/SkCodec_wbmp.cpp |
| diff --git a/src/codec/SkCodec_wbmp.cpp b/src/codec/SkCodec_wbmp.cpp |
| index 1696dfb58515cd6ebf699bf1f2da54d16610b35c..68486db862adf2f0d9fbb5fdc9901c1644d9299f 100644 |
| --- a/src/codec/SkCodec_wbmp.cpp |
| +++ b/src/codec/SkCodec_wbmp.cpp |
| @@ -109,7 +109,8 @@ SkCodec::Result SkWbmpCodec::onGetPixels(const SkImageInfo& info, |
| size_t rowBytes, |
| const Options& options, |
| SkPMColor ctable[], |
| - int* ctableCount) { |
| + int* ctableCount, |
| + int* rowsDecoded) { |
| if (options.fSubset) { |
| // Subsets are not supported. |
| return kUnimplemented; |
| @@ -139,6 +140,7 @@ SkCodec::Result SkWbmpCodec::onGetPixels(const SkImageInfo& info, |
| for (int y = 0; y < size.height(); ++y) { |
| Result rowResult = this->readRow(src.get()); |
|
scroggo
2015/10/01 14:48:31
I think this should also return a bool?
msarett
2015/10/01 18:14:14
Yes it should.
|
| if (kSuccess != rowResult) { |
| + *rowsDecoded = y; |
| return rowResult; |
| } |
| swizzler->swizzle(dstRow, src.get()); |
| @@ -162,17 +164,17 @@ SkCodec* SkWbmpCodec::NewFromStream(SkStream* stream) { |
| return new SkWbmpCodec(info, streamDeleter.detach()); |
| } |
| -SkCodec::Result SkWbmpCodec::onGetScanlines(void* dst, int count, size_t dstRowBytes) { |
| +uint32_t SkWbmpCodec::onGetScanlines(void* dst, int count, size_t dstRowBytes) { |
| void* dstRow = dst; |
| for (int y = 0; y < count; ++y) { |
| - Result rowResult = this->readRow(fSrcBuffer.get()); |
| - if (kSuccess != rowResult) { |
| - return rowResult; |
| + SkCodec::Result rowResult = this->readRow(fSrcBuffer.get()); |
| + if (SkCodec::kSuccess != rowResult) { |
| + return y; |
| } |
| fSwizzler->swizzle(dstRow, fSrcBuffer.get()); |
| dstRow = SkTAddOffset<void>(dstRow, dstRowBytes); |
| } |
| - return kSuccess; |
| + return count; |
| } |
| SkCodec::Result SkWbmpCodec::onStartScanlineDecode(const SkImageInfo& dstInfo, |
| @@ -210,4 +212,3 @@ SkCodec::Result SkWbmpCodec::onStartScanlineDecode(const SkImageInfo& dstInfo, |
| return kSuccess; |
| } |
| - |