Remove ContentParent use of CompositorBridgeParent. (bug 1274149 part 5, r=mattwoodrow)

This commit is contained in:
David Anderson 2016-05-23 00:28:51 -07:00
Родитель 3284628c95
Коммит cc844f6053
4 изменённых файлов: 68 добавлений и 18 удалений

Просмотреть файл

@ -86,7 +86,6 @@
#include "mozilla/ipc/InputStreamUtils.h"
#include "mozilla/jsipc/CrossProcessObjectWrappers.h"
#include "mozilla/layers/PAPZParent.h"
#include "mozilla/layers/CompositorBridgeParent.h"
#include "mozilla/layers/CompositorThread.h"
#include "mozilla/layers/ImageBridgeParent.h"
#include "mozilla/layers/SharedBufferManagerParent.h"
@ -1941,7 +1940,8 @@ ContentParent::AllocateLayerTreeId(ContentParent* aContent,
TabParent* aTopLevel, const TabId& aTabId,
uint64_t* aId)
{
*aId = GPUProcessManager::Get()->AllocateLayerTreeId();
GPUProcessManager* gpu = GPUProcessManager::Get();
*aId = gpu->AllocateLayerTreeId();
if (!gfxPlatform::AsyncPanZoomEnabled()) {
return true;
@ -1951,8 +1951,7 @@ ContentParent::AllocateLayerTreeId(ContentParent* aContent,
return false;
}
return CompositorBridgeParent::UpdateRemoteContentController(*aId, aContent,
aTabId, aTopLevel);
return gpu->UpdateRemoteContentController(*aId, aContent, aTabId, aTopLevel);
}
bool
@ -3334,7 +3333,8 @@ PCompositorBridgeParent*
ContentParent::AllocPCompositorBridgeParent(mozilla::ipc::Transport* aTransport,
base::ProcessId aOtherProcess)
{
return CompositorBridgeParent::Create(aTransport, aOtherProcess, mSubprocess);
return GPUProcessManager::Get()->CreateTabCompositorBridge(
aTransport, aOtherProcess, mSubprocess);
}
gfx::PVRManagerParent*

Просмотреть файл

@ -60,6 +60,14 @@ GPUProcessManager::CreateTopLevelCompositor(widget::CompositorWidgetProxy* aProx
aSurfaceHeight);
}
PCompositorBridgeParent*
GPUProcessManager::CreateTabCompositorBridge(ipc::Transport* aTransport,
base::ProcessId aOtherProcess,
ipc::GeckoChildProcessHost* aSubprocess)
{
return CompositorBridgeParent::Create(aTransport, aOtherProcess, aSubprocess);
}
already_AddRefed<APZCTreeManager>
GPUProcessManager::GetAPZCTreeManagerForLayers(uint64_t aLayersId)
{
@ -96,5 +104,18 @@ GPUProcessManager::SwapLayerTreeObservers(uint64_t aLayer, uint64_t aOtherLayer)
CompositorBridgeParent::SwapLayerTreeObservers(aLayer, aOtherLayer);
}
bool
GPUProcessManager::UpdateRemoteContentController(uint64_t aLayersId,
dom::ContentParent* aContentParent,
const dom::TabId& aTabId,
dom::TabParent* aBrowserParent)
{
return CompositorBridgeParent::UpdateRemoteContentController(
aLayersId,
aContentParent,
aTabId,
aBrowserParent);
}
} // namespace gfx
} // namespace mozilla

Просмотреть файл

@ -7,7 +7,10 @@
#define _include_mozilla_gfx_ipc_GPUProcessManager_h_
#include "base/basictypes.h"
#include "base/process.h"
#include "Units.h"
#include "mozilla/dom/ipc/IdType.h"
#include "mozilla/ipc/Transport.h"
namespace mozilla {
namespace layers {
@ -15,10 +18,18 @@ class APZCTreeManager;
class CompositorSession;
class ClientLayerManager;
class CompositorUpdateObserver;
class PCompositorBridgeParent;
} // namespace layers
namespace widget {
class CompositorWidgetProxy;
} // namespace widget
namespace dom {
class ContentParent;
class TabParent;
} // namespace dom
namespace ipc {
class GeckoChildProcessHost;
} // namespace ipc
namespace gfx {
// The GPUProcessManager is a singleton responsible for creating GPU-bound
@ -45,6 +56,11 @@ public:
int aSurfaceWidth,
int aSurfaceHeight);
layers::PCompositorBridgeParent* CreateTabCompositorBridge(
ipc::Transport* aTransport,
base::ProcessId aOtherProcess,
ipc::GeckoChildProcessHost* aSubprocess);
// This returns a reference to the APZCTreeManager to which
// pan/zoom-related events can be sent.
already_AddRefed<APZCTreeManager> GetAPZCTreeManagerForLayers(uint64_t aLayersId);
@ -64,6 +80,18 @@ public:
void RequestNotifyLayerTreeCleared(uint64_t aLayersId, CompositorUpdateObserver* aObserver);
void SwapLayerTreeObservers(uint64_t aLayer, uint64_t aOtherLayer);
// Creates a new RemoteContentController for aTabId. Should only be called on
// the main thread.
//
// aLayersId The layers id for the browser corresponding to aTabId.
// aContentParent The ContentParent for the process that the TabChild for
// aTabId lives in.
// aBrowserParent The toplevel TabParent for aTabId.
bool UpdateRemoteContentController(uint64_t aLayersId,
dom::ContentParent* aContentParent,
const dom::TabId& aTabId,
dom::TabParent* aBrowserParent);
private:
GPUProcessManager();

Просмотреть файл

@ -464,19 +464,6 @@ public:
void ForceComposeToTarget(gfx::DrawTarget* aTarget, const gfx::IntRect* aRect = nullptr);
/**
* Creates a new RemoteContentController for aTabId. Should only be called on
* the main thread.
*
* aLayersId The layers id for the browser corresponding to aTabId.
* aContentParent The ContentParent for the process that the TabChild for
* aTabId lives in.
* aBrowserParent The toplevel TabParent for aTabId.
*/
static bool UpdateRemoteContentController(uint64_t aLayersId,
dom::ContentParent* aContentParent,
const dom::TabId& aTabId,
dom::TabParent* aBrowserParent);
bool AsyncPanZoomEnabled() const {
return !!mApzcTreeManager;
}
@ -506,6 +493,20 @@ private:
static void RequestNotifyLayerTreeCleared(uint64_t aLayersId, CompositorUpdateObserver* aObserver);
static void SwapLayerTreeObservers(uint64_t aLayer, uint64_t aOtherLayer);
/**
* Creates a new RemoteContentController for aTabId. Should only be called on
* the main thread.
*
* aLayersId The layers id for the browser corresponding to aTabId.
* aContentParent The ContentParent for the process that the TabChild for
* aTabId lives in.
* aBrowserParent The toplevel TabParent for aTabId.
*/
static bool UpdateRemoteContentController(uint64_t aLayersId,
dom::ContentParent* aContentParent,
const dom::TabId& aTabId,
dom::TabParent* aBrowserParent);
protected:
// Protected destructor, to discourage deletion outside of Release():
virtual ~CompositorBridgeParent();