Bug 1603676 - Move picture caching check for WR compositor to Feature::WEBRENDER_COMPOSITOR check r=gw
authorsotaro <sotaro.ikeda.g@gmail.com>
Mon, 16 Dec 2019 03:50:31 +0000
changeset 507041 0016ade97e65a470bc97521ab8338210e74cdd02
parent 507040 b85d5793f58d9d0b45bbbfe67b89708701e1404a
child 507042 f7f5cecc40ddcf4321c71f852258bd0763d586aa
push id36921
push usernerli@mozilla.com
push dateMon, 16 Dec 2019 09:50:52 +0000
treeherdermozilla-central@0016ade97e65 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgw
bugs1603676
milestone73.0a1
first release with
nightly linux32
0016ade97e65 / 73.0a1 / 20191216095052 / files
nightly linux64
0016ade97e65 / 73.0a1 / 20191216095052 / files
nightly mac
0016ade97e65 / 73.0a1 / 20191216095052 / files
nightly win32
0016ade97e65 / 73.0a1 / 20191216095052 / files
nightly win64
0016ade97e65 / 73.0a1 / 20191216095052 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1603676 - Move picture caching check for WR compositor to Feature::WEBRENDER_COMPOSITOR check r=gw about:support could have an information that WR compositor is disabled by disabling picture caching. Differential Revision: https://phabricator.services.mozilla.com/D57266
gfx/thebes/gfxPlatform.cpp
gfx/webrender_bindings/RenderCompositorANGLE.cpp
gfx/webrender_bindings/RenderCompositorOGL.cpp
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -3306,26 +3306,32 @@ void gfxPlatform::InitWebRenderConfig() 
     }
   }
 #endif
 
   // Initialize WebRender native compositor usage
   FeatureState& featureComp =
       gfxConfig::GetFeature(Feature::WEBRENDER_COMPOSITOR);
   featureComp.SetDefaultFromPref("gfx.webrender.compositor", true, false);
+  if (!StaticPrefs::gfx_webrender_picture_caching()) {
+    featureComp.ForceDisable(
+        FeatureStatus::Unavailable, "Picture caching is disabled",
+        NS_LITERAL_CSTRING("FEATURE_FAILURE_PICTURE_CACHING_DISABLED"));
+  }
+
   if (!IsFeatureSupported(nsIGfxInfo::FEATURE_WEBRENDER_COMPOSITOR, false)) {
     featureComp.ForceDisable(FeatureStatus::Blacklisted, "Blacklisted",
                              NS_LITERAL_CSTRING("FEATURE_FAILURE_BLACKLIST"));
   }
 
 #ifdef XP_WIN
   if (!gfxVars::UseWebRenderDCompWin()) {
-    featureComp.ForceDisable(FeatureStatus::Unavailable,
-                             "No DirectComposition usage",
-                             NS_LITERAL_CSTRING("FEATURE_FAILURE_BLACKLIST"));
+    featureComp.ForceDisable(
+        FeatureStatus::Unavailable, "No DirectComposition usage",
+        NS_LITERAL_CSTRING("FEATURE_FAILURE_NO_DIRECTCOMPOSITION"));
   }
 #endif
 
   if (gfx::gfxConfig::IsEnabled(gfx::Feature::WEBRENDER_COMPOSITOR)) {
     gfxVars::SetUseWebRenderCompositor(true);
     // Call UserEnable() only for reporting to Decision Log.
     // If feature is enabled by default. It is not reported to Decision Log.
     featureComp.UserEnable("Enabled");
--- a/gfx/webrender_bindings/RenderCompositorANGLE.cpp
+++ b/gfx/webrender_bindings/RenderCompositorANGLE.cpp
@@ -719,18 +719,17 @@ bool RenderCompositorANGLE::IsContextLos
   // Then this function just uses GetDeviceRemovedReason().
   if (mDevice->GetDeviceRemovedReason() != S_OK) {
     return true;
   }
   return false;
 }
 
 bool RenderCompositorANGLE::UseCompositor() {
-  if (!mDCLayerTree || !gfx::gfxVars::UseWebRenderCompositor() ||
-      !StaticPrefs::gfx_webrender_picture_caching()) {
+  if (!mDCLayerTree || !gfx::gfxVars::UseWebRenderCompositor()) {
     return false;
   }
   return true;
 }
 
 bool RenderCompositorANGLE::ShouldUseNativeCompositor() {
   return UseCompositor();
 }
--- a/gfx/webrender_bindings/RenderCompositorOGL.cpp
+++ b/gfx/webrender_bindings/RenderCompositorOGL.cpp
@@ -148,18 +148,17 @@ void RenderCompositorOGL::Pause() {}
 
 bool RenderCompositorOGL::Resume() { return true; }
 
 LayoutDeviceIntSize RenderCompositorOGL::GetBufferSize() {
   return mWidget->GetClientSize();
 }
 
 bool RenderCompositorOGL::ShouldUseNativeCompositor() {
-  return mNativeLayerRoot && gfx::gfxVars::UseWebRenderCompositor() &&
-         StaticPrefs::gfx_webrender_picture_caching();
+  return mNativeLayerRoot && gfx::gfxVars::UseWebRenderCompositor();
 }
 
 uint32_t RenderCompositorOGL::GetMaxUpdateRects() {
   if (ShouldUseNativeCompositor() &&
       StaticPrefs::gfx_webrender_compositor_max_update_rects_AtStartup() > 0) {
     return 1;
   }
   return 0;