diff options
author | Matt Sarett <msarett@google.com> | 2017-03-28 14:34:20 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-28 19:39:42 +0000 |
commit | 3725f0a7dd2916c10bc6d0059821e19a5b4452c3 (patch) | |
tree | 23ba20c8e98abc8aa7cb41080c4a189199359e20 /src/codec/SkCodecPriv.h | |
parent | 56ea77ac5f782d0165b2992b9575b4e3b9b15715 (diff) |
Add codec and color xform support for 565
Bug: skia:
Change-Id: I23184acc4e17d38861d27ab81172048a24c400d2
Reviewed-on: https://skia-review.googlesource.com/10288
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Matt Sarett <msarett@google.com>
Diffstat (limited to 'src/codec/SkCodecPriv.h')
-rw-r--r-- | src/codec/SkCodecPriv.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/codec/SkCodecPriv.h b/src/codec/SkCodecPriv.h index af049b36d8..56a1900220 100644 --- a/src/codec/SkCodecPriv.h +++ b/src/codec/SkCodecPriv.h @@ -321,8 +321,11 @@ static inline SkAlphaType select_xform_alpha(SkAlphaType dstAlphaType, SkAlphaTy } static inline bool apply_xform_on_decode(SkColorType dstColorType, SkEncodedInfo::Color srcColor) { - // We will apply the color xform when reading the color table, unless F16 is requested. - return SkEncodedInfo::kPalette_Color != srcColor || kRGBA_F16_SkColorType == dstColorType; + // We will apply the color xform when reading the color table if a form of 8888 is requested. + return SkEncodedInfo::kPalette_Color != srcColor || + (kRGBA_8888_SkColorType != dstColorType && + kBGRA_8888_SkColorType != dstColorType && + kIndex_8_SkColorType != dstColorType); } /* @@ -353,7 +356,7 @@ static inline bool conversion_possible(const SkImageInfo& dst, const SkImageInfo case kIndex_8_SkColorType: return kIndex_8_SkColorType == src.colorType(); case kRGB_565_SkColorType: - return kOpaque_SkAlphaType == src.alphaType() && !needs_color_xform(dst, src, false); + return kOpaque_SkAlphaType == src.alphaType(); case kGray_8_SkColorType: return kGray_8_SkColorType == src.colorType() && kOpaque_SkAlphaType == src.alphaType() && !needs_color_xform(dst, src, false); |