Bug 1639574 - Disable color management for CSS due to issues with canvas. r=jrmuizel

Differential Revision: https://phabricator.services.mozilla.com/D76859
This commit is contained in:
Andrew Osmond 2020-05-26 21:20:18 +00:00
parent 38ffa87e05
commit 532a41fd80
5 changed files with 15 additions and 2 deletions

View File

@ -2095,6 +2095,11 @@ eCMSMode gfxPlatform::GetCMSMode() {
return gCMSMode;
}
void gfxPlatform::SetCMSModeOverride(eCMSMode aMode) {
MOZ_ASSERT(gCMSInitialized);
gCMSMode = aMode;
}
int gfxPlatform::GetRenderingIntent() {
// StaticPrefList.yaml is using 0 as the default for the rendering
// intent preference, based on that being the value for

View File

@ -506,6 +506,11 @@ class gfxPlatform : public mozilla::layers::MemoryPressureListener {
*/
static eCMSMode GetCMSMode();
/**
* Used only for testing. Override the pref setting.
*/
static void SetCMSModeOverride(eCMSMode aMode);
/**
* Determines the rendering intent for color management.
*

View File

@ -52,6 +52,9 @@ AutoInitializeImageLib::AutoInitializeImageLib() {
// Ensure gfxPlatform is initialized.
gfxPlatform::GetPlatform();
// Ensure we always color manage images with gtests.
gfxPlatform::SetCMSModeOverride(eCMSMode_All);
// Depending on initialization order, it is possible that our pref changes
// have not taken effect yet because there are pending gfx-related events on
// the main thread.

View File

@ -3750,7 +3750,7 @@
# See eCMSMode in gfx/thebes/gfxPlatform.h.
- name: gfx.color_management.mode
type: RelaxedAtomicInt32
value: 1
value: 2
mirror: always
# The zero default here should match QCMS_INTENT_DEFAULT from qcms.h

View File

@ -41,7 +41,7 @@ user_pref("extensions.getAddons.cache.enabled", false);
user_pref("extensions.getAddons.get.url", "http://localhost/extensions-dummy/repositoryGetURL");
user_pref("extensions.systemAddon.update.url", "http://localhost/dummy-system-addons.xml");
user_pref("gfx.color_management.force_srgb", true);
user_pref("gfx.color_management.mode", 1);
user_pref("gfx.color_management.mode", 2);
user_pref("gfx.logging.level", 1);
// Disable downscale-during-decode, since it makes reftests more difficult.
user_pref("image.downscale-during-decode.enabled", false);