Bug 1202700 - Use d3d9 device to upload YCbCr surfaces on the client side if possible. r=Bas

--HG--
extra : rebase_source : ec496595f871e2e3fc54aae14ef01b25e6a4f9ff
This commit is contained in:
Matt Woodrow 2015-09-10 13:21:43 -04:00
Родитель ed728f3334
Коммит 284d1f503c
1 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -156,6 +156,9 @@ TextureClient*
IMFYCbCrImage::GetD3D9TextureClient(CompositableClient* aClient)
{
IDirect3DDevice9* device = gfxWindowsPlatform::GetPlatform()->GetD3D9Device();
if (!device) {
return nullptr;
}
RefPtr<IDirect3DTexture9> textureY;
HANDLE shareHandleY = 0;
@ -219,12 +222,12 @@ IMFYCbCrImage::GetD3D9TextureClient(CompositableClient* aClient)
TextureClient*
IMFYCbCrImage::GetTextureClient(CompositableClient* aClient)
{
LayersBackend backend = aClient->GetForwarder()->GetCompositorBackendType();
ID3D11Device* device = gfxWindowsPlatform::GetPlatform()->GetD3D11ImageBridgeDevice();
if (!device ||
aClient->GetForwarder()->GetCompositorBackendType() != LayersBackend::LAYERS_D3D11) {
IDirect3DDevice9* d3d9device = gfxWindowsPlatform::GetPlatform()->GetD3D9Device();
if (d3d9device && aClient->GetForwarder()->GetCompositorBackendType() == LayersBackend::LAYERS_D3D9) {
if (!device || backend != LayersBackend::LAYERS_D3D11) {
if (backend == LayersBackend::LAYERS_D3D9 ||
backend == LayersBackend::LAYERS_D3D11) {
return GetD3D9TextureClient(aClient);
}
return nullptr;