Bug 1859625 Part 2: Stop sending the GetGraphicsDeviceInitData message. r=ipc-reviewers,mccr8

Differential Revision: https://phabricator.services.mozilla.com/D192999
This commit is contained in:
Brad Werth 2023-11-27 21:11:10 +00:00
parent 8272a162fb
commit 7ae9549693
9 changed files with 24 additions and 33 deletions

View file

@ -5914,12 +5914,6 @@ mozilla::ipc::IPCResult ContentParent::RecvShutdownPerfStats(
return IPC_OK();
}
mozilla::ipc::IPCResult ContentParent::RecvGetGraphicsDeviceInitData(
ContentDeviceData* aOut) {
gfxPlatform::GetPlatform()->BuildContentDeviceData(aOut);
return IPC_OK();
}
mozilla::ipc::IPCResult ContentParent::RecvGetOutputColorProfileData(
nsTArray<uint8_t>* aOutputColorProfileData) {
(*aOutputColorProfileData) =

View file

@ -1133,9 +1133,6 @@ class ContentParent final : public PContentParent,
mozilla::ipc::IPCResult RecvShutdownPerfStats(const nsACString& aPerfStats);
mozilla::ipc::IPCResult RecvGetGraphicsDeviceInitData(
ContentDeviceData* aOut);
mozilla::ipc::IPCResult RecvGetOutputColorProfileData(
nsTArray<uint8_t>* aOutputColorProfileData);

View file

@ -1330,12 +1330,6 @@ parent:
*/
async ShutdownPerfStats(nsCString aPerfStats);
/**
* Request graphics initialization information from the 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

View file

@ -467,10 +467,10 @@ bool gfxPlatform::Initialized() { return !!gPlatform; }
/* static */
void gfxPlatform::InitChild(const ContentDeviceData& aData) {
MOZ_ASSERT(XRE_IsContentProcess());
MOZ_RELEASE_ASSERT(!gPlatform,
"InitChild() should be called before first GetPlatform()");
MOZ_ASSERT(!gPlatform,
"InitChild() should be called before first GetPlatform()");
// Make the provided initial ContentDeviceData available to the init
// routines, so they don't have to do a sync request from the parent.
// routines.
gContentDeviceInitData = &aData;
Init();
gContentDeviceInitData = nullptr;
@ -3869,20 +3869,16 @@ void gfxPlatform::DisableGPUProcess() {
gfxVars::SetRemoteCanvasEnabled(false);
}
void gfxPlatform::FetchAndImportContentDeviceData() {
void gfxPlatform::ImportCachedContentDeviceData() {
MOZ_ASSERT(XRE_IsContentProcess());
if (gContentDeviceInitData) {
ImportContentDeviceData(*gContentDeviceInitData);
// Import the content device data if we've got some waiting.
if (!gContentDeviceInitData) {
return;
}
mozilla::dom::ContentChild* cc = mozilla::dom::ContentChild::GetSingleton();
mozilla::gfx::ContentDeviceData data;
cc->SendGetGraphicsDeviceInitData(&data);
ImportContentDeviceData(data);
ImportContentDeviceData(*gContentDeviceInitData);
gContentDeviceInitData = nullptr;
}
void gfxPlatform::ImportContentDeviceData(

View file

@ -862,10 +862,10 @@ class gfxPlatform : public mozilla::layers::MemoryPressureListener {
void InitBackendPrefs(BackendPrefsData&& aPrefsData);
/**
* Content-process only. Requests device preferences from the parent process
* and updates any cached settings.
* Content-process only. Updates device preferences from the parent process,
* if we've received any.
*/
void FetchAndImportContentDeviceData();
void ImportCachedContentDeviceData();
virtual void ImportContentDeviceData(
const mozilla::gfx::ContentDeviceData& aData);

View file

@ -144,6 +144,14 @@ gfxPlatformGtk::~gfxPlatformGtk() {
gPlatformFTLibrary = nullptr;
}
void gfxPlatformGtk::InitAcceleration() {
gfxPlatform::InitAcceleration();
if (XRE_IsContentProcess()) {
ImportCachedContentDeviceData();
}
}
void gfxPlatformGtk::InitX11EGLConfig() {
FeatureState& feature = gfxConfig::GetFeature(Feature::X11_EGL);
#ifdef MOZ_X11

View file

@ -65,6 +65,7 @@ class gfxPlatformGtk final : public gfxPlatform {
static bool CheckVariationFontSupport();
protected:
void InitAcceleration() override;
void InitX11EGLConfig();
void InitDmabufConfig();
bool InitVAAPIConfig(bool aForceEnabledByUser);

View file

@ -373,6 +373,9 @@ void gfxWindowsPlatform::InitAcceleration() {
DeviceManagerDx::Init();
// Content processes should have received content device data from parent.
MOZ_ASSERT_IF(XRE_IsContentProcess(), GetInitContentDeviceData());
InitializeConfig();
InitGPUProcessSupport();
// Ensure devices initialization. SharedSurfaceANGLE and
@ -1198,7 +1201,7 @@ void gfxWindowsPlatform::InitializeConfig() {
InitializeANGLEConfig();
InitializeD2DConfig();
} else {
FetchAndImportContentDeviceData();
ImportCachedContentDeviceData();
InitializeANGLEConfig();
}
}

View file

@ -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::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
[PContent::GetFontListShmBlock]