Bug 1107299: Only block shared surface usage when that is broken. r=jrmuizel

Currently when the usage of surface sharing is broken on certain drivers, be block D3D11 entirely and fall back to Basic composition. There's no real benefit in this case from disabling D3D11 entirely, and we might as well just use it with software composition like we do when we don't have Direct2D, and in addition to that disable texture sharing for webGL, falling back to slow WebGL which again is no worse than the situation when using Basic or D3D9 composition.
This commit is contained in:
Bas Schouten 2014-12-06 00:02:18 +00:00
Родитель 184e84297b
Коммит 76753982e0
2 изменённых файлов: 6 добавлений и 14 удалений

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

@ -21,6 +21,7 @@
#ifdef XP_WIN #ifdef XP_WIN
#include "SharedSurfaceANGLE.h" // for SurfaceFactory_ANGLEShareHandle #include "SharedSurfaceANGLE.h" // for SurfaceFactory_ANGLEShareHandle
#include "gfxWindowsPlatform.h"
#endif #endif
#ifdef MOZ_WIDGET_GONK #ifdef MOZ_WIDGET_GONK
@ -110,7 +111,7 @@ ClientCanvasLayer::Initialize(const Data& aData)
case mozilla::layers::LayersBackend::LAYERS_D3D10: case mozilla::layers::LayersBackend::LAYERS_D3D10:
case mozilla::layers::LayersBackend::LAYERS_D3D11: { case mozilla::layers::LayersBackend::LAYERS_D3D11: {
#ifdef XP_WIN #ifdef XP_WIN
if (mGLContext->IsANGLE()) { if (mGLContext->IsANGLE() && DoesD3D11DeviceWork(gfxWindowsPlatform::GetPlatform()->GetD3D11Device())) {
factory = SurfaceFactory_ANGLEShareHandle::Create(mGLContext, caps); factory = SurfaceFactory_ANGLEShareHandle::Create(mGLContext, caps);
} }
#endif #endif

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

@ -6773,20 +6773,11 @@ nsWindow::GetPreferredCompositorBackends(nsTArray<LayersBackend>& aHints)
} }
ID3D11Device* device = gfxWindowsPlatform::GetPlatform()->GetD3D11Device(); ID3D11Device* device = gfxWindowsPlatform::GetPlatform()->GetD3D11Device();
if (device &&
device->GetFeatureLevel() >= D3D_FEATURE_LEVEL_10_0 && if (!prefs.mPreferD3D9) {
!DoesD3D11DeviceWork(device)) { aHints.AppendElement(LayersBackend::LAYERS_D3D11);
// bug 1083071 - bad things - fall back to basic layers
// This should not happen aside from driver bugs, and in particular
// should not happen on our test machines, so let's NS_ERROR to ensure
// that we would catch it as a test failure.
NS_ERROR("Can't use Direct3D 11 because of a driver bug");
} else {
if (!prefs.mPreferD3D9) {
aHints.AppendElement(LayersBackend::LAYERS_D3D11);
}
aHints.AppendElement(LayersBackend::LAYERS_D3D9);
} }
aHints.AppendElement(LayersBackend::LAYERS_D3D9);
} }
aHints.AppendElement(LayersBackend::LAYERS_BASIC); aHints.AppendElement(LayersBackend::LAYERS_BASIC);
} }