Bug 1512286 - Support an environmental variable to force-disable WebRender. r=kats
☠☠ backed out by 5ae509e2f3b6 ☠ ☠
authorBobby Holley <bobbyholley@gmail.com>
Fri, 07 Dec 2018 11:57:57 +0000
changeset 508812 e1b3f3624b87b0ae2a4719ef9df36c3ffe6aa391
parent 508811 b3f5cca4be44c01024b1ef7b5d4951c7297a112a
child 508813 929fe0acd506fb4fd72db89915dbc49c015a252f
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1512286
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1512286 - Support an environmental variable to force-disable WebRender. r=kats Differential Revision: https://phabricator.services.mozilla.com/D13963
gfx/thebes/gfxPlatform.cpp
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -2552,16 +2552,21 @@ void gfxPlatform::InitCompositorAccelera
          gfxPrefs::WebRenderEnabledDoNotUseDirectly();
 }
 
 /*static*/ bool gfxPlatform::WebRenderEnvvarEnabled() {
   const char* env = PR_GetEnv("MOZ_WEBRENDER");
   return (env && *env == '1');
 }
 
+static bool WebRenderEnvvarDisabled() {
+  const char* env = PR_GetEnv("MOZ_WEBRENDER");
+  return (env && *env == '0');
+}
+
 // If the "gfx.webrender.all.qualified" pref is true we want to enable
 // WebRender for qualifying hardware. The Normandy pref rollout code sets
 // default values on rolled out prefs on every startup, but Gfx starts up
 // before Normandy does. So it's too early to observe the WR qualified pref
 // default value changed by Normandy rollout here yet. So we have a shutdown
 // observer to save the default value on shutdown, and read the saved default
 // value here instead, and emulate the behavior of the pref system, with
 // respect to default/user values of the rollout pref.
@@ -2717,17 +2722,17 @@ void gfxPlatform::InitWebRenderConfig() 
       featureWebRender.ForceDisable(FeatureStatus::Blocked,
                                     "Qualified enable blocked", failureId);
     }
   }
 
   // If the user set the pref to force-disable, let's do that. This will
   // override all the other enabling prefs (gfx.webrender.enabled,
   // gfx.webrender.all, and gfx.webrender.all.qualified).
-  if (gfxPrefs::WebRenderForceDisabled()) {
+  if (gfxPrefs::WebRenderForceDisabled() || WebRenderEnvvarDisabled()) {
     featureWebRender.UserDisable(
         "User force-disabled WR",
         NS_LITERAL_CSTRING("FEATURE_FAILURE_USER_FORCE_DISABLED"));
   }
 
   // HW_COMPOSITING being disabled implies interfacing with the GPU might break
   if (!gfxConfig::IsEnabled(Feature::HW_COMPOSITING)) {
     featureWebRender.ForceDisable(