Bug 1881738 - Don't send invalid remote texture owner id when WebGLChild is destroyed. r=aosmond

It seems like Canvas2D and WebGPU already avoid sending over invalid owner ids in GetFrontBuffer.
WebGL, however, can still blindly send an invalid texture owner id when the actor is being destroyed,
but the WebGL context is still alive.

Differential Revision: https://phabricator.services.mozilla.com/D206276
This commit is contained in:
Lee Salzman
2024-04-01 20:34:25 +00:00
parent afaf3e1b2a
commit 975610c0ab

View File

@@ -567,6 +567,11 @@ Maybe<layers::SurfaceDescriptor> ClientWebGLContext::GetFrontBuffer(
info.flushesSinceLastCongestionCheck = 0;
info.congestionCheckGeneration++;
// If the actor is destroyed, don't send over invalid texture owner id.
if (!child->CanSend()) {
return {};
}
return Some(layers::SurfaceDescriptorRemoteTexture(*mLastRemoteTextureId,
*mRemoteTextureOwnerId));
}