Bug 1638413 - Allow WebRender compositor to be used without DirectComposition on non-Windows. r=jrmuizel

Differential Revision: https://phabricator.services.mozilla.com/D75638
This commit is contained in:
Andrew Osmond 2020-05-18 17:46:05 +00:00
parent b042e254ba
commit bc973c5022
3 changed files with 21 additions and 1 deletions

View File

@ -59,6 +59,7 @@ void gfxConfigManager::Init() {
DeviceManagerDx::Get()->CheckHardwareStretchingSupport();
mScaledResolution = HasScaledResolution();
mIsWin10OrLater = IsWin10OrLater();
mWrCompositorDCompRequired = true;
#else
mHwStretchingSupport = true;
#endif
@ -327,7 +328,7 @@ void gfxConfigManager::ConfigureWebRender() {
NS_LITERAL_CSTRING("FEATURE_FAILURE_PICTURE_CACHING_DISABLED"));
}
if (!mFeatureWrDComp->IsEnabled()) {
if (!mFeatureWrDComp->IsEnabled() && mWrCompositorDCompRequired) {
mFeatureWrCompositor->ForceDisable(
FeatureStatus::Unavailable, "No DirectComposition usage",
NS_LITERAL_CSTRING("FEATURE_FAILURE_NO_DIRECTCOMPOSITION"));

View File

@ -30,6 +30,7 @@ class gfxConfigManager {
mWrForceAngle(false),
mWrForceAngleNoGPUProcess(false),
mWrDCompWinEnabled(false),
mWrCompositorDCompRequired(false),
mWrPictureCaching(false),
mWrPartialPresent(false),
mGPUProcessAllowSoftware(false),
@ -76,6 +77,7 @@ class gfxConfigManager {
bool mWrForceAngle;
bool mWrForceAngleNoGPUProcess;
bool mWrDCompWinEnabled;
bool mWrCompositorDCompRequired;
bool mWrPictureCaching;
bool mWrPartialPresent;
bool mGPUProcessAllowSoftware;

View File

@ -248,6 +248,7 @@ class GfxConfigManager : public ::testing::Test, public gfxConfigManager {
mWrPartialPresent = true;
mWrForceAngle = true;
mWrDCompWinEnabled = true;
mWrCompositorDCompRequired = true;
mHwStretchingSupport = true;
mIsWin10OrLater = true;
mIsNightly = true;
@ -466,6 +467,22 @@ TEST_F(GfxConfigManager, WebRenderDCompDisabled) {
EXPECT_TRUE(mFeatures.mD3D11HwAngle.IsEnabled());
}
TEST_F(GfxConfigManager, WebRenderDCompNotRequired) {
mWrDCompWinEnabled = false;
mWrCompositorDCompRequired = false;
ConfigureWebRender();
EXPECT_TRUE(mFeatures.mWrQualified.IsEnabled());
EXPECT_TRUE(mFeatures.mWr.IsEnabled());
EXPECT_TRUE(mFeatures.mWrCompositor.IsEnabled());
EXPECT_TRUE(mFeatures.mWrAngle.IsEnabled());
EXPECT_FALSE(mFeatures.mWrDComp.IsEnabled());
EXPECT_TRUE(mFeatures.mWrPartial.IsEnabled());
EXPECT_TRUE(mFeatures.mHwCompositing.IsEnabled());
EXPECT_TRUE(mFeatures.mGPUProcess.IsEnabled());
EXPECT_TRUE(mFeatures.mD3D11HwAngle.IsEnabled());
}
TEST_F(GfxConfigManager, WebRenderForceAngleDisabled) {
mWrForceAngle = false;
ConfigureWebRender();