mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 04:41:11 +00:00
Bug 1925265. Always correctly handle the TO_SRGB_COLORSPACE flag when decoding an image. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D225962
This commit is contained in:
parent
37a4551db6
commit
2c516b3ffb
@ -93,10 +93,20 @@ Decoder::~Decoder() {
|
||||
|
||||
void Decoder::SetSurfaceFlags(SurfaceFlags aSurfaceFlags) {
|
||||
MOZ_ASSERT(!mInitialized);
|
||||
MOZ_ASSERT(!(mSurfaceFlags & SurfaceFlags::NO_COLORSPACE_CONVERSION) ||
|
||||
!(mSurfaceFlags & SurfaceFlags::TO_SRGB_COLORSPACE));
|
||||
mSurfaceFlags = aSurfaceFlags;
|
||||
if (mSurfaceFlags & SurfaceFlags::NO_COLORSPACE_CONVERSION) {
|
||||
mCMSMode = CMSMode::Off;
|
||||
}
|
||||
if (mSurfaceFlags & SurfaceFlags::TO_SRGB_COLORSPACE) {
|
||||
// CMSMode::TaggedOnly and CMSMode::All are equivalent when the
|
||||
// TO_SRGB_COLORSPACE flag is set (for untagged images CMSMode::All assumes
|
||||
// they are in sRGB space so it does nothing, which is same as what
|
||||
// CMSMode::TaggedOnly does for untagged images). We just want to avoid
|
||||
// CMSMode::Off so that the sRGB conversion actually happens.
|
||||
mCMSMode = CMSMode::All;
|
||||
}
|
||||
}
|
||||
|
||||
qcms_profile* Decoder::GetCMSOutputProfile() const {
|
||||
|
Loading…
Reference in New Issue
Block a user