diff options
author | scroggo <scroggo@chromium.org> | 2016-10-27 08:29:13 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-27 08:29:13 -0700 |
commit | 53f63b69e83fd805418d72a6eeb860cf0fcff3c5 (patch) | |
tree | fd8f92fcdc7a958ab1e1f6025040c02c091fb303 /dm | |
parent | cffaa70896fa5bc6c7bf98abbaafb1a755b49762 (diff) |
Fix decoding GIF to 565
565 cannot take the !writeTransparentPixels path, so disable it for
cases where we might have to take that path.
This only affects frames beyond the first. If the first frame has
a transparent pixel, it will be marked as non-opaque, so we cannot
decode to 565 anyway.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2441833002
Review-Url: https://codereview.chromium.org/2441833002
Diffstat (limited to 'dm')
-rw-r--r-- | dm/DMSrcSink.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp index 30185a2ab1..4b297c1e10 100644 --- a/dm/DMSrcSink.cpp +++ b/dm/DMSrcSink.cpp @@ -473,6 +473,13 @@ Error CodecSrc::draw(SkCanvas* canvas) const { } break; } + case SkCodec::kInvalidConversion: + if (i > 0 && (decodeInfo.colorType() == kRGB_565_SkColorType + || decodeInfo.colorType() == kIndex_8_SkColorType)) { + return Error::Nonfatal(SkStringPrintf( + "Cannot decode frame %i to 565/Index8 (%s).", i, fPath.c_str())); + } + // Fall through. default: return SkStringPrintf("Couldn't getPixels for frame %i in %s.", i, fPath.c_str()); |