Bug 1366502 - Make sure all wrapped textureHosts doesn't use TextureFlags::DEALLOCATE_CLIENT flag. v2. r=sotaro

MozReview-Commit-ID: KjZIGRzRomT
This commit is contained in:
JerryShih 2017-06-07 23:44:05 +08:00
parent 2075e5b4a5
commit efa30c7964

View File

@ -27,6 +27,15 @@ WebRenderTextureHost::WebRenderTextureHost(const SurfaceDescriptor& aDesc,
, mExternalImageId(aExternalImageId)
, mIsWrappingNativeHandle(false)
{
// The wrapped textureHost will be used in WebRender, and the WebRender could
// run at another thread. It's hard to control the life-time when gecko
// receives PTextureParent destroy message. It's possible that textureHost is
// still used by WebRender. So, we only accept the textureHost without
// DEALLOCATE_CLIENT flag here. If the buffer deallocation is controlled by
// parent, we could do something to make sure the wrapped textureHost is not
// used by WebRender and then release it.
MOZ_ASSERT(!(aFlags & TextureFlags::DEALLOCATE_CLIENT));
MOZ_COUNT_CTOR(WebRenderTextureHost);
mWrappedTextureHost = aTexture;