Bug 1342488 - Allow enabling webrender with an environment variable. r=rhunt draft
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 12 May 2017 15:28:17 -0400
changeset 577068 89de1cb9f1128dab09eed2e71b0a177f63f4ff64
parent 576947 1ec1d88637208098802e57d13db9033902e5a229
child 577069 b4e4a47a95998348b4b499e0aa4ede3ef9159b28
push id58591
push userkgupta@mozilla.com
push dateFri, 12 May 2017 19:28:39 +0000
reviewersrhunt
bugs1342488
milestone55.0a1
Bug 1342488 - Allow enabling webrender with an environment variable. r=rhunt This simplifies plumbing it through mozharness for automated testing, because mozharness doesn't already have the ability to set prefs for all the different kinds of test suites. It can set environment variables though. MozReview-Commit-ID: BdsH09WTqO4
gfx/thebes/gfxPlatform.cpp
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -2335,16 +2335,21 @@ gfxPlatform::InitWebRenderConfig()
 
   featureWebRender.DisableByDefault(
       FeatureStatus::OptIn,
       "WebRender is an opt-in feature",
       NS_LITERAL_CSTRING("FEATURE_FAILURE_DEFAULT_OFF"));
 
   if (prefEnabled) {
     featureWebRender.UserEnable("Enabled by pref");
+  } else {
+    const char* env = PR_GetEnv("MOZ_WEBRENDER");
+    if (env && *env == '1') {
+      featureWebRender.UserEnable("Enabled by envvar");
+    }
   }
 
   // WebRender relies on the GPU process when on Windows
 #ifdef XP_WIN
   if (!gfxConfig::IsEnabled(Feature::GPU_PROCESS)) {
     featureWebRender.ForceDisable(
       FeatureStatus::Unavailable,
       "GPU Process is disabled",