Remove TabParent use of CompositorBridgeParent. (bug 1274149 part 4, r=mattwoodrow)

This commit is contained in:
David Anderson
2016-05-23 00:28:03 -07:00
parent 377d55cdb8
commit dd54f2fdc9
4 changed files with 34 additions and 9 deletions

View File

@@ -25,12 +25,12 @@
#include "mozilla/EventStateManager.h" #include "mozilla/EventStateManager.h"
#include "mozilla/gfx/2D.h" #include "mozilla/gfx/2D.h"
#include "mozilla/gfx/DataSurfaceHelpers.h" #include "mozilla/gfx/DataSurfaceHelpers.h"
#include "mozilla/gfx/GPUProcessManager.h"
#include "mozilla/Hal.h" #include "mozilla/Hal.h"
#include "mozilla/IMEStateManager.h" #include "mozilla/IMEStateManager.h"
#include "mozilla/ipc/DocumentRendererParent.h" #include "mozilla/ipc/DocumentRendererParent.h"
#include "mozilla/jsipc/CrossProcessObjectWrappers.h" #include "mozilla/jsipc/CrossProcessObjectWrappers.h"
#include "mozilla/layers/AsyncDragMetrics.h" #include "mozilla/layers/AsyncDragMetrics.h"
#include "mozilla/layers/CompositorBridgeParent.h"
#include "mozilla/layers/InputAPZContext.h" #include "mozilla/layers/InputAPZContext.h"
#include "mozilla/layout/RenderFrameParent.h" #include "mozilla/layout/RenderFrameParent.h"
#include "mozilla/LookAndFeel.h" #include "mozilla/LookAndFeel.h"
@@ -105,6 +105,7 @@ using namespace mozilla::layout;
using namespace mozilla::services; using namespace mozilla::services;
using namespace mozilla::widget; using namespace mozilla::widget;
using namespace mozilla::jsipc; using namespace mozilla::jsipc;
using namespace mozilla::gfx;
// The flags passed by the webProgress notifications are 16 bits shifted // The flags passed by the webProgress notifications are 16 bits shifted
// from the ones registered by webProgressListeners. // from the ones registered by webProgressListeners.
@@ -2977,7 +2978,7 @@ TabParent::RequestNotifyLayerTreeReady()
if (!frame || !frame->IsInitted()) { if (!frame || !frame->IsInitted()) {
mNeedLayerTreeReadyNotification = true; mNeedLayerTreeReadyNotification = true;
} else { } else {
CompositorBridgeParent::RequestNotifyLayerTreeReady( GPUProcessManager::Get()->RequestNotifyLayerTreeReady(
frame->GetLayersId(), frame->GetLayersId(),
mLayerUpdateObserver); mLayerUpdateObserver);
} }
@@ -2992,7 +2993,7 @@ TabParent::RequestNotifyLayerTreeCleared()
return false; return false;
} }
CompositorBridgeParent::RequestNotifyLayerTreeCleared( GPUProcessManager::Get()->RequestNotifyLayerTreeCleared(
frame->GetLayersId(), frame->GetLayersId(),
mLayerUpdateObserver); mLayerUpdateObserver);
return true; return true;
@@ -3033,10 +3034,10 @@ TabParent::SwapLayerTreeObservers(TabParent* aOther)
return; 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 // 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. // can't grab the layer update observer for the wrong tab parent.
CompositorBridgeParent::SwapLayerTreeObservers( GPUProcessManager::Get()->SwapLayerTreeObservers(
rfp->GetLayersId(), rfp->GetLayersId(),
otherRfp->GetLayersId()); otherRfp->GetLayersId());

View File

@@ -78,5 +78,23 @@ GPUProcessManager::DeallocateLayerTreeId(uint64_t aLayersId)
CompositorBridgeParent::DeallocateLayerTreeId(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 gfx
} // namespace mozilla } // namespace mozilla

View File

@@ -14,6 +14,7 @@ namespace layers {
class APZCTreeManager; class APZCTreeManager;
class CompositorSession; class CompositorSession;
class ClientLayerManager; class ClientLayerManager;
class CompositorUpdateObserver;
} // namespace layers } // namespace layers
namespace widget { namespace widget {
class CompositorWidgetProxy; class CompositorWidgetProxy;
@@ -26,6 +27,7 @@ namespace gfx {
class GPUProcessManager final class GPUProcessManager final
{ {
typedef layers::APZCTreeManager APZCTreeManager; typedef layers::APZCTreeManager APZCTreeManager;
typedef layers::CompositorUpdateObserver CompositorUpdateObserver;
public: public:
static void Initialize(); static void Initialize();
@@ -58,6 +60,10 @@ public:
// Must run on the content main thread. // Must run on the content main thread.
void DeallocateLayerTreeId(uint64_t aLayersId); 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: private:
GPUProcessManager(); GPUProcessManager();

View File

@@ -458,10 +458,6 @@ public:
*/ */
static void PostInsertVsyncProfilerMarker(mozilla::TimeStamp aVsyncTimestamp); 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(); float ComputeRenderIntegrity();
widget::CompositorWidgetProxy* GetWidgetProxy() { return mWidgetProxy; } widget::CompositorWidgetProxy* GetWidgetProxy() { return mWidgetProxy; }
@@ -506,6 +502,10 @@ private:
*/ */
static void DeallocateLayerTreeId(uint64_t aId); 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:
// Protected destructor, to discourage deletion outside of Release(): // Protected destructor, to discourage deletion outside of Release():
virtual ~CompositorBridgeParent(); virtual ~CompositorBridgeParent();