Support compositor bridges from the content process to the GPU process. (bug 1282348 part 8, r=billm)

This commit is contained in:
David Anderson 2016-07-17 21:24:28 -07:00
parent cce407eb5f
commit 8b62f958d0
4 changed files with 21 additions and 3 deletions

View File

@ -83,6 +83,12 @@ GPUParent::RecvNewWidgetCompositor(Endpoint<layers::PCompositorBridgeParent>&& a
return true;
}
bool
GPUParent::RecvNewContentCompositorBridge(Endpoint<PCompositorBridgeParent>&& aEndpoint)
{
return CompositorBridgeParent::CreateForContent(Move(aEndpoint));
}
void
GPUParent::ActorDestroy(ActorDestroyReason aWhy)
{

View File

@ -28,6 +28,7 @@ public:
const CSSToLayoutDeviceScale& aScale,
const bool& aUseExternalSurface,
const IntSize& aSurfaceSize) override;
bool RecvNewContentCompositorBridge(Endpoint<PCompositorBridgeParent>&& aEndpoint) override;
void ActorDestroy(ActorDestroyReason aWhy) override;
};

View File

@ -283,8 +283,12 @@ GPUProcessManager::CreateContentCompositorBridge(base::ProcessId aOtherProcess,
ipc::Endpoint<PCompositorBridgeParent> parentPipe;
ipc::Endpoint<PCompositorBridgeChild> childPipe;
base::ProcessId gpuPid = mGPUChild
? mGPUChild->OtherPid()
: base::GetCurrentProcId();
nsresult rv = PCompositorBridge::CreateEndpoints(
base::GetCurrentProcId(),
gpuPid,
aOtherProcess,
&parentPipe,
&childPipe);
@ -293,8 +297,12 @@ GPUProcessManager::CreateContentCompositorBridge(base::ProcessId aOtherProcess,
return false;
}
if (!CompositorBridgeParent::CreateForContent(Move(parentPipe)))
return false;
if (mGPUChild) {
mGPUChild->SendNewContentCompositorBridge(Move(parentPipe));
} else {
if (!CompositorBridgeParent::CreateForContent(Move(parentPipe)))
return false;
}
*aOutEndpoint = Move(childPipe);
return true;

View File

@ -37,6 +37,9 @@ parent:
CSSToLayoutDeviceScale scale,
bool useExternalSurface,
IntSize surfaceSize);
// Create a new content-process compositor bridge.
async NewContentCompositorBridge(Endpoint<PCompositorBridgeParent> endpoint);
};
} // namespace gfx