diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp index e4794f6658cf82e7ec6ed5d68d234eb4e34320d4..7e807c5db9f0462bbc33e4b054dab1c4da2cc90e 100644 --- a/gfx/thebes/gfxWindowsPlatform.cpp +++ b/gfx/thebes/gfxWindowsPlatform.cpp @@ -319,6 +319,7 @@ void gfxWindowsPlatform::InitAcceleration() { DeviceManagerDx::Init(); InitializeConfig(); + InitGPUProcessSupport(); // Ensure devices initialization. SharedSurfaceANGLE and // SharedSurfaceD3D11Interop use them. The devices are lazily initialized // with WebRender to reduce memory usage. @@ -439,6 +440,7 @@ bool gfxWindowsPlatform::HandleDeviceReset() { // XXX Add InitWebRenderConfig() calling. InitializeAdvancedLayersConfig(); if (mInitializedDevices) { + InitGPUProcessSupport(); InitializeDevices(); } UpdateANGLEConfig(); @@ -1428,7 +1430,7 @@ void gfxWindowsPlatform::InitializeDevices() { // initialize any DirectX devices. We do leave them enabled in gfxConfig // though. If the GPU process fails to create these devices it will send // a message back and we'll update their status. - if (InitGPUProcessSupport()) { + if (gfxConfig::IsEnabled(Feature::GPU_PROCESS)) { return; } @@ -1585,11 +1587,11 @@ void gfxWindowsPlatform::InitializeD2D() { d2d1_1.SetSuccessful(); } -bool gfxWindowsPlatform::InitGPUProcessSupport() { +void gfxWindowsPlatform::InitGPUProcessSupport() { FeatureState& gpuProc = gfxConfig::GetFeature(Feature::GPU_PROCESS); if (!gpuProc.IsEnabled()) { - return false; + return; } nsCString message; @@ -1597,14 +1599,14 @@ bool gfxWindowsPlatform::InitGPUProcessSupport() { if (!gfxPlatform::IsGfxInfoStatusOkay(nsIGfxInfo::FEATURE_GPU_PROCESS, &message, failureId)) { gpuProc.Disable(FeatureStatus::Blocklisted, message.get(), failureId); - return false; + return; } if (!gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING)) { // Don't use the GPU process if not using D3D11, unless software // compositor is allowed if (StaticPrefs::layers_gpu_process_allow_software_AtStartup()) { - return gpuProc.IsEnabled(); + return; } gpuProc.Disable(FeatureStatus::Unavailable, "Not using GPU Process since D3D11 is unavailable", @@ -1630,7 +1632,6 @@ bool gfxWindowsPlatform::InitGPUProcessSupport() { } // If we're still enabled at this point, the user set the force-enabled pref. - return gpuProc.IsEnabled(); } bool gfxWindowsPlatform::DwmCompositionEnabled() { diff --git a/gfx/thebes/gfxWindowsPlatform.h b/gfx/thebes/gfxWindowsPlatform.h index 09e55a86b7752c38efd52281ae60723d85dbbfd2..6dff24c8959f5ac4341b9cbd25f145445caf5b6b 100644 --- a/gfx/thebes/gfxWindowsPlatform.h +++ b/gfx/thebes/gfxWindowsPlatform.h @@ -241,7 +241,7 @@ class gfxWindowsPlatform final : public gfxPlatform { void InitializeD3D11(); void InitializeD2D(); bool InitDWriteSupport(); - bool InitGPUProcessSupport(); + void InitGPUProcessSupport(); void DisableD2D(mozilla::gfx::FeatureStatus aStatus, const char* aMessage, const nsACString& aFailureId);