From 5a87aaf54ec4a06a5f80a19f5b9e13ce88a82b82 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 23 May 2016 00:28:03 -0700 Subject: [PATCH] Remove TabParent use of CompositorBridgeParent. (bug 1274149 part 4, r=mattwoodrow) --- dom/ipc/TabParent.cpp | 11 ++++++----- gfx/ipc/GPUProcessManager.cpp | 18 ++++++++++++++++++ gfx/ipc/GPUProcessManager.h | 6 ++++++ gfx/layers/ipc/CompositorBridgeParent.h | 8 ++++---- 4 files changed, 34 insertions(+), 9 deletions(-) diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index cded19c780ca..879a4e23d4e0 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -25,12 +25,12 @@ #include "mozilla/EventStateManager.h" #include "mozilla/gfx/2D.h" #include "mozilla/gfx/DataSurfaceHelpers.h" +#include "mozilla/gfx/GPUProcessManager.h" #include "mozilla/Hal.h" #include "mozilla/IMEStateManager.h" #include "mozilla/ipc/DocumentRendererParent.h" #include "mozilla/jsipc/CrossProcessObjectWrappers.h" #include "mozilla/layers/AsyncDragMetrics.h" -#include "mozilla/layers/CompositorBridgeParent.h" #include "mozilla/layers/InputAPZContext.h" #include "mozilla/layout/RenderFrameParent.h" #include "mozilla/LookAndFeel.h" @@ -105,6 +105,7 @@ using namespace mozilla::layout; using namespace mozilla::services; using namespace mozilla::widget; using namespace mozilla::jsipc; +using namespace mozilla::gfx; // The flags passed by the webProgress notifications are 16 bits shifted // from the ones registered by webProgressListeners. @@ -2978,7 +2979,7 @@ TabParent::RequestNotifyLayerTreeReady() if (!frame || !frame->IsInitted()) { mNeedLayerTreeReadyNotification = true; } else { - CompositorBridgeParent::RequestNotifyLayerTreeReady( + GPUProcessManager::Get()->RequestNotifyLayerTreeReady( frame->GetLayersId(), mLayerUpdateObserver); } @@ -2993,7 +2994,7 @@ TabParent::RequestNotifyLayerTreeCleared() return false; } - CompositorBridgeParent::RequestNotifyLayerTreeCleared( + GPUProcessManager::Get()->RequestNotifyLayerTreeCleared( frame->GetLayersId(), mLayerUpdateObserver); return true; @@ -3034,10 +3035,10 @@ TabParent::SwapLayerTreeObservers(TabParent* aOther) return; } - // The swap that happens for the observers in CompositorBridgeParent has to + // The swap that happens for the observers in GPUProcessManager has to // happen in a lock so that an update being processed on the compositor thread // can't grab the layer update observer for the wrong tab parent. - CompositorBridgeParent::SwapLayerTreeObservers( + GPUProcessManager::Get()->SwapLayerTreeObservers( rfp->GetLayersId(), otherRfp->GetLayersId()); diff --git a/gfx/ipc/GPUProcessManager.cpp b/gfx/ipc/GPUProcessManager.cpp index 0e1d474d66eb..50db8a4b9389 100644 --- a/gfx/ipc/GPUProcessManager.cpp +++ b/gfx/ipc/GPUProcessManager.cpp @@ -78,5 +78,23 @@ GPUProcessManager::DeallocateLayerTreeId(uint64_t aLayersId) CompositorBridgeParent::DeallocateLayerTreeId(aLayersId); } +void +GPUProcessManager::RequestNotifyLayerTreeReady(uint64_t aLayersId, CompositorUpdateObserver* aObserver) +{ + CompositorBridgeParent::RequestNotifyLayerTreeReady(aLayersId, aObserver); +} + +void +GPUProcessManager::RequestNotifyLayerTreeCleared(uint64_t aLayersId, CompositorUpdateObserver* aObserver) +{ + CompositorBridgeParent::RequestNotifyLayerTreeCleared(aLayersId, aObserver); +} + +void +GPUProcessManager::SwapLayerTreeObservers(uint64_t aLayer, uint64_t aOtherLayer) +{ + CompositorBridgeParent::SwapLayerTreeObservers(aLayer, aOtherLayer); +} + } // namespace gfx } // namespace mozilla diff --git a/gfx/ipc/GPUProcessManager.h b/gfx/ipc/GPUProcessManager.h index 96911cf9bdc3..e612e17557c1 100644 --- a/gfx/ipc/GPUProcessManager.h +++ b/gfx/ipc/GPUProcessManager.h @@ -14,6 +14,7 @@ namespace layers { class APZCTreeManager; class CompositorSession; class ClientLayerManager; +class CompositorUpdateObserver; } // namespace layers namespace widget { class CompositorWidgetProxy; @@ -26,6 +27,7 @@ namespace gfx { class GPUProcessManager final { typedef layers::APZCTreeManager APZCTreeManager; + typedef layers::CompositorUpdateObserver CompositorUpdateObserver; public: static void Initialize(); @@ -58,6 +60,10 @@ public: // Must run on the content main thread. void DeallocateLayerTreeId(uint64_t aLayersId); + void RequestNotifyLayerTreeReady(uint64_t aLayersId, CompositorUpdateObserver* aObserver); + void RequestNotifyLayerTreeCleared(uint64_t aLayersId, CompositorUpdateObserver* aObserver); + void SwapLayerTreeObservers(uint64_t aLayer, uint64_t aOtherLayer); + private: GPUProcessManager(); diff --git a/gfx/layers/ipc/CompositorBridgeParent.h b/gfx/layers/ipc/CompositorBridgeParent.h index 382d485be1b4..c9c64a9c0402 100644 --- a/gfx/layers/ipc/CompositorBridgeParent.h +++ b/gfx/layers/ipc/CompositorBridgeParent.h @@ -458,10 +458,6 @@ public: */ static void PostInsertVsyncProfilerMarker(mozilla::TimeStamp aVsyncTimestamp); - static void RequestNotifyLayerTreeReady(uint64_t aLayersId, CompositorUpdateObserver* aObserver); - static void RequestNotifyLayerTreeCleared(uint64_t aLayersId, CompositorUpdateObserver* aObserver); - static void SwapLayerTreeObservers(uint64_t aLayer, uint64_t aOtherLayer); - float ComputeRenderIntegrity(); widget::CompositorWidgetProxy* GetWidgetProxy() { return mWidgetProxy; } @@ -506,6 +502,10 @@ private: */ static void DeallocateLayerTreeId(uint64_t aId); + static void RequestNotifyLayerTreeReady(uint64_t aLayersId, CompositorUpdateObserver* aObserver); + static void RequestNotifyLayerTreeCleared(uint64_t aLayersId, CompositorUpdateObserver* aObserver); + static void SwapLayerTreeObservers(uint64_t aLayer, uint64_t aOtherLayer); + protected: // Protected destructor, to discourage deletion outside of Release(): virtual ~CompositorBridgeParent();