mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-13 18:27:35 +00:00
Bug 1783923 - Ensure WebRenderImageHost::OnReleased() is called during WebRenderBridgeParent shutdown r=gfx-reviewers,lsalzman
If WebRenderImageHost::OnReleased() is called on all WebRenderImageHosts before RemoteTextureMap::Shutdown(), RemoteTextureMap does not own a reference of WebRenderImageHost during the shutdown. On current gecko, when WebRenderImageHost is released by WebRenderBridgeParent::Destroy(), WebRenderImageHost::OnReleased() is not called. It needs to be addressed. And RemoteTextureMap::Shutdown() need to be called after CompositorThreadHolder::Shutdown(). By it, we could expect that WebRenderBridgeParent::Destroy() is called on all WebRenderBridgeParents. Differential Revision: https://phabricator.services.mozilla.com/D155673
This commit is contained in:
parent
700d2d5ffb
commit
7e5059e7a3
@ -691,8 +691,8 @@ void GPUParent::ActorDestroy(ActorDestroyReason aWhy) {
|
||||
// This could be running on either the Compositor or the Renderer
|
||||
// thread.
|
||||
CanvasManagerParent::Shutdown();
|
||||
RemoteTextureMap::Shutdown();
|
||||
CompositorThreadHolder::Shutdown();
|
||||
RemoteTextureMap::Shutdown();
|
||||
// There is a case that RenderThread exists when gfxVars::UseWebRender()
|
||||
// is false. This could happen when WebRender was fallbacked to
|
||||
// compositor.
|
||||
|
@ -412,6 +412,9 @@ void WebRenderBridgeParent::Destroy() {
|
||||
mWebRenderBridgeRef->Clear();
|
||||
mWebRenderBridgeRef = nullptr;
|
||||
}
|
||||
for (const auto& entry : mCompositables) {
|
||||
entry.second->OnReleased();
|
||||
}
|
||||
mCompositables.clear();
|
||||
ClearResources();
|
||||
}
|
||||
|
@ -33,7 +33,10 @@ WebRenderImageHost::WebRenderImageHost(const TextureInfo& aTextureInfo)
|
||||
ImageComposite(),
|
||||
mCurrentAsyncImageManager(nullptr) {}
|
||||
|
||||
WebRenderImageHost::~WebRenderImageHost() { MOZ_ASSERT(mWrBridges.empty()); }
|
||||
WebRenderImageHost::~WebRenderImageHost() {
|
||||
MOZ_ASSERT(!mRemoteTextureConsumer);
|
||||
MOZ_ASSERT(mWrBridges.empty());
|
||||
}
|
||||
|
||||
void WebRenderImageHost::OnReleased() {
|
||||
if (mRemoteTextureConsumer) {
|
||||
|
@ -1344,9 +1344,9 @@ void gfxPlatform::ShutdownLayersIPC() {
|
||||
layers::ImageBridgeChild::ShutDown();
|
||||
// This could be running on either the Compositor or the Renderer thread.
|
||||
gfx::CanvasManagerParent::Shutdown();
|
||||
RemoteTextureMap::Shutdown();
|
||||
// This has to happen after shutting down the child protocols.
|
||||
layers::CompositorThreadHolder::Shutdown();
|
||||
RemoteTextureMap::Shutdown();
|
||||
image::ImageMemoryReporter::ShutdownForWebRender();
|
||||
// There is a case that RenderThread exists when UseWebRender() is
|
||||
// false. This could happen when WebRender was fallbacked to compositor.
|
||||
|
Loading…
Reference in New Issue
Block a user