From 3dc26ddcf361bd2fd82f6ccd97999adede522a23 Mon Sep 17 00:00:00 2001 From: Mihai Alexandru Michis Date: Tue, 17 Mar 2020 00:41:38 +0200 Subject: [PATCH] Backed out changeset 18c3c5e79f1c (bug 1540776) for causing xpcshell failures in test_BHRObserver.js CLOSED TREE --- dom/ipc/ContentParent.cpp | 7 ------- dom/ipc/ContentParent.h | 3 --- dom/ipc/PContent.ipdl | 9 --------- gfx/thebes/gfxPlatform.cpp | 30 +++++++----------------------- gfx/thebes/gfxPlatform.h | 12 ++---------- ipc/ipdl/sync-messages.ini | 4 +--- 6 files changed, 10 insertions(+), 55 deletions(-) diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 783a77c1c2e3..c08f1a61f4ff 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -5005,13 +5005,6 @@ mozilla::ipc::IPCResult ContentParent::RecvGetGraphicsDeviceInitData( return IPC_OK(); } -mozilla::ipc::IPCResult ContentParent::RecvGetOutputColorProfileData( - nsTArray* aOutputColorProfileData) { - (*aOutputColorProfileData) = - gfxPlatform::GetPlatform()->GetCMSOutputProfileData(); - return IPC_OK(); -} - mozilla::ipc::IPCResult ContentParent::RecvGetFontListShmBlock( const uint32_t& aGeneration, const uint32_t& aIndex, mozilla::ipc::SharedMemoryBasic::Handle* aOut) { diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h index 3602a6537995..930eead221e8 100644 --- a/dom/ipc/ContentParent.h +++ b/dom/ipc/ContentParent.h @@ -1148,9 +1148,6 @@ class ContentParent final mozilla::ipc::IPCResult RecvGetGraphicsDeviceInitData( ContentDeviceData* aOut); - mozilla::ipc::IPCResult RecvGetOutputColorProfileData( - nsTArray* aOutputColorProfileData); - mozilla::ipc::IPCResult RecvGetFontListShmBlock( const uint32_t& aGeneration, const uint32_t& aIndex, mozilla::ipc::SharedMemoryBasic::Handle* aOut); diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl index 38750df355d9..cf5674fa9643 100644 --- a/dom/ipc/PContent.ipdl +++ b/dom/ipc/PContent.ipdl @@ -1183,15 +1183,6 @@ parent: sync GetGraphicsDeviceInitData() returns (ContentDeviceData aData); - /** - * Request a buffer containing the contents of the output color profile. - * If set, this is the file pointed to by - * gfx.color_management.display_profile, otherwise it contains a - * platform-specific default - */ - sync GetOutputColorProfileData() - returns (uint8_t[] aOutputColorProfileData); - /** * A shared font list (see gfx/thebes/SharedFontList.*) contains a list * of shared-memory blocks that are used to store all the font list data. diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index 79388ccb5b98..d038b3d4ec4b 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -2191,39 +2191,25 @@ nsTArray gfxPlatform::GetPlatformCMSOutputProfileData() { } nsTArray gfxPlatform::GetCMSOutputProfileData() { - if (XRE_IsContentProcess()) { - mozilla::dom::ContentChild* cc = mozilla::dom::ContentChild::GetSingleton(); - nsTArray result; - Unused << cc->SendGetOutputColorProfileData(&result); - return result; - } - - if (!mCachedOutputColorProfile.IsEmpty()) { - return nsTArray(mCachedOutputColorProfile); - } - nsAutoCString fname; Preferences::GetCString("gfx.color_management.display_profile", fname); if (fname.IsEmpty()) { - mCachedOutputColorProfile = GetPlatformCMSOutputProfileData(); - return nsTArray(mCachedOutputColorProfile); + return gfxPlatform::GetPlatform()->GetPlatformCMSOutputProfileData(); } void* mem = nullptr; size_t size = 0; qcms_data_from_path(fname.get(), &mem, &size); if (mem == nullptr) { - mCachedOutputColorProfile = GetPlatformCMSOutputProfileData(); - return nsTArray(mCachedOutputColorProfile); + return gfxPlatform::GetPlatform()->GetPlatformCMSOutputProfileData(); } - MOZ_ASSERT(mCachedOutputColorProfile.IsEmpty()); - - mCachedOutputColorProfile.AppendElements(static_cast(mem), size); + nsTArray result; + result.AppendElements(static_cast(mem), size); free(mem); - return nsTArray(mCachedOutputColorProfile); + return result; } void gfxPlatform::CreateCMSOutputProfile() { @@ -2240,8 +2226,7 @@ void gfxPlatform::CreateCMSOutputProfile() { } if (!gCMSOutputProfile) { - nsTArray outputProfileData = - gfxPlatform::GetPlatform()->GetCMSOutputProfileData(); + nsTArray outputProfileData = GetCMSOutputProfileData(); if (!outputProfileData.IsEmpty()) { gCMSOutputProfile = qcms_profile_from_memory( outputProfileData.Elements(), outputProfileData.Length()); @@ -3415,8 +3400,7 @@ void gfxPlatform::GetFrameStats(mozilla::widget::InfoObject& aObj) { } void gfxPlatform::GetCMSSupportInfo(mozilla::widget::InfoObject& aObj) { - nsTArray outputProfileData = - gfxPlatform::GetPlatform()->GetCMSOutputProfileData(); + nsTArray outputProfileData = GetCMSOutputProfileData(); if (outputProfileData.IsEmpty()) { nsPrintfCString msg("Empty profile data"); aObj.DefineProperty("CMSOutputProfile", msg.get()); diff --git a/gfx/thebes/gfxPlatform.h b/gfx/thebes/gfxPlatform.h index 09bfb020522b..20071561bead 100644 --- a/gfx/thebes/gfxPlatform.h +++ b/gfx/thebes/gfxPlatform.h @@ -738,13 +738,6 @@ class gfxPlatform : public mozilla::layers::MemoryPressureListener { */ virtual void ImportGPUDeviceData(const mozilla::gfx::GPUDeviceData& aData); - /** - * Returns the contents of the file containing the output color profile. - * The result may change if gfx.color_management.display_profile is changed - * or the platform-specific default is changed - */ - nsTArray GetCMSOutputProfileData(); - bool HasVariationFontSupport() const { return mHasVariationFontSupport; } bool HasNativeColrFontSupport() const { return mHasNativeColrFontSupport; } @@ -886,6 +879,8 @@ class gfxPlatform : public mozilla::layers::MemoryPressureListener { static void InitOpenGLConfig(); static void CreateCMSOutputProfile(); + static nsTArray GetCMSOutputProfileData(); + friend void RecordingPrefChanged(const char* aPrefName, void* aClosure); virtual nsTArray GetPlatformCMSOutputProfileData(); @@ -953,9 +948,6 @@ class gfxPlatform : public mozilla::layers::MemoryPressureListener { // Total number of screen pixels across all monitors. int64_t mScreenPixels; - // Cached contents of the output color profile file - nsTArray mCachedOutputColorProfile; - // An instance of gfxSkipChars which is empty. It is used as the // basis for error-case iterators. const gfxSkipChars kEmptySkipChars; diff --git a/ipc/ipdl/sync-messages.ini b/ipc/ipdl/sync-messages.ini index 12199aae42b9..bbdc7a73b763 100644 --- a/ipc/ipdl/sync-messages.ini +++ b/ipc/ipdl/sync-messages.ini @@ -1014,9 +1014,7 @@ description = legacy sync IPC - please add detailed description [PContent::EndDriverCrashGuard] description = legacy sync IPC - please add detailed description [PContent::GetGraphicsDeviceInitData] -description = Retrieve information needed to initialize the graphics device in the content process -[PContent::GetOutputColorProfileData] -description = Retrieve the contents of the output color profile file +description = legacy sync IPC - please add detailed description [PContent::GetFontListShmBlock] description = for bug 1514869 - layout code needs synchronous access to font list, but this is used only once per block, after which content directly reads the shared memory [PContent::InitializeFamily]