diff options
author | 2015-08-14 08:32:46 -0700 | |
---|---|---|
committer | 2015-08-14 08:32:46 -0700 | |
commit | cc2feb161f756c4035a407296567654d86bc7be7 (patch) | |
tree | fc18ba44cbd7bfc55ac169fe2610c45c4194fe03 /src/codec/SkBmpCodec.cpp | |
parent | 8f4ba76742c329bc4d5e1b8ca376d27922bd00b1 (diff) |
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
Diffstat (limited to 'src/codec/SkBmpCodec.cpp')
-rw-r--r-- | src/codec/SkBmpCodec.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
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)) { |