diff options
author | scroggo <scroggo@chromium.org> | 2015-08-14 08:32:46 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-14 08:32:46 -0700 |
commit | cc2feb161f756c4035a407296567654d86bc7be7 (patch) | |
tree | fc18ba44cbd7bfc55ac169fe2610c45c4194fe03 /src/codec/SkCodec_wbmp.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/SkCodec_wbmp.cpp')
-rw-r--r-- | src/codec/SkCodec_wbmp.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/codec/SkCodec_wbmp.cpp b/src/codec/SkCodec_wbmp.cpp index 3081a3bba9..9e38155b4b 100644 --- a/src/codec/SkCodec_wbmp.cpp +++ b/src/codec/SkCodec_wbmp.cpp @@ -73,13 +73,11 @@ bool SkWbmpCodec::onRewind() { SkSwizzler* SkWbmpCodec::initializeSwizzler(const SkImageInfo& info, const SkPMColor* ctable, const Options& opts) { - // TODO (msarett): Reenable support for 565 if it is desired - // skbug.com/3683 - // Create the swizzler based on the desired color type switch (info.colorType()) { case kIndex_8_SkColorType: case kN32_SkColorType: + case kRGB_565_SkColorType: case kGray_8_SkColorType: return SkSwizzler::CreateSwizzler(SkSwizzler::kBit, ctable, info, opts.fZeroInitialized, this->getInfo()); |