зеркало из https://github.com/mozilla/gecko-dev.git
Move async compositable ID allocation to ImageBridgeChild. (bug 1325784 part 3, r=nical)
This commit is contained in:
Родитель
e8efc823bc
Коммит
2d302f4637
|
@ -380,7 +380,8 @@ ImageBridgeChild::Connect(CompositableClient* aCompositable,
|
|||
MOZ_ASSERT(InImageBridgeChildThread());
|
||||
MOZ_ASSERT(CanSend());
|
||||
|
||||
uint64_t id = 0;
|
||||
static uint64_t sNextID = 1;
|
||||
uint64_t id = sNextID++;
|
||||
|
||||
PImageContainerChild* imageContainerChild = nullptr;
|
||||
if (aImageContainer)
|
||||
|
@ -388,7 +389,8 @@ ImageBridgeChild::Connect(CompositableClient* aCompositable,
|
|||
|
||||
PCompositableChild* child =
|
||||
SendPCompositableConstructor(aCompositable->GetTextureInfo(),
|
||||
imageContainerChild, &id);
|
||||
id,
|
||||
imageContainerChild);
|
||||
if (!child) {
|
||||
return;
|
||||
}
|
||||
|
@ -397,7 +399,8 @@ ImageBridgeChild::Connect(CompositableClient* aCompositable,
|
|||
|
||||
PCompositableChild*
|
||||
ImageBridgeChild::AllocPCompositableChild(const TextureInfo& aInfo,
|
||||
PImageContainerChild* aChild, uint64_t* aID)
|
||||
const uint64_t& aID,
|
||||
PImageContainerChild* aChild)
|
||||
{
|
||||
MOZ_ASSERT(CanSend());
|
||||
return AsyncCompositableChild::CreateActor();
|
||||
|
|
|
@ -170,7 +170,8 @@ public:
|
|||
virtual base::ProcessId GetParentPid() const override { return OtherPid(); }
|
||||
|
||||
PCompositableChild* AllocPCompositableChild(const TextureInfo& aInfo,
|
||||
PImageContainerChild* aChild, uint64_t* aID) override;
|
||||
const uint64_t& aID,
|
||||
PImageContainerChild* aChild) override;
|
||||
bool DeallocPCompositableChild(PCompositableChild* aActor) override;
|
||||
|
||||
virtual PTextureChild*
|
||||
|
|
|
@ -238,26 +238,22 @@ mozilla::ipc::IPCResult ImageBridgeParent::RecvWillClose()
|
|||
return IPC_OK();
|
||||
}
|
||||
|
||||
static uint64_t GenImageContainerID() {
|
||||
static uint64_t sNextImageID = 1;
|
||||
|
||||
++sNextImageID;
|
||||
return sNextImageID;
|
||||
}
|
||||
|
||||
PCompositableParent*
|
||||
ImageBridgeParent::AllocPCompositableParent(const TextureInfo& aInfo,
|
||||
PImageContainerParent* aImageContainer,
|
||||
uint64_t* aID)
|
||||
const uint64_t& aID,
|
||||
PImageContainerParent* aImageContainer)
|
||||
{
|
||||
PCompositableParent* actor = CompositableHost::CreateIPDLActor(this, aInfo, aImageContainer);
|
||||
if (mCompositables.find(aID) != mCompositables.end()) {
|
||||
NS_ERROR("Async compositable ID already exists");
|
||||
return actor;
|
||||
}
|
||||
|
||||
CompositableHost* host = CompositableHost::FromIPDLActor(actor);
|
||||
|
||||
uint64_t id = GenImageContainerID();
|
||||
host->SetAsyncID(id);
|
||||
mCompositables[id] = host;
|
||||
host->SetAsyncID(aID);
|
||||
mCompositables[aID] = host;
|
||||
|
||||
*aID = id;
|
||||
return actor;
|
||||
}
|
||||
|
||||
|
|
|
@ -79,8 +79,8 @@ public:
|
|||
const uint64_t& aFwdTransactionId) override;
|
||||
|
||||
PCompositableParent* AllocPCompositableParent(const TextureInfo& aInfo,
|
||||
PImageContainerParent* aImageContainer,
|
||||
uint64_t*) override;
|
||||
const uint64_t& aID,
|
||||
PImageContainerParent* aImageContainer) override;
|
||||
bool DeallocPCompositableParent(PCompositableParent* aActor) override;
|
||||
|
||||
virtual PTextureParent* AllocPTextureParent(const SurfaceDescriptor& aSharedData,
|
||||
|
|
|
@ -55,8 +55,9 @@ parent:
|
|||
// before sending closing the channel.
|
||||
sync WillClose();
|
||||
|
||||
sync PCompositable(TextureInfo aInfo,
|
||||
nullable PImageContainer aImageContainer) returns (uint64_t id);
|
||||
async PCompositable(TextureInfo aInfo,
|
||||
uint64_t aId,
|
||||
nullable PImageContainer aImageContainer);
|
||||
async PTexture(SurfaceDescriptor aSharedData, LayersBackend aBackend, TextureFlags aTextureFlags, uint64_t aSerial);
|
||||
async PMediaSystemResourceManager();
|
||||
async PImageContainer();
|
||||
|
|
Загрузка…
Ссылка в новой задаче