From 4e45e68439c9abed4fc15e2c7fd444789f23d2a7 Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Fri, 29 Apr 2016 14:39:51 -0400 Subject: [PATCH] Bug 1262427. Don't try D3D11 harder. r=dvander If we know D3D11 isn't going to work we shouldn't bother using it for ANGLE. --- gfx/gl/GLLibraryEGL.cpp | 2 +- gfx/thebes/gfxPlatform.cpp | 7 ------- gfx/thebes/gfxPlatform.h | 2 +- gfx/thebes/gfxWindowsPlatform.cpp | 6 ++++++ gfx/thebes/gfxWindowsPlatform.h | 4 ++++ 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/gfx/gl/GLLibraryEGL.cpp b/gfx/gl/GLLibraryEGL.cpp index 54d935dd0ccd..5bd37dd2ae04 100644 --- a/gfx/gl/GLLibraryEGL.cpp +++ b/gfx/gl/GLLibraryEGL.cpp @@ -179,7 +179,7 @@ GetAndInitDisplayForAccelANGLE(GLLibraryEGL& egl) return GetAndInitDisplay(egl, LOCAL_EGL_D3D11_ONLY_DISPLAY_ANGLE); if (gfxPrefs::WebGLANGLETryD3D11() && - gfxPlatform::CanUseDirect3D11ANGLE()) + gfxPlatform::GetPlatform()->CanUseDirect3D11ANGLE()) { ret = GetAndInitDisplay(egl, LOCAL_EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE); } diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index 163e6e266420..6bd9d6444d85 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -2173,13 +2173,6 @@ gfxPlatform::CanUseHardwareVideoDecoding() return sLayersSupportsHardwareVideoDecoding && !sLayersHardwareVideoDecodingFailed; } -bool -gfxPlatform::CanUseDirect3D11ANGLE() -{ - MOZ_ASSERT(sLayersAccelerationPrefsInitialized); - return gANGLESupportsD3D11; -} - bool gfxPlatform::AccelerateLayersByDefault() { diff --git a/gfx/thebes/gfxPlatform.h b/gfx/thebes/gfxPlatform.h index cb2f93e7e820..5e9d7ed42b59 100644 --- a/gfx/thebes/gfxPlatform.h +++ b/gfx/thebes/gfxPlatform.h @@ -451,7 +451,7 @@ public: static bool CanUseDirect3D9(); virtual bool CanUseHardwareVideoDecoding(); - static bool CanUseDirect3D11ANGLE(); + virtual bool CanUseDirect3D11ANGLE() { return false; } // Returns a prioritized list of all available compositor backends. void GetCompositorBackends(bool useAcceleration, nsTArray& aBackends); diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp index 8624984daa20..2613c14466d6 100755 --- a/gfx/thebes/gfxWindowsPlatform.cpp +++ b/gfx/thebes/gfxWindowsPlatform.cpp @@ -428,6 +428,12 @@ gfxWindowsPlatform::CanUseHardwareVideoDecoding() return !IsWARP() && gfxPlatform::CanUseHardwareVideoDecoding(); } +bool +gfxWindowsPlatform::CanUseDirect3D11ANGLE() +{ + return gANGLESupportsD3D11 && gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING); +} + bool gfxWindowsPlatform::InitDWriteSupport() { diff --git a/gfx/thebes/gfxWindowsPlatform.h b/gfx/thebes/gfxWindowsPlatform.h index 725cade47a0c..e26e00a8e5d8 100644 --- a/gfx/thebes/gfxWindowsPlatform.h +++ b/gfx/thebes/gfxWindowsPlatform.h @@ -97,6 +97,8 @@ struct ClearTypeParameterInfo { int32_t enhancedContrast; }; +extern bool gANGLESupportsD3D11; + class gfxWindowsPlatform : public gfxPlatform { public: enum TextRenderingMode { @@ -260,6 +262,8 @@ public: } bool SupportsPluginDirectDXGIDrawing(); + virtual bool CanUseDirect3D11ANGLE(); + protected: bool AccelerateLayersByDefault() override { return true;