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

Unified Diff: dm/DMSrcSink.cpp

Issue 2441833002: Fix decoding GIF to 565 (Closed)
Patch Set: Make 565 support interlaced (with no transparency, first frame) Created 4 years, 2 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 | src/codec/SkGifCodec.cpp » ('j') | no next file with comments »
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 30185a2ab1faf8babbb8d720e6ea950c0f5e0718..4b297c1e107e42e7dbc51afb9a66956fce58edbc 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());
« no previous file with comments | « no previous file | src/codec/SkGifCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698