Bug 1494528 - Call GPUProcessManager::EnsureGPUReady() before accessing gfxVars::UseWebRender() r=aosmond
authorsotaro <sotaro.ikeda.g@gmail.com>
Fri, 28 Sep 2018 09:06:26 +0900
changeset 438639 a94730ef300e11980098601d90b0f86d4ef87423
parent 438638 b1e0b485298554d1f00fa3fced60941b4de180f4
child 438640 f2b2b043c04620257c8e64a1c722b6838331d143
push id34730
push useraciure@mozilla.com
push dateFri, 28 Sep 2018 08:54:16 +0000
treeherdermozilla-central@20d42e205b19 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaosmond
bugs1494528
milestone64.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 1494528 - Call GPUProcessManager::EnsureGPUReady() before accessing gfxVars::UseWebRender() r=aosmond
widget/nsBaseWidget.cpp
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -1308,16 +1308,22 @@ nsBaseWidget::CreateCompositorSession(in
                                       int aHeight,
                                       CompositorOptions* aOptionsOut)
 {
   MOZ_ASSERT(aOptionsOut);
 
   do {
     CreateCompositorVsyncDispatcher();
 
+    gfx::GPUProcessManager* gpu = gfx::GPUProcessManager::Get();
+    // Make sure GPU process is ready for use.
+    // If it failed to connect to GPU process, GPU process usage is disabled in EnsureGPUReady().
+    // It could update gfxVars and gfxConfigs.
+    gpu->EnsureGPUReady();
+
     // If widget type does not supports acceleration, we use ClientLayerManager
     // even when gfxVars::UseWebRender() is true. WebRender could coexist only
     // with BasicCompositor.
     bool enableWR = gfx::gfxVars::UseWebRender() && WidgetTypeSupportsAcceleration()
       && AllowWebRenderForThisWindow();
     bool enableAPZ = UseAPZ();
     CompositorOptions options(enableAPZ, enableWR);
 
@@ -1333,17 +1339,16 @@ nsBaseWidget::CreateCompositorSession(in
     RefPtr<LayerManager> lm;
     if (options.UseWebRender()) {
       lm = new WebRenderLayerManager(this);
     } else {
       lm = new ClientLayerManager(this);
     }
 
     bool retry = false;
-    gfx::GPUProcessManager* gpu = gfx::GPUProcessManager::Get();
     mCompositorSession = gpu->CreateTopLevelCompositor(
       this,
       lm,
       GetDefaultScale(),
       options,
       UseExternalCompositingSurface(),
       gfx::IntSize(aWidth, aHeight),
       &retry);