Commit 7bc97c52 authored by Andrew Osmond's avatar Andrew Osmond
Browse files

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

Differential Revision: https://phabricator.services.mozilla.com/D76859
parent 0ff83a4b
......@@ -2087,6 +2087,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
......
......@@ -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.
*
......
......@@ -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.
......
......@@ -3740,7 +3740,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
......
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment