From 4f74031f0f635e5ffdf4bf54bb614ed738d85bd9 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 16 Jul 2015 14:45:06 -0700 Subject: [PATCH] Fix regression where WARP could be used as a fallback on Windows 7. (bug 1179051 part 2.1, r=jrmuizel) --HG-- extra : rebase_source : 0e7932489d2a91d4535047f5d9c59cee323a52cf --- gfx/thebes/gfxWindowsPlatform.cpp | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp index 916ffe23f107..ed5c0e8833b3 100755 --- a/gfx/thebes/gfxWindowsPlatform.cpp +++ b/gfx/thebes/gfxWindowsPlatform.cpp @@ -1914,12 +1914,6 @@ gfxWindowsPlatform::CheckD3D11Support() -> D3D11Status if (gfxPrefs::LayersD3D11DisableWARP() || GetModuleHandleA("nvdxgiwrap.dll")) { return D3D11Status::Blocked; } - - if (!IsWin8OrLater()) { - // We do not use WARP on Windows 7 or earlier. - return D3D11Status::Blocked; - } - return D3D11Status::TryWARP; } } @@ -1978,10 +1972,6 @@ gfxWindowsPlatform::AttemptD3D11DeviceCreation(const nsTArray bool gfxWindowsPlatform::AttemptWARPDeviceCreation(const nsTArray& aFeatureLevels) { - if (gfxPrefs::LayersD3D11DisableWARP()) { - return false; - } - MOZ_ASSERT(!mD3D11Device); ScopedGfxFeatureReporter reporterWARP("D3D11-WARP", gfxPrefs::LayersD3D11ForceWARP()); @@ -2102,11 +2092,16 @@ gfxWindowsPlatform::InitD3D11Devices() } } - if (status == D3D11Status::TryWARP || status == D3D11Status::ForceWARP) { - if (!AttemptWARPDeviceCreation(featureLevels)) { - // Nothing more we can do. - return; - } + if (IsWin8OrLater() && + !gfxPrefs::LayersD3D11DisableWARP() && + (status == D3D11Status::TryWARP || status == D3D11Status::ForceWARP)) + { + AttemptWARPDeviceCreation(featureLevels); + } + + if (!mD3D11Device) { + // We could not get a D3D11 compositor, and there's nothing more we can try. + return; } if (!mD3D11Device) {