diff options
author | scroggo <scroggo@chromium.org> | 2016-05-20 13:56:13 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-20 13:56:13 -0700 |
commit | ba5848953e00685f9a57343aef94372c5803130a (patch) | |
tree | d649d222b437821786d485abd515a81963c1b265 /src/codec/SkCodecPriv.h | |
parent | 17b4a109219d063dc10a988b1ed46aaefe278477 (diff) |
Finish supporting decoding opaque to non-opaque
When decoding to 565 or Gray, allow the client to incorrectly ask for premul.
When checking whether it's possible to decode to 565, return whether the
source is opaque.
In DM, allow decoding to 565 or Gray, even if the client also asked for premul.
This fixes a bug introduced in crrev.com/1999593003 when we stopped ever
requesting Opaque, resulting in us not testing 565 or Gray.
BUG=skia:4616
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=1996993003
Review-Url: https://codereview.chromium.org/1996993003
Diffstat (limited to 'src/codec/SkCodecPriv.h')
-rw-r--r-- | src/codec/SkCodecPriv.h | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/codec/SkCodecPriv.h b/src/codec/SkCodecPriv.h index 1694784785..6771ef72b8 100644 --- a/src/codec/SkCodecPriv.h +++ b/src/codec/SkCodecPriv.h @@ -132,12 +132,7 @@ inline bool conversion_possible(const SkImageInfo& dst, const SkImageInfo& src) case kBGRA_8888_SkColorType: return true; case kRGB_565_SkColorType: - return kOpaque_SkAlphaType == dst.alphaType(); - case kGray_8_SkColorType: - if (kOpaque_SkAlphaType != dst.alphaType()) { - return false; - } - // Fall through + return kOpaque_SkAlphaType == src.alphaType(); default: return dst.colorType() == src.colorType(); } |