forked from mirrors/gecko-dev
Bug 1859625 Part 3: Stop sending the GetOutputColorProfileData message. r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D193139
This commit is contained in:
parent
7ae9549693
commit
cb5944eb4c
8 changed files with 37 additions and 53 deletions
|
|
@ -5914,13 +5914,6 @@ mozilla::ipc::IPCResult ContentParent::RecvShutdownPerfStats(
|
|||
return IPC_OK();
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult ContentParent::RecvGetOutputColorProfileData(
|
||||
nsTArray<uint8_t>* aOutputColorProfileData) {
|
||||
(*aOutputColorProfileData) =
|
||||
gfxPlatform::GetPlatform()->GetPlatformCMSOutputProfileData();
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult ContentParent::RecvGetFontListShmBlock(
|
||||
const uint32_t& aGeneration, const uint32_t& aIndex,
|
||||
base::SharedMemoryHandle* aOut) {
|
||||
|
|
|
|||
|
|
@ -1133,9 +1133,6 @@ class ContentParent final : public PContentParent,
|
|||
|
||||
mozilla::ipc::IPCResult RecvShutdownPerfStats(const nsACString& aPerfStats);
|
||||
|
||||
mozilla::ipc::IPCResult RecvGetOutputColorProfileData(
|
||||
nsTArray<uint8_t>* aOutputColorProfileData);
|
||||
|
||||
mozilla::ipc::IPCResult RecvGetFontListShmBlock(
|
||||
const uint32_t& aGeneration, const uint32_t& aIndex,
|
||||
base::SharedMemoryHandle* aOut);
|
||||
|
|
|
|||
|
|
@ -1330,15 +1330,6 @@ parent:
|
|||
*/
|
||||
async ShutdownPerfStats(nsCString aPerfStats);
|
||||
|
||||
/**
|
||||
* 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.
|
||||
|
|
|
|||
|
|
@ -174,6 +174,7 @@ gfxPlatform* gPlatform = nullptr;
|
|||
static bool gEverInitialized = false;
|
||||
|
||||
const ContentDeviceData* gContentDeviceInitData = nullptr;
|
||||
Maybe<nsTArray<uint8_t>> gCMSOutputProfileData;
|
||||
|
||||
Atomic<bool, MemoryOrdering::ReleaseAcquire> gfxPlatform::gCMSInitialized;
|
||||
CMSMode gfxPlatform::gCMSMode = CMSMode::Off;
|
||||
|
|
@ -2060,6 +2061,10 @@ const mozilla::gfx::ContentDeviceData* gfxPlatform::GetInitContentDeviceData() {
|
|||
return gContentDeviceInitData;
|
||||
}
|
||||
|
||||
Maybe<nsTArray<uint8_t>>& gfxPlatform::GetCMSOutputProfileData() {
|
||||
return gCMSOutputProfileData;
|
||||
}
|
||||
|
||||
CMSMode GfxColorManagementMode() {
|
||||
const auto mode = StaticPrefs::gfx_color_management_mode();
|
||||
if (mode >= 0 && mode < UnderlyingValue(CMSMode::AllCount)) {
|
||||
|
|
@ -3888,6 +3893,8 @@ void gfxPlatform::ImportContentDeviceData(
|
|||
const DevicePrefs& prefs = aData.prefs();
|
||||
gfxConfig::Inherit(Feature::HW_COMPOSITING, prefs.hwCompositing());
|
||||
gfxConfig::Inherit(Feature::OPENGL_COMPOSITING, prefs.oglCompositing());
|
||||
|
||||
gCMSOutputProfileData = Some(aData.cmsOutputProfileData().Clone());
|
||||
}
|
||||
|
||||
void gfxPlatform::BuildContentDeviceData(
|
||||
|
|
|
|||
|
|
@ -888,6 +888,13 @@ class gfxPlatform : public mozilla::layers::MemoryPressureListener {
|
|||
*/
|
||||
const mozilla::gfx::ContentDeviceData* GetInitContentDeviceData();
|
||||
|
||||
/**
|
||||
* If inside a child process and have ever received a
|
||||
* SetXPCOMProcessAttributes message, this contains the cmsOutputProfileData
|
||||
* from that message.
|
||||
*/
|
||||
mozilla::Maybe<nsTArray<uint8_t>>& GetCMSOutputProfileData();
|
||||
|
||||
/**
|
||||
* Increase the global device counter after a device has been removed/reset.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -560,23 +560,16 @@ nsTArray<uint8_t> gfxPlatformGtk::GetPlatformCMSOutputProfileData() {
|
|||
}
|
||||
|
||||
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();
|
||||
auto& cmsOutputProfileData = GetCMSOutputProfileData();
|
||||
// We should have set our profile data when we received our initial
|
||||
// ContentDeviceData.
|
||||
MOZ_ASSERT(cmsOutputProfileData.isSome(),
|
||||
"Should have created output profile data when we received "
|
||||
"initial content device data.");
|
||||
if (cmsOutputProfileData.isSome()) {
|
||||
return cmsOutputProfileData.ref().Clone();
|
||||
}
|
||||
|
||||
// Otherwise we need to ask the parent for the updated color profile
|
||||
mozilla::dom::ContentChild* cc = mozilla::dom::ContentChild::GetSingleton();
|
||||
nsTArray<uint8_t> result;
|
||||
Unused << cc->SendGetOutputColorProfileData(&result);
|
||||
return result;
|
||||
return nsTArray<uint8_t>();
|
||||
}
|
||||
|
||||
if (!mIsX11Display) {
|
||||
|
|
|
|||
|
|
@ -986,20 +986,21 @@ void gfxWindowsPlatform::CheckForContentOnlyDeviceReset() {
|
|||
|
||||
nsTArray<uint8_t> gfxWindowsPlatform::GetPlatformCMSOutputProfileData() {
|
||||
if (XRE_IsContentProcess()) {
|
||||
// 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) {
|
||||
MOZ_ASSERT(!contentDeviceData->cmsOutputProfileData().IsEmpty());
|
||||
return contentDeviceData->cmsOutputProfileData().Clone();
|
||||
}
|
||||
auto& cmsOutputProfileData = GetCMSOutputProfileData();
|
||||
// We should have set our profile data when we received our initial
|
||||
// ContentDeviceData.
|
||||
MOZ_ASSERT(cmsOutputProfileData.isSome(),
|
||||
"Should have created output profile data when we received "
|
||||
"initial content device data.");
|
||||
|
||||
// Otherwise we need to ask the parent for the updated color profile
|
||||
mozilla::dom::ContentChild* cc = mozilla::dom::ContentChild::GetSingleton();
|
||||
nsTArray<uint8_t> result;
|
||||
Unused << cc->SendGetOutputColorProfileData(&result);
|
||||
return result;
|
||||
// If we have data, it should not be empty.
|
||||
MOZ_ASSERT_IF(cmsOutputProfileData.isSome(),
|
||||
!cmsOutputProfileData->IsEmpty());
|
||||
|
||||
if (cmsOutputProfileData.isSome()) {
|
||||
return cmsOutputProfileData.ref().Clone();
|
||||
}
|
||||
return nsTArray<uint8_t>();
|
||||
}
|
||||
|
||||
return GetPlatformCMSOutputProfileData_Impl();
|
||||
|
|
@ -1784,9 +1785,6 @@ void gfxWindowsPlatform::ImportContentDeviceData(
|
|||
DeviceManagerDx* dm = DeviceManagerDx::Get();
|
||||
dm->ImportDeviceInfo(aData.d3d11());
|
||||
}
|
||||
|
||||
// aData->cmsOutputProfileData() will be read during color profile init,
|
||||
// not as part of this import function
|
||||
}
|
||||
|
||||
void gfxWindowsPlatform::BuildContentDeviceData(ContentDeviceData* aOut) {
|
||||
|
|
|
|||
|
|
@ -68,8 +68,6 @@ description = legacy sync IPC - please add detailed description
|
|||
description = legacy sync IPC - please add detailed description
|
||||
[PContent::EndDriverCrashGuard]
|
||||
description = legacy sync IPC - please add detailed description
|
||||
[PContent::GetOutputColorProfileData]
|
||||
description = Retrieve the contents of the output color profile file
|
||||
[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]
|
||||
|
|
|
|||
Loading…
Reference in a new issue