Bug 959615 - Initialize the TextureChild/Parent at creation time. r= bjacob
This commit is contained in:
@@ -169,12 +169,12 @@ TextureClient::InitIPDLActor(CompositableForwarder* aForwarder)
|
||||
return false;
|
||||
}
|
||||
|
||||
mActor = static_cast<TextureChild*>(aForwarder->CreateEmptyTextureChild());
|
||||
mActor = static_cast<TextureChild*>(aForwarder->CreateTexture(desc, GetFlags()));
|
||||
MOZ_ASSERT(mActor);
|
||||
mActor->mForwarder = aForwarder;
|
||||
mActor->mTextureClient = this;
|
||||
mShared = true;
|
||||
return mActor->IPCOpen() &&
|
||||
mActor->SendInit(desc, GetFlags());
|
||||
return mActor->IPCOpen();
|
||||
}
|
||||
|
||||
PTextureChild*
|
||||
|
||||
@@ -36,8 +36,8 @@ public:
|
||||
|
||||
~TextureParent();
|
||||
|
||||
bool RecvInit(const SurfaceDescriptor& aSharedData,
|
||||
const TextureFlags& aFlags) MOZ_OVERRIDE;
|
||||
bool Init(const SurfaceDescriptor& aSharedData,
|
||||
const TextureFlags& aFlags);
|
||||
|
||||
virtual bool RecvRemoveTexture() MOZ_OVERRIDE;
|
||||
|
||||
@@ -53,9 +53,14 @@ public:
|
||||
|
||||
// static
|
||||
PTextureParent*
|
||||
TextureHost::CreateIPDLActor(ISurfaceAllocator* aAllocator)
|
||||
TextureHost::CreateIPDLActor(ISurfaceAllocator* aAllocator,
|
||||
const SurfaceDescriptor& aSharedData,
|
||||
TextureFlags aFlags)
|
||||
{
|
||||
return new TextureParent(aAllocator);
|
||||
TextureParent* actor = new TextureParent(aAllocator);
|
||||
DebugOnly<bool> status = actor->Init(aSharedData, aFlags);
|
||||
MOZ_ASSERT(status);
|
||||
return actor;
|
||||
}
|
||||
|
||||
// static
|
||||
@@ -679,8 +684,8 @@ TextureParent::~TextureParent()
|
||||
}
|
||||
|
||||
bool
|
||||
TextureParent::RecvInit(const SurfaceDescriptor& aSharedData,
|
||||
const TextureFlags& aFlags)
|
||||
TextureParent::Init(const SurfaceDescriptor& aSharedData,
|
||||
const TextureFlags& aFlags)
|
||||
{
|
||||
mTextureHost = TextureHost::Create(aSharedData,
|
||||
mAllocator,
|
||||
|
||||
@@ -379,7 +379,9 @@ public:
|
||||
* are for use with the managing IPDL protocols only (so that they can
|
||||
* implement AllocPTextureParent and DeallocPTextureParent).
|
||||
*/
|
||||
static PTextureParent* CreateIPDLActor(ISurfaceAllocator* aAllocator);
|
||||
static PTextureParent* CreateIPDLActor(ISurfaceAllocator* aAllocator,
|
||||
const SurfaceDescriptor& aSharedData,
|
||||
TextureFlags aFlags);
|
||||
static bool DestroyIPDLActor(PTextureParent* actor);
|
||||
|
||||
/**
|
||||
|
||||
@@ -96,12 +96,9 @@ public:
|
||||
const SurfaceDescriptorTiles& aTiledDescriptor) = 0;
|
||||
|
||||
/**
|
||||
* Create an unitialized TextureChild.
|
||||
*
|
||||
* This does not trigger the the creation of a TextureHost on the compositor
|
||||
* side (see PTexture::Init).
|
||||
* Create a TextureChild/Parent pair as as well as the TextureHost on the parent side.
|
||||
*/
|
||||
virtual PTextureChild* CreateEmptyTextureChild() = 0;
|
||||
virtual PTextureChild* CreateTexture(const SurfaceDescriptor& aSharedData, TextureFlags aFlags) = 0;
|
||||
|
||||
/**
|
||||
* Communicate to the compositor that the texture identified by aCompositable
|
||||
|
||||
@@ -897,7 +897,8 @@ ImageBridgeChild::AllocGrallocBuffer(const IntSize& aSize,
|
||||
}
|
||||
|
||||
PTextureChild*
|
||||
ImageBridgeChild::AllocPTextureChild()
|
||||
ImageBridgeChild::AllocPTextureChild(const SurfaceDescriptor&,
|
||||
const TextureFlags&)
|
||||
{
|
||||
return TextureClient::CreateIPDLActor();
|
||||
}
|
||||
@@ -909,9 +910,10 @@ ImageBridgeChild::DeallocPTextureChild(PTextureChild* actor)
|
||||
}
|
||||
|
||||
PTextureChild*
|
||||
ImageBridgeChild::CreateEmptyTextureChild()
|
||||
ImageBridgeChild::CreateTexture(const SurfaceDescriptor& aSharedData,
|
||||
TextureFlags aFlags)
|
||||
{
|
||||
return SendPTextureConstructor();
|
||||
return SendPTextureConstructor(aSharedData, aFlags);
|
||||
}
|
||||
|
||||
static void RemoveTextureSync(TextureClient* aTexture, ReentrantMonitor* aBarrier, bool* aDone)
|
||||
|
||||
@@ -195,7 +195,7 @@ public:
|
||||
DeallocPGrallocBufferChild(PGrallocBufferChild* actor) MOZ_OVERRIDE;
|
||||
|
||||
virtual PTextureChild*
|
||||
AllocPTextureChild() MOZ_OVERRIDE;
|
||||
AllocPTextureChild(const SurfaceDescriptor& aSharedData, const TextureFlags& aFlags) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool
|
||||
DeallocPTextureChild(PTextureChild* actor) MOZ_OVERRIDE;
|
||||
@@ -372,7 +372,8 @@ public:
|
||||
*/
|
||||
virtual void DeallocShmem(mozilla::ipc::Shmem& aShmem);
|
||||
|
||||
virtual PTextureChild* CreateEmptyTextureChild() MOZ_OVERRIDE;
|
||||
virtual PTextureChild* CreateTexture(const SurfaceDescriptor& aSharedData,
|
||||
TextureFlags aFlags) MOZ_OVERRIDE;
|
||||
|
||||
protected:
|
||||
ImageBridgeChild();
|
||||
|
||||
@@ -191,9 +191,10 @@ bool ImageBridgeParent::DeallocPCompositableParent(PCompositableParent* aActor)
|
||||
}
|
||||
|
||||
PTextureParent*
|
||||
ImageBridgeParent::AllocPTextureParent()
|
||||
ImageBridgeParent::AllocPTextureParent(const SurfaceDescriptor& aSharedData,
|
||||
const TextureFlags& aFlags)
|
||||
{
|
||||
return TextureHost::CreateIPDLActor(this);
|
||||
return TextureHost::CreateIPDLActor(this, aSharedData, aFlags);
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
@@ -64,7 +64,8 @@ public:
|
||||
uint64_t*) MOZ_OVERRIDE;
|
||||
bool DeallocPCompositableParent(PCompositableParent* aActor) MOZ_OVERRIDE;
|
||||
|
||||
virtual PTextureParent* AllocPTextureParent() MOZ_OVERRIDE;
|
||||
virtual PTextureParent* AllocPTextureParent(const SurfaceDescriptor& aSharedData,
|
||||
const TextureFlags& aFlags) MOZ_OVERRIDE;
|
||||
virtual bool DeallocPTextureParent(PTextureParent* actor) MOZ_OVERRIDE;
|
||||
|
||||
bool RecvStop() MOZ_OVERRIDE;
|
||||
|
||||
@@ -98,7 +98,8 @@ LayerTransactionChild::ActorDestroy(ActorDestroyReason why)
|
||||
}
|
||||
|
||||
PTextureChild*
|
||||
LayerTransactionChild::AllocPTextureChild()
|
||||
LayerTransactionChild::AllocPTextureChild(const SurfaceDescriptor&,
|
||||
const TextureFlags&)
|
||||
{
|
||||
return TextureClient::CreateIPDLActor();
|
||||
}
|
||||
|
||||
@@ -58,7 +58,8 @@ protected:
|
||||
virtual PCompositableChild* AllocPCompositableChild(const TextureInfo& aInfo) MOZ_OVERRIDE;
|
||||
virtual bool DeallocPCompositableChild(PCompositableChild* actor) MOZ_OVERRIDE;
|
||||
|
||||
virtual PTextureChild* AllocPTextureChild() MOZ_OVERRIDE;
|
||||
virtual PTextureChild* AllocPTextureChild(const SurfaceDescriptor& aSharedData,
|
||||
const TextureFlags& aFlags) MOZ_OVERRIDE;
|
||||
virtual bool DeallocPTextureChild(PTextureChild* actor) MOZ_OVERRIDE;
|
||||
|
||||
virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
|
||||
|
||||
@@ -603,9 +603,10 @@ LayerTransactionParent::DeallocPCompositableParent(PCompositableParent* actor)
|
||||
}
|
||||
|
||||
PTextureParent*
|
||||
LayerTransactionParent::AllocPTextureParent()
|
||||
LayerTransactionParent::AllocPTextureParent(const SurfaceDescriptor& aSharedData,
|
||||
const TextureFlags& aFlags)
|
||||
{
|
||||
return TextureHost::CreateIPDLActor(this);
|
||||
return TextureHost::CreateIPDLActor(this, aSharedData, aFlags);
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
@@ -107,7 +107,8 @@ protected:
|
||||
virtual PCompositableParent* AllocPCompositableParent(const TextureInfo& aInfo) MOZ_OVERRIDE;
|
||||
virtual bool DeallocPCompositableParent(PCompositableParent* actor) MOZ_OVERRIDE;
|
||||
|
||||
virtual PTextureParent* AllocPTextureParent() MOZ_OVERRIDE;
|
||||
virtual PTextureParent* AllocPTextureParent(const SurfaceDescriptor& aSharedData,
|
||||
const TextureFlags& aFlags) MOZ_OVERRIDE;
|
||||
virtual bool DeallocPTextureParent(PTextureParent* actor) MOZ_OVERRIDE;
|
||||
|
||||
void Attach(ShadowLayerParent* aLayerParent,
|
||||
|
||||
@@ -51,7 +51,7 @@ parent:
|
||||
sync Stop();
|
||||
|
||||
sync PCompositable(TextureInfo aInfo) returns (uint64_t id);
|
||||
async PTexture();
|
||||
async PTexture(SurfaceDescriptor aSharedData, uint32_t aTextureFlags);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ parent:
|
||||
returns (MaybeMagicGrallocBufferHandle handle);
|
||||
async PLayer();
|
||||
async PCompositable(TextureInfo aTextureInfo);
|
||||
async PTexture();
|
||||
async PTexture(SurfaceDescriptor aSharedData, uint32_t aTextureFlags);
|
||||
|
||||
// The isFirstPaint flag can be used to indicate that this is the first update
|
||||
// for a particular document.
|
||||
|
||||
@@ -26,10 +26,6 @@ child:
|
||||
async __delete__();
|
||||
|
||||
parent:
|
||||
/**
|
||||
* Set the shared data and create the TextureHost on the parent side.
|
||||
*/
|
||||
async Init(SurfaceDescriptor aSharedData, uint32_t aTextureFlags);
|
||||
|
||||
/**
|
||||
* Asynchronously tell the Compositor side to remove the texture.
|
||||
|
||||
@@ -963,9 +963,10 @@ void ShadowLayerForwarder::AttachAsyncCompositable(uint64_t aCompositableID,
|
||||
}
|
||||
|
||||
PTextureChild*
|
||||
ShadowLayerForwarder::CreateEmptyTextureChild()
|
||||
ShadowLayerForwarder::CreateTexture(const SurfaceDescriptor& aSharedData,
|
||||
TextureFlags aFlags)
|
||||
{
|
||||
return mShadowManager->SendPTextureConstructor();
|
||||
return mShadowManager->SendPTextureConstructor(aSharedData, aFlags);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -148,7 +148,8 @@ public:
|
||||
*/
|
||||
void Connect(CompositableClient* aCompositable);
|
||||
|
||||
virtual PTextureChild* CreateEmptyTextureChild() MOZ_OVERRIDE;
|
||||
virtual PTextureChild* CreateTexture(const SurfaceDescriptor& aSharedData,
|
||||
TextureFlags aFlags) MOZ_OVERRIDE;
|
||||
|
||||
virtual void CreatedSingleBuffer(CompositableClient* aCompositable,
|
||||
const SurfaceDescriptor& aDescriptor,
|
||||
|
||||
Reference in New Issue
Block a user