Move more compositor backend checks into gfxPlatform. (bug 1179051 part 4, r=mattwoodrow)

This commit is contained in:
David Anderson 2015-07-16 15:18:38 -07:00
parent a95f1bd843
commit 2d6d81d452
3 changed files with 12 additions and 10 deletions

View File

@ -135,10 +135,7 @@ CompositorD3D11::Initialize()
ScopedGfxFeatureReporter reporter("D3D11 Layers", force);
if (!gfxPlatform::CanUseDirect3D11()) {
NS_WARNING("Direct3D 11-accelerated layers are not supported on this system.");
return false;
}
MOZ_ASSERT(gfxPlatform::CanUseDirect3D11());
HRESULT hr;

View File

@ -45,10 +45,7 @@ CompositorD3D9::Initialize()
ScopedGfxFeatureReporter reporter("D3D9 Layers", force);
if (!gfxPlatform::CanUseDirect3D9()) {
NS_WARNING("Direct3D 9-accelerated layers are not supported on this system.");
return false;
}
MOZ_ASSERT(gfxPlatform::CanUseDirect3D9());
mDeviceManager = gfxWindowsPlatform::GetPlatform()->GetD3D9DeviceManager();
if (!mDeviceManager) {

View File

@ -2393,11 +2393,19 @@ gfxWindowsPlatform::GetAcceleratedCompositorBackends(nsTArray<LayersBackend>& aB
}
if (!gfxPrefs::LayersPreferD3D9()) {
aBackends.AppendElement(LayersBackend::LAYERS_D3D11);
if (gfxPlatform::CanUseDirect3D11() && GetD3D11Device()) {
aBackends.AppendElement(LayersBackend::LAYERS_D3D11);
} else {
NS_WARNING("Direct3D 11-accelerated layers are not supported on this system.");
}
}
if (gfxPrefs::LayersPreferD3D9() || !IsVistaOrLater()) {
// We don't want D3D9 except on Windows XP
aBackends.AppendElement(LayersBackend::LAYERS_D3D9);
if (gfxPlatform::CanUseDirect3D9()) {
aBackends.AppendElement(LayersBackend::LAYERS_D3D9);
} else {
NS_WARNING("Direct3D 9-accelerated layers are not supported on this system.");
}
}
}