Bug 1512286 - Support an environmental variable to force-disable WebRender. r=kats
authorBobby Holley <bobbyholley@gmail.com>
Thu, 06 Dec 2018 14:01:01 -0500
changeset 508851 47035a39723978394f8df24652bb198eed362540
parent 508850 bc83a2fe5c178f5f555b5ff4566b387a028eccdc
child 508852 4d90a83e78cfe23df49e4f64ae754a513057a8a8
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(