Disable the GPU process when LayerScope is enabled. (bug 1316429, r=milan)
authorDavid Anderson <danderson@mozilla.com>
Thu, 10 Nov 2016 10:55:32 -0800
changeset 348761 d44dd677f3694ced59a7382fc3635eb768f95e3a
parent 348760 ff60dd49591d9b7949799628d259b4474ee97549
child 348762 ab22fdf8dad77191d439b827b87bb2e16ae815a3
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmilan
bugs1316429
milestone52.0a1
Disable the GPU process when LayerScope is enabled. (bug 1316429, r=milan)
gfx/layers/LayerScope.cpp
gfx/thebes/gfxPlatform.cpp
--- a/gfx/layers/LayerScope.cpp
+++ b/gfx/layers/LayerScope.cpp
@@ -1624,17 +1624,17 @@ NS_IMETHODIMP LayerScopeWebSocketManager
 
 // ----------------------------------------------
 // LayerScope implementation
 // ----------------------------------------------
 /*static*/
 void
 LayerScope::Init()
 {
-    if (!gfxPrefs::LayerScopeEnabled()) {
+    if (!gfxPrefs::LayerScopeEnabled() || XRE_IsGPUProcess()) {
         return;
     }
 
     gLayerScopeManager.CreateServerSocket();
 }
 
 /*static*/
 void
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -2195,16 +2195,23 @@ gfxPlatform::InitGPUProcessPrefs()
   }
   if (InSafeMode()) {
     gpuProc.ForceDisable(
       FeatureStatus::Blocked,
       "Safe-mode is enabled",
       NS_LITERAL_CSTRING("FEATURE_FAILURE_SAFE_MODE"));
     return;
   }
+  if (gfxPrefs::LayerScopeEnabled()) {
+    gpuProc.ForceDisable(
+      FeatureStatus::Blocked,
+      "LayerScope does not work in the GPU process",
+      NS_LITERAL_CSTRING("FEATURE_FAILURE_LAYERSCOPE"));
+    return;
+  }
 }
 
 void
 gfxPlatform::InitCompositorAccelerationPrefs()
 {
   const char *acceleratedEnv = PR_GetEnv("MOZ_ACCELERATED");
 
   FeatureState& feature = gfxConfig::GetFeature(Feature::HW_COMPOSITING);