Bug 1645223 - Disable WebRender if XRender is enabled. r=aosmond

Differential Revision: https://phabricator.services.mozilla.com/D83655
This commit is contained in:
Nicolas Silva 2020-07-16 12:08:22 +00:00
parent 4e0216d1bd
commit e503589521
3 changed files with 26 additions and 0 deletions

View File

@ -66,6 +66,7 @@ void gfxConfigManager::Init() {
#ifdef MOZ_WIDGET_GTK
mDisableHwCompositingNoWr = true;
mXRenderEnabled = mozilla::Preferences::GetBool("gfx.xrender.enabled");
#endif
#ifdef NIGHTLY_BUILD
@ -267,6 +268,13 @@ void gfxConfigManager::ConfigureWebRender() {
"FEATURE_FAILURE_SAFE_MODE"_ns);
}
if (mXRenderEnabled) {
// XRender and WebRender don't play well together. XRender is disabled by
// default. If the user opts into it don't enable webrender.
mFeatureWr->ForceDisable(FeatureStatus::Blocked,"XRender is enabled",
"FEATURE_FAILURE_XRENDER"_ns);
}
mFeatureWrAngle->DisableByDefault(FeatureStatus::OptIn,
"WebRender ANGLE is an opt-in feature",
"FEATURE_FAILURE_DEFAULT_OFF"_ns);

View File

@ -34,6 +34,7 @@ class gfxConfigManager {
mWrPictureCaching(false),
mWrPartialPresent(false),
mGPUProcessAllowSoftware(false),
mXRenderEnabled(false),
mWrEnvForceEnabled(false),
mWrEnvForceDisabled(false),
mHwStretchingSupport(false),
@ -81,6 +82,7 @@ class gfxConfigManager {
bool mWrPictureCaching;
bool mWrPartialPresent;
bool mGPUProcessAllowSoftware;
bool mXRenderEnabled;
/**
* Environment variables

View File

@ -696,3 +696,19 @@ TEST_F(GfxConfigManager, WebRenderAtRefreshRateThreshold) {
EXPECT_TRUE(mFeatures.mGPUProcess.IsEnabled());
EXPECT_TRUE(mFeatures.mD3D11HwAngle.IsEnabled());
}
TEST_F(GfxConfigManager, WebRenderWhenXRenderEnabled) {
mXRenderEnabled = true;
ConfigureWebRender();
EXPECT_TRUE(mFeatures.mWrQualified.IsEnabled());
EXPECT_FALSE(mFeatures.mWr.IsEnabled());
EXPECT_FALSE(mFeatures.mWrCompositor.IsEnabled());
EXPECT_FALSE(mFeatures.mWrAngle.IsEnabled());
EXPECT_FALSE(mFeatures.mWrDComp.IsEnabled());
EXPECT_FALSE(mFeatures.mWrPartial.IsEnabled());
EXPECT_TRUE(mFeatures.mHwCompositing.IsEnabled());
EXPECT_TRUE(mFeatures.mGPUProcess.IsEnabled());
EXPECT_TRUE(mFeatures.mD3D11HwAngle.IsEnabled());
}