Index: dm/DMSrcSink.cpp |
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp |
index 2c80fac6be9506e9e26a7a4c180be33e93e06984..c36b672c68087063d468b655c00234bd641ec569 100644 |
--- a/dm/DMSrcSink.cpp |
+++ b/dm/DMSrcSink.cpp |
@@ -195,8 +195,28 @@ Error CodecSrc::draw(SkCanvas* canvas) const { |
return Error::Nonfatal("Could not start scanline decoder"); |
} |
- const SkCodec::Result result = scanlineDecoder->getScanlines( |
- bitmap.getAddr(0, 0), decodeInfo.height(), bitmap.rowBytes()); |
+ SkCodec::Result result; |
+ switch (scanlineDecoder->getScanlineOrder()) { |
+ case SkScanlineDecoder::kTopDown_SkScanlineOrder: |
+ case SkScanlineDecoder::kBottomUp_SkScanlineOrder: |
+ case SkScanlineDecoder::kNone_SkScanlineOrder: |
+ result = scanlineDecoder->getScanlines(bitmap.getAddr(0, 0), |
+ decodeInfo.height(), bitmap.rowBytes()); |
+ break; |
+ case SkScanlineDecoder::kOutOfOrder_SkScanlineOrder: { |
+ for (int y = 0; y < decodeInfo.height(); y++) { |
+ int dstY = scanlineDecoder->getY(); |
+ void* dstPtr = bitmap.getAddr(0, dstY); |
+ result = scanlineDecoder->getScanlines(dstPtr, 1, bitmap.rowBytes()); |
+ if (SkCodec::kSuccess != result && SkCodec::kIncompleteInput != result) { |
scroggo
2015/09/02 22:45:47
The weird thing about allowing incomplete here is
msarett
2015/09/03 17:13:30
Actually the reason that we allow kIncomplete here
scroggo
2015/09/04 18:42:09
Wait, so you're saying that the scanline decoder w
msarett
2015/09/04 19:52:47
Yes that's what it does.
|
+ return SkStringPrintf("%s failed with error message %d", |
+ fPath.c_str(), (int) result); |
+ } |
+ } |
+ break; |
+ } |
+ } |
+ |
switch (result) { |
case SkCodec::kSuccess: |
case SkCodec::kIncompleteInput: |