diff --git a/browser/base/content/test/performance/browser_preferences_usage.js b/browser/base/content/test/performance/browser_preferences_usage.js index 0094c9094343..00843f5af7a6 100644 --- a/browser/base/content/test/performance/browser_preferences_usage.js +++ b/browser/base/content/test/performance/browser_preferences_usage.js @@ -240,6 +240,15 @@ add_task(async function navigate_around() { min: 49, max: 55, }; + // This was previously being read in the content process, but + // bug 1725573 moved it into the parent process. We also block + // the main thread on requests to the X server, which is likely + // more problematic than the pref read. These issues are covered + // by https://bugzilla.mozilla.org/show_bug.cgi?id=1729080 + knownProblematicPrefs["gfx.color_management.display_profile"] = { + min: 49, + max: 50, + }; } else if (AppConstants.platform == "win") { // The following 2 graphics prefs are covered by // https://bugzilla.mozilla.org/show_bug.cgi?id=1639497 diff --git a/gfx/thebes/gfxPlatformGtk.cpp b/gfx/thebes/gfxPlatformGtk.cpp index 7ad80f9f08ac..3516d5234750 100644 --- a/gfx/thebes/gfxPlatformGtk.cpp +++ b/gfx/thebes/gfxPlatformGtk.cpp @@ -27,6 +27,7 @@ #include "GLContextProvider.h" #include "mozilla/Atomics.h" #include "mozilla/Components.h" +#include "mozilla/dom/ContentChild.h" #include "mozilla/FontPropertyTypes.h" #include "mozilla/gfx/2D.h" #include "mozilla/gfx/Logging.h" @@ -493,6 +494,26 @@ nsTArray gfxPlatformGtk::GetPlatformCMSOutputProfileData() { return prefProfileData; } + if (XRE_IsContentProcess()) { + MOZ_ASSERT(NS_IsMainThread()); + // This will be passed in during InitChild so we can avoid sending a + // sync message back to the parent during init. + const mozilla::gfx::ContentDeviceData* contentDeviceData = + GetInitContentDeviceData(); + if (contentDeviceData) { + // On Windows, we assert that the profile isn't empty, but on + // Linux it can legitimately be empty if the display isn't + // calibrated. Thus, no assertion here. + return contentDeviceData->cmsOutputProfileData().Clone(); + } + + // Otherwise we need to ask the parent for the updated color profile + mozilla::dom::ContentChild* cc = mozilla::dom::ContentChild::GetSingleton(); + nsTArray result; + Unused << cc->SendGetOutputColorProfileData(&result); + return result; + } + if (!mIsX11Display) { return nsTArray(); } @@ -849,3 +870,9 @@ already_AddRefed gfxPlatformGtk::CreateHardwareVsyncSource() { } #endif + +void gfxPlatformGtk::BuildContentDeviceData(ContentDeviceData* aOut) { + gfxPlatform::BuildContentDeviceData(aOut); + + aOut->cmsOutputProfileData() = GetPlatformCMSOutputProfileData(); +} diff --git a/gfx/thebes/gfxPlatformGtk.h b/gfx/thebes/gfxPlatformGtk.h index 47bd110f7b57..7a5ee8ac4ce9 100644 --- a/gfx/thebes/gfxPlatformGtk.h +++ b/gfx/thebes/gfxPlatformGtk.h @@ -76,6 +76,7 @@ class gfxPlatformGtk final : public gfxPlatform { void InitPlatformGPUProcessPrefs() override; void InitWebRenderConfig() override; bool CheckVariationFontSupport() override; + void BuildContentDeviceData(mozilla::gfx::ContentDeviceData* aOut) override; int8_t mMaxGenericSubstitutions;