Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1383)

Unified Diff: dm/DMSrcSink.cpp

Issue 1305123002: Scanline decoding for gifs (Closed) Base URL: https://skia.googlesource.com/skia.git@real-bmp-scan
Patch Set: Make kScanline_Mode test kOutOfOrder correctly in dm Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/codec/SkScanlineDecoder.h » ('j') | include/codec/SkScanlineDecoder.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « no previous file | include/codec/SkScanlineDecoder.h » ('j') | include/codec/SkScanlineDecoder.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698