Bug 1377950 - Stub in a function for resetting all compositors with GPUProcessManager. r?jrmuizel draft
authorRyan Hunt <rhunt@eqrion.net>
Fri, 11 Aug 2017 02:51:23 -0500
changeset 644970 4aa7fb7dc327a77b0b5dac8233ead14c203058bc
parent 642518 a921bfb8a2cf3db4d9edebe9b35799a3f9d035da
child 644971 26773c7bff701449cb8c34effeb85d6be135b042
push id73606
push userbmo:rhunt@eqrion.net
push dateFri, 11 Aug 2017 16:18:19 +0000
reviewersjrmuizel
bugs1377950
milestone57.0a1
Bug 1377950 - Stub in a function for resetting all compositors with GPUProcessManager. r?jrmuizel MozReview-Commit-ID: HsKCGli3TOM
gfx/ipc/GPUProcessManager.cpp
gfx/ipc/GPUProcessManager.h
--- a/gfx/ipc/GPUProcessManager.cpp
+++ b/gfx/ipc/GPUProcessManager.cpp
@@ -403,16 +403,25 @@ ShouldLimitDeviceResets(uint32_t count, 
   } else if (hasCountLimit) {
     return triggeredCount;
   }
 
   return false;
 }
 
 void
+GPUProcessManager::ResetCompositors()
+{
+  // Note: this will recreate devices in addition to recreating compositors.
+  // This isn't optimal, but this is only used on linux where acceleration
+  // isn't enabled by default, and this way we don't need a new code path.
+  SimulateDeviceReset();
+}
+
+void
 GPUProcessManager::SimulateDeviceReset()
 {
   // Make sure we rebuild environment and configuration for accelerated features.
   gfxPlatform::GetPlatform()->CompositorUpdated();
 
   if (mProcess) {
     OnRemoteProcessDeviceReset(mProcess);
   } else {
--- a/gfx/ipc/GPUProcessManager.h
+++ b/gfx/ipc/GPUProcessManager.h
@@ -138,16 +138,19 @@ public:
   //
   // Note that a layer tree id is always allocated, even if this returns false.
   bool AllocateAndConnectLayerTreeId(
     PCompositorBridgeChild* aCompositorBridge,
     base::ProcessId aOtherPid,
     uint64_t* aOutLayersId,
     CompositorOptions* aOutCompositorOptions);
 
+  // Destroy and recreate all of the compositors
+  void ResetCompositors();
+
   void OnProcessLaunchComplete(GPUProcessHost* aHost) override;
   void OnProcessUnexpectedShutdown(GPUProcessHost* aHost) override;
   void SimulateDeviceReset();
   void DisableWebRender();
   void OnInProcessDeviceReset();
   void OnRemoteProcessDeviceReset(GPUProcessHost* aHost) override;
   void NotifyListenersOnCompositeDeviceReset();