From cc2feb161f756c4035a407296567654d86bc7be7 Mon Sep 17 00:00:00 2001 From: scroggo Date: Fri, 14 Aug 2015 08:32:46 -0700 Subject: Support more swizzles to 565 in SkCodec Add more swizzling functions for swizzling to 565. Much of this code was revived from crrev.com/1055743003 (for BMP). Also added swizzling functions for WBMP. Consolidate the static function conversion_possible. In SkCodec::getPixels, check that the alphatype corresponds to the colorType. This prevents requesting 565 + non-opaque. In SkIcoCodec, report that the image is unpremul (instead of whatever the largest embedded codec thinks), but modify the requested info to have the alpha type expected/required by the embedded codec. Add tests for decoding to 565. BUG=skia:3257 BUG=skia:3683 Review URL: https://codereview.chromium.org/1277213002 --- src/codec/SkBmpCodec.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/codec/SkBmpCodec.cpp') diff --git a/src/codec/SkBmpCodec.cpp b/src/codec/SkBmpCodec.cpp index fa4608ffee..20af2da06f 100644 --- a/src/codec/SkBmpCodec.cpp +++ b/src/codec/SkBmpCodec.cpp @@ -397,6 +397,7 @@ bool SkBmpCodec::ReadHeader(SkStream* stream, bool inIco, SkCodec** codecOut) { iBuffer.free(); // Additionally, 32 bit bmp-in-icos use the alpha channel. + // FIXME (msarett): Don't all bmp-in-icos use the alpha channel? // And, RLE inputs may skip pixels, leaving them as transparent. This // is uncommon, but we cannot be certain that an RLE bmp will be opaque. if ((inIco && 32 == bitsPerPixel) || (kRLE_BmpInputFormat == inputFormat)) { -- cgit v1.2.3