diff --git a/dom/media/MediaData.cpp b/dom/media/MediaData.cpp index ed3e0b6ec946..ecc82be11a1b 100644 --- a/dom/media/MediaData.cpp +++ b/dom/media/MediaData.cpp @@ -323,7 +323,8 @@ VideoData::CreateAndCopyData(const VideoInfo& aInfo, // We disable this code path on Windows version earlier of Windows 8 due to // intermittent crashes with old drivers. See bug 1405110. if (IsWin8OrLater() && !XRE_IsParentProcess() && - aAllocator && aAllocator->SupportsD3D11()) { + aAllocator && aAllocator->GetCompositorBackendType() + == layers::LayersBackend::LAYERS_D3D11) { RefPtr d3d11Image = new layers::D3D11YCbCrImage(); PlanarYCbCrData data = ConstructPlanarYCbCrData(aInfo, aBuffer, aPicture); if (d3d11Image->SetData(layers::ImageBridgeChild::GetSingleton() diff --git a/dom/media/platforms/wmf/WMFVideoMFTManager.cpp b/dom/media/platforms/wmf/WMFVideoMFTManager.cpp index 523c66e161d1..2a7143ec1e5b 100644 --- a/dom/media/platforms/wmf/WMFVideoMFTManager.cpp +++ b/dom/media/platforms/wmf/WMFVideoMFTManager.cpp @@ -532,7 +532,11 @@ WMFVideoMFTManager::InitializeDXVA() return false; } MOZ_ASSERT(!mDXVA2Manager); - if (!mKnowsCompositor || !mKnowsCompositor->SupportsD3D11()) { + LayersBackend backend = GetCompositorBackendType(mKnowsCompositor); + bool useANGLE = + mKnowsCompositor ? mKnowsCompositor->GetCompositorUseANGLE() : false; + bool wrWithANGLE = (backend == LayersBackend::LAYERS_WR) && useANGLE; + if (backend != LayersBackend::LAYERS_D3D11 && !wrWithANGLE) { mDXVAFailureReason.AssignLiteral("Unsupported layers backend"); return false; } diff --git a/gfx/layers/ImageContainer.cpp b/gfx/layers/ImageContainer.cpp index f739fad1b176..3161a106f28c 100644 --- a/gfx/layers/ImageContainer.cpp +++ b/gfx/layers/ImageContainer.cpp @@ -477,7 +477,8 @@ ImageContainer::GetD3D11YCbCrRecycleAllocator(KnowsCompositor* aAllocator) device = gfx::DeviceManagerDx::Get()->GetCompositorDevice(); } - if (!device || !aAllocator->SupportsD3D11()) { + LayersBackend backend = aAllocator->GetCompositorBackendType(); + if (!device || backend != LayersBackend::LAYERS_D3D11) { return nullptr; } diff --git a/gfx/layers/ipc/KnowsCompositor.h b/gfx/layers/ipc/KnowsCompositor.h index 7baff176d0d3..23e1586eacae 100644 --- a/gfx/layers/ipc/KnowsCompositor.h +++ b/gfx/layers/ipc/KnowsCompositor.h @@ -94,12 +94,6 @@ public: return mTextureFactoryIdentifier.mSupportsComponentAlpha; } - bool SupportsD3D11() const - { - return GetCompositorBackendType() == layers::LayersBackend::LAYERS_D3D11 || - GetCompositorBackendType() == layers::LayersBackend::LAYERS_WR && GetCompositorUseANGLE(); - } - bool GetCompositorUseANGLE() const { return mTextureFactoryIdentifier.mCompositorUseANGLE;