mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
Bug 1337487 - Disable WebRender on windows when the GPU process is disabled r=kats
--HG-- extra : amend_source : 0203452b319c21331f1f0ebcd74e3f843b7785e1
This commit is contained in:
parent
61bc491994
commit
b782e91daf
@ -25,6 +25,7 @@ namespace gfx {
|
|||||||
_(D3D11_HW_ANGLE, Feature, "Direct3D11 hardware ANGLE") \
|
_(D3D11_HW_ANGLE, Feature, "Direct3D11 hardware ANGLE") \
|
||||||
_(DIRECT_DRAW, Feature, "DirectDraw") \
|
_(DIRECT_DRAW, Feature, "DirectDraw") \
|
||||||
_(GPU_PROCESS, Feature, "GPU Process") \
|
_(GPU_PROCESS, Feature, "GPU Process") \
|
||||||
|
_(WEBRENDER, Feature, "WebRender") \
|
||||||
/* Add new entries above this comment */
|
/* Add new entries above this comment */
|
||||||
|
|
||||||
enum class Feature : uint32_t {
|
enum class Feature : uint32_t {
|
||||||
|
@ -154,6 +154,8 @@ GPUProcessManager::DisableGPUProcess(const char* aMessage)
|
|||||||
gfxConfig::SetFailed(Feature::GPU_PROCESS, FeatureStatus::Failed, aMessage);
|
gfxConfig::SetFailed(Feature::GPU_PROCESS, FeatureStatus::Failed, aMessage);
|
||||||
gfxCriticalNote << aMessage;
|
gfxCriticalNote << aMessage;
|
||||||
|
|
||||||
|
gfxPlatform::NotifyGPUProcessDisabled();
|
||||||
|
|
||||||
DestroyProcess();
|
DestroyProcess();
|
||||||
ShutdownVsyncIOThread();
|
ShutdownVsyncIOThread();
|
||||||
}
|
}
|
||||||
|
@ -689,18 +689,6 @@ gfxPlatform::Init()
|
|||||||
#endif
|
#endif
|
||||||
gPlatform->InitAcceleration();
|
gPlatform->InitAcceleration();
|
||||||
|
|
||||||
#ifdef MOZ_ENABLE_WEBRENDER
|
|
||||||
if (XRE_IsParentProcess()) {
|
|
||||||
// XXX: right now this is just based on the pref. But we may want to
|
|
||||||
// do other runtime detection of hardware support etc.
|
|
||||||
// This pref defaults to true, so builds with --enable-webrender have it
|
|
||||||
// turned on by default, but can have it disabled via pref. The ifdef
|
|
||||||
// guards this entire block, so builds without --enable-webrender will
|
|
||||||
// always have the gfxVar default to false.
|
|
||||||
gfxVars::SetUseWebRender(Preferences::GetBool("gfx.webrender.enabled", true));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (gfxConfig::IsEnabled(Feature::GPU_PROCESS)) {
|
if (gfxConfig::IsEnabled(Feature::GPU_PROCESS)) {
|
||||||
GPUProcessManager* gpu = GPUProcessManager::Get();
|
GPUProcessManager* gpu = GPUProcessManager::Get();
|
||||||
gpu->LaunchGPUProcess();
|
gpu->LaunchGPUProcess();
|
||||||
@ -2225,6 +2213,7 @@ gfxPlatform::InitAcceleration()
|
|||||||
nullptr,
|
nullptr,
|
||||||
Preferences::ExactMatch);
|
Preferences::ExactMatch);
|
||||||
InitGPUProcessPrefs();
|
InitGPUProcessPrefs();
|
||||||
|
InitWebRenderConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2311,6 +2300,47 @@ gfxPlatform::InitCompositorAccelerationPrefs()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gfxPlatform::InitWebRenderConfig()
|
||||||
|
{
|
||||||
|
FeatureState& featureWebRender = gfxConfig::GetFeature(Feature::WEBRENDER);
|
||||||
|
|
||||||
|
featureWebRender.EnableByDefault();
|
||||||
|
|
||||||
|
if (!Preferences::GetBool("gfx.webrender.enabled", false)) {
|
||||||
|
featureWebRender.UserDisable(
|
||||||
|
"User disabled WebRender",
|
||||||
|
NS_LITERAL_CSTRING("FEATURE_FAILURE_WEBRENDER_DISABLED"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// WebRender relies on the GPU process when on Windows
|
||||||
|
#ifdef XP_WIN
|
||||||
|
if (!gfxConfig::IsEnabled(Feature::GPU_PROCESS)) {
|
||||||
|
featureWebRender.ForceDisable(
|
||||||
|
FeatureStatus::Unavailable,
|
||||||
|
"GPU Process is disabled",
|
||||||
|
NS_LITERAL_CSTRING("FEATURE_FAILURE_GPU_PROCESS_DISABLED"));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (InSafeMode()) {
|
||||||
|
featureWebRender.ForceDisable(
|
||||||
|
FeatureStatus::Unavailable,
|
||||||
|
"Safe-mode is enabled",
|
||||||
|
NS_LITERAL_CSTRING("FEATURE_FAILURE_SAFE_MODE"));
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef MOZ_ENABLE_WEBRENDER
|
||||||
|
featureWebRender.ForceDisable(
|
||||||
|
FeatureStatus::Unavailable,
|
||||||
|
"Build doesn't include WebRender",
|
||||||
|
NS_LITERAL_CSTRING("FEATURE_FAILURE_NO_WEBRENDER"));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// gfxFeature is not usable in the GPU process, so we use gfxVars to transmit this feature
|
||||||
|
gfxVars::SetUseWebRender(gfxConfig::IsEnabled(Feature::WEBRENDER));
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
gfxPlatform::CanUseHardwareVideoDecoding()
|
gfxPlatform::CanUseHardwareVideoDecoding()
|
||||||
{
|
{
|
||||||
@ -2561,6 +2591,18 @@ gfxPlatform::NotifyCompositorCreated(LayersBackend aBackend)
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* static */ void
|
||||||
|
gfxPlatform::NotifyGPUProcessDisabled()
|
||||||
|
{
|
||||||
|
if (gfxConfig::IsEnabled(Feature::WEBRENDER)) {
|
||||||
|
gfxConfig::GetFeature(Feature::WEBRENDER).ForceDisable(
|
||||||
|
FeatureStatus::Unavailable,
|
||||||
|
"GPU Process is disabled",
|
||||||
|
NS_LITERAL_CSTRING("FEATURE_FAILURE_GPU_PROCESS_DISABLED"));
|
||||||
|
gfxVars::SetUseWebRender(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gfxPlatform::FetchAndImportContentDeviceData()
|
gfxPlatform::FetchAndImportContentDeviceData()
|
||||||
{
|
{
|
||||||
|
@ -652,6 +652,8 @@ public:
|
|||||||
*/
|
*/
|
||||||
static bool PerfWarnings();
|
static bool PerfWarnings();
|
||||||
|
|
||||||
|
static void NotifyGPUProcessDisabled();
|
||||||
|
|
||||||
void NotifyCompositorCreated(mozilla::layers::LayersBackend aBackend);
|
void NotifyCompositorCreated(mozilla::layers::LayersBackend aBackend);
|
||||||
mozilla::layers::LayersBackend GetCompositorBackend() const {
|
mozilla::layers::LayersBackend GetCompositorBackend() const {
|
||||||
return mCompositorBackend;
|
return mCompositorBackend;
|
||||||
@ -820,6 +822,7 @@ private:
|
|||||||
|
|
||||||
void InitCompositorAccelerationPrefs();
|
void InitCompositorAccelerationPrefs();
|
||||||
void InitGPUProcessPrefs();
|
void InitGPUProcessPrefs();
|
||||||
|
void InitWebRenderConfig();
|
||||||
|
|
||||||
static bool IsDXInterop2Blocked();
|
static bool IsDXInterop2Blocked();
|
||||||
|
|
||||||
|
@ -810,9 +810,7 @@ pref("gfx.logging.peak-texture-usage.enabled", false);
|
|||||||
|
|
||||||
pref("gfx.ycbcr.accurate-conversion", false);
|
pref("gfx.ycbcr.accurate-conversion", false);
|
||||||
|
|
||||||
#ifdef MOZ_ENABLE_WEBRENDER
|
|
||||||
pref("gfx.webrender.enabled", true);
|
pref("gfx.webrender.enabled", true);
|
||||||
#endif
|
|
||||||
|
|
||||||
pref("accessibility.browsewithcaret", false);
|
pref("accessibility.browsewithcaret", false);
|
||||||
pref("accessibility.warn_on_browsewithcaret", true);
|
pref("accessibility.warn_on_browsewithcaret", true);
|
||||||
|
Loading…
Reference in New Issue
Block a user