mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
Bug 1898238 - Keep SharedSurface_EGLImages alive but do not recycle them. r=sotaro,jgilbert
We must ensure that a SharedSurface_EGLImage outlives its corresponding RenderEGLImageTextureHost, so that RenderEGLImageTextureHost does not attempt to wait on an EGLSync that has been destroyed. This can be achieved by passing the surface to RemoteTextureOwnerClient::PushTexture(), ensuring the RemoteTextureMap keeps it alive. However, we must be careful not to recycle the SharedSurface_EGLImage, as that is currently not supported. To achieve this, we make RemoteTextureMap::RecycleTexture() only recycle SharedSurfaces whose mDesc.canRecycle value is true. Differential Revision: https://phabricator.services.mozilla.com/D211292
This commit is contained in:
parent
34ec60f7ff
commit
dda2aa9413
@ -1377,6 +1377,7 @@ bool WebGLContext::PushRemoteTexture(
|
||||
case layers::SurfaceDescriptor::TSurfaceDescriptorMacIOSurface:
|
||||
case layers::SurfaceDescriptor::TSurfaceTextureDescriptor:
|
||||
case layers::SurfaceDescriptor::TSurfaceDescriptorAndroidHardwareBuffer:
|
||||
case layers::SurfaceDescriptor::TEGLImageDescriptor:
|
||||
case layers::SurfaceDescriptor::TSurfaceDescriptorDMABuf:
|
||||
keepAlive = surf;
|
||||
break;
|
||||
|
@ -324,6 +324,12 @@ bool RemoteTextureMap::RecycleTexture(
|
||||
RemoteTextureRecycleBin::RecycledTextureHolder recycled{info.size,
|
||||
info.format};
|
||||
if (aHolder.mResourceWrapper) {
|
||||
// Don't attempt to recycle non-recyclable shared surfaces
|
||||
if (aHolder.mResourceWrapper->mSharedSurface &&
|
||||
!aHolder.mResourceWrapper->mSharedSurface->mDesc.canRecycle) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Recycle shared texture
|
||||
SurfaceDescriptor desc;
|
||||
if (!aHolder.mTextureData->Serialize(desc)) {
|
||||
|
Loading…
Reference in New Issue
Block a user