Bug 1293908 - Specify the LayersBackend to be used when creating Textures r=nical

This commit is contained in:
George Wright
2016-08-18 12:54:17 -04:00
parent 864177c1a4
commit 36fd9eb839
6 changed files with 66 additions and 22 deletions

View File

@@ -1111,7 +1111,8 @@ TextureClient::CreateForDrawing(TextureForwarder* aAllocator,
// Can't do any better than a buffer texture client.
return TextureClient::CreateForRawBufferAccess(aAllocator, aFormat, aSize,
moz2DBackend, aTextureFlags, aAllocFlags);
moz2DBackend, aLayersBackend,
aTextureFlags, aAllocFlags);
}
// static
@@ -1184,6 +1185,22 @@ TextureClient::CreateForRawBufferAccess(ClientIPCAllocator* aAllocator,
gfx::BackendType aMoz2DBackend,
TextureFlags aTextureFlags,
TextureAllocationFlags aAllocFlags)
{
auto fwd = aAllocator->AsCompositableForwarder();
auto backend = fwd ? fwd->GetCompositorBackendType() : LayersBackend::LAYERS_NONE;
return CreateForRawBufferAccess(aAllocator, aFormat, aSize, aMoz2DBackend,
backend, aTextureFlags, aAllocFlags);
}
// static
already_AddRefed<TextureClient>
TextureClient::CreateForRawBufferAccess(ClientIPCAllocator* aAllocator,
gfx::SurfaceFormat aFormat,
gfx::IntSize aSize,
gfx::BackendType aMoz2DBackend,
LayersBackend aLayersBackend,
TextureFlags aTextureFlags,
TextureAllocationFlags aAllocFlags)
{
// also test the validity of aAllocator
MOZ_ASSERT(aAllocator && aAllocator->IPCOpen());
@@ -1206,8 +1223,8 @@ TextureClient::CreateForRawBufferAccess(ClientIPCAllocator* aAllocator,
}
TextureData* texData = BufferTextureData::Create(aSize, aFormat, aMoz2DBackend,
aTextureFlags, aAllocFlags,
aAllocator);
aLayersBackend, aTextureFlags,
aAllocFlags, aAllocator);
if (!texData) {
return nullptr;
}