From 343b5d015621db9d0a70863c8ef191b339434163 Mon Sep 17 00:00:00 2001 From: Andreea Pavel Date: Fri, 17 Apr 2020 02:39:26 +0300 Subject: [PATCH] Backed out changeset 923c7f562468 (bug 1630629) because phabricator version is not the same as one on try on a CLOSED TREE --- gfx/thebes/gfxPlatform.cpp | 72 ++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 42 deletions(-) diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index 45c9b05ff6ab..b3854369693b 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -2886,19 +2886,6 @@ static FeatureState& WebRenderHardwareQualificationStatus( break; } - nsAutoString adapterDeviceID; - gfxInfo->GetAdapterDeviceID(adapterDeviceID); - - if (adapterVendorID == u"0x8086") { - bool hasBattery = false; - gfxInfo->GetHasBattery(&hasBattery); - if (hasBattery && !gfxConfig::IsEnabled(Feature::WEBRENDER_COMPOSITOR)) { - featureWebRenderQualified.Disable(FeatureStatus::Blocked, - "Battery Intel requires os compositor", - NS_LITERAL_CSTRING("INTEL_BATTERY_REQUIRES_DCOMP")); - } - } - return featureWebRenderQualified; } @@ -2925,35 +2912,6 @@ void gfxPlatform::InitWebRenderConfig() { return; } - // Initialize WebRender native compositor usage - FeatureState& featureComp = - gfxConfig::GetFeature(Feature::WEBRENDER_COMPOSITOR); - featureComp.SetDefaultFromPref("gfx.webrender.compositor", true, false); - - if (StaticPrefs::gfx_webrender_compositor_force_enabled_AtStartup()) { - featureComp.UserForceEnable("Force enabled by pref"); - } - - ApplyGfxInfoFeature(nsIGfxInfo::FEATURE_WEBRENDER_COMPOSITOR, featureComp); - -#ifdef XP_WIN - if (!gfxVars::UseWebRenderDCompWin()) { - featureComp.Disable( - FeatureStatus::Unavailable, "No DirectComposition usage", - NS_LITERAL_CSTRING("FEATURE_FAILURE_NO_DIRECTCOMPOSITION")); - } - - // Disable native compositor when hardware stretching is not supported. It is - // for avoiding a problem like Bug 1618370. - // XXX Is there a better check for Bug 1618370? - if (!DeviceManagerDx::Get()->CheckHardwareStretchingSupport() && - HasScaledResolution()) { - featureComp.Disable( - FeatureStatus::Unavailable, "No hardware stretching support", - NS_LITERAL_CSTRING("FEATURE_FAILURE_NO_HARDWARE_STRETCHING")); - } -#endif - bool guardedByQualifiedPref = true; FeatureState& featureWebRenderQualified = WebRenderHardwareQualificationStatus(&guardedByQualifiedPref); @@ -3106,6 +3064,36 @@ void gfxPlatform::InitWebRenderConfig() { gfxVars::SetUseWebRenderTripleBufferingWin(true); } } +#endif + + // Initialize WebRender native compositor usage + FeatureState& featureComp = + gfxConfig::GetFeature(Feature::WEBRENDER_COMPOSITOR); + featureComp.SetDefaultFromPref("gfx.webrender.compositor", true, false); + + if (StaticPrefs::gfx_webrender_compositor_force_enabled_AtStartup()) { + featureComp.UserForceEnable("Force enabled by pref"); + } + + ApplyGfxInfoFeature(nsIGfxInfo::FEATURE_WEBRENDER_COMPOSITOR, featureComp); + +#ifdef XP_WIN + if (!gfxVars::UseWebRenderDCompWin()) { + featureComp.Disable( + FeatureStatus::Unavailable, "No DirectComposition usage", + NS_LITERAL_CSTRING("FEATURE_FAILURE_NO_DIRECTCOMPOSITION")); + } + + // Disable native compositor when hardware stretching is not supported. It is + // for avoiding a problem like Bug 1618370. + // XXX Is there a better check for Bug 1618370? + if (!DeviceManagerDx::Get()->CheckHardwareStretchingSupport() && + HasScaledResolution()) { + featureComp.Disable( + FeatureStatus::Unavailable, "No hardware stretching support", + NS_LITERAL_CSTRING("FEATURE_FAILURE_NO_HARDWARE_STRETCHING")); + } + #endif if (!StaticPrefs::gfx_webrender_picture_caching()) {