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

--HG--
extra : rebase_source : 887ed513fc50f2c1ee560ffa4a795b5c847154fe
This commit is contained in:
David Anderson 2015-07-16 15:18:38 -07:00
Родитель 65475c97d0
Коммит ba1e3c52d9
3 изменённых файлов: 12 добавлений и 10 удалений

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

@ -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;

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

@ -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) {

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

@ -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.");
}
}
}