diff --git a/gfx/layers/client/TextureClient.cpp b/gfx/layers/client/TextureClient.cpp index 4744d810ab83..b4dae38d3917 100644 --- a/gfx/layers/client/TextureClient.cpp +++ b/gfx/layers/client/TextureClient.cpp @@ -452,11 +452,10 @@ void TextureClient::ForceRemove() { if (mValid && mActor) { if (GetFlags() & TextureFlags::DEALLOCATE_CLIENT) { - mActor->SetTextureData(DropTextureData()); if (mActor->IPCOpen()) { - mActor->SendRemoveTextureSync(); + mActor->SendClearTextureHostSync(); + mActor->SendRemoveTexture(); } - mActor->DeleteTextureData(); } else { if (mActor->IPCOpen()) { mActor->SendRemoveTexture(); diff --git a/gfx/layers/composite/TextureHost.cpp b/gfx/layers/composite/TextureHost.cpp index ba9965a9585d..2dc7c829cc46 100644 --- a/gfx/layers/composite/TextureHost.cpp +++ b/gfx/layers/composite/TextureHost.cpp @@ -88,14 +88,16 @@ public: virtual bool RecvClientRecycle() MOZ_OVERRIDE; - virtual bool RecvRemoveTexture() MOZ_OVERRIDE; + virtual bool RecvClearTextureHostSync() MOZ_OVERRIDE; - virtual bool RecvRemoveTextureSync() MOZ_OVERRIDE; + virtual bool RecvRemoveTexture() MOZ_OVERRIDE; TextureHost* GetTextureHost() { return mTextureHost; } void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE; + void ClearTextureHost(); + CompositableParentManager* mCompositableManager; RefPtr mWaitForClientRecycle; RefPtr mTextureHost; @@ -737,20 +739,15 @@ TextureParent::RecvRemoveTexture() } bool -TextureParent::RecvRemoveTextureSync() +TextureParent::RecvClearTextureHostSync() { - // we don't need to send a reply in the synchronous case since the child side - // has the guarantee that this message has been handled synchronously. - return PTextureParent::Send__delete__(this); + ClearTextureHost(); + return true; } void TextureParent::ActorDestroy(ActorDestroyReason why) { - if (!mTextureHost) { - return; - } - switch (why) { case AncestorDeletion: case Deletion: @@ -761,6 +758,16 @@ TextureParent::ActorDestroy(ActorDestroyReason why) NS_RUNTIMEABORT("FailedConstructor isn't possible in PTexture"); } + ClearTextureHost(); +} + +void +TextureParent::ClearTextureHost() +{ + if (!mTextureHost) { + return; + } + if (mTextureHost->GetFlags() & TextureFlags::RECYCLE) { RECYCLE_LOG("clear recycling for tile %p\n", this); mTextureHost->ClearRecycleCallback(); diff --git a/gfx/layers/ipc/ImageBridgeChild.cpp b/gfx/layers/ipc/ImageBridgeChild.cpp index 8ad7df71261d..683ddfbf74b4 100644 --- a/gfx/layers/ipc/ImageBridgeChild.cpp +++ b/gfx/layers/ipc/ImageBridgeChild.cpp @@ -363,13 +363,13 @@ void ImageBridgeChild::FlushAllImages(ImageClient* aClient, ImageContainer* aCon NS_ERROR("ImageBridgeChild::FlushAllImages() is called on ImageBridge thread."); return; } - + RefPtr status = aClient->PrepareFlushAllImages(); - + sImageBridgeChildSingleton->GetMessageLoop()->PostTask( FROM_HERE, NewRunnableFunction(&FlushAllImagesSync, aClient, aContainer, aExceptFront, status)); - + status->WaitComplete(); } diff --git a/gfx/layers/ipc/PTexture.ipdl b/gfx/layers/ipc/PTexture.ipdl index 673b06314e45..5e5f53cdd454 100644 --- a/gfx/layers/ipc/PTexture.ipdl +++ b/gfx/layers/ipc/PTexture.ipdl @@ -30,15 +30,15 @@ parent: async ClientRecycle(); + /** + * Synchronously tell the TextureChild to clear TextureHost. + */ + sync ClearTextureHostSync(); + /** * Asynchronously tell the Compositor side to remove the texture. */ async RemoveTexture(); - - /** - * Synchronously tell the compositor side to remove the texture. - */ - sync RemoveTextureSync(); }; } // layers