From 67f424d3826e702bcc578e3fa59761d4cd2736bc Mon Sep 17 00:00:00 2001 From: sotaro Date: Tue, 13 Dec 2022 01:01:15 +0000 Subject: [PATCH] Bug 1771344 - Add TextureClient::IsValid() check to PersistentBufferProviderShared::SetKnowsCompositor() r=gfx-reviewers,lsalzman Device reset in test_device_reset.html replaces CompositorBridgeChild to a new one. And shutting down old CompositorBridgeChild also destroys TextureClients. Differential Revision: https://phabricator.services.mozilla.com/D164175 --- gfx/layers/PersistentBufferProvider.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfx/layers/PersistentBufferProvider.cpp b/gfx/layers/PersistentBufferProvider.cpp index 1952d10044c9..5344f4909fb3 100644 --- a/gfx/layers/PersistentBufferProvider.cpp +++ b/gfx/layers/PersistentBufferProvider.cpp @@ -257,7 +257,7 @@ bool PersistentBufferProviderShared::SetKnowsCompositor( // Get rid of everything else Destroy(); - if (prevTexture) { + if (prevTexture && prevTexture->IsValid()) { RefPtr newTexture = CreateTexture(aKnowsCompositor, mFormat, mSize, mWillReadFrequently);