Bug 1490415 - prevent creating a GPUVideoTextureHost with a null wrapped texture; r=sotaro
Differential Revision: https://phabricator.services.mozilla.com/D5563
This commit is contained in:
@@ -13,11 +13,11 @@ namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
GPUVideoTextureHost::GPUVideoTextureHost(TextureFlags aFlags,
|
||||
const SurfaceDescriptorGPUVideo& aDescriptor)
|
||||
TextureHost* aWrappedTextureHost)
|
||||
: TextureHost(aFlags)
|
||||
, mWrappedTextureHost(aWrappedTextureHost)
|
||||
{
|
||||
MOZ_COUNT_CTOR(GPUVideoTextureHost);
|
||||
mWrappedTextureHost = VideoBridgeParent::GetSingleton()->LookupTexture(aDescriptor.handle());
|
||||
}
|
||||
|
||||
GPUVideoTextureHost::~GPUVideoTextureHost()
|
||||
@@ -25,6 +25,19 @@ GPUVideoTextureHost::~GPUVideoTextureHost()
|
||||
MOZ_COUNT_DTOR(GPUVideoTextureHost);
|
||||
}
|
||||
|
||||
GPUVideoTextureHost*
|
||||
GPUVideoTextureHost::CreateFromDescriptor(
|
||||
TextureFlags aFlags,
|
||||
const SurfaceDescriptorGPUVideo& aDescriptor)
|
||||
{
|
||||
TextureHost* wrappedTextureHost =
|
||||
VideoBridgeParent::GetSingleton()->LookupTexture(aDescriptor.handle());
|
||||
if (!wrappedTextureHost) {
|
||||
return nullptr;
|
||||
}
|
||||
return new GPUVideoTextureHost(aFlags, wrappedTextureHost);
|
||||
}
|
||||
|
||||
bool
|
||||
GPUVideoTextureHost::Lock()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user