diff --git a/dom/canvas/moz.build b/dom/canvas/moz.build index c58a2e68ab9..ffa942025ce 100644 --- a/dom/canvas/moz.build +++ b/dom/canvas/moz.build @@ -7,7 +7,7 @@ TEST_DIRS += ['compiledtest'] # Number changes to this file to avoid bug 1081323 (clobber after changing a manifest): -# 2 +# 3 MOCHITEST_MANIFESTS += [ 'test/crossorigin/mochitest.ini', diff --git a/dom/canvas/test/webgl-mochitest.ini b/dom/canvas/test/webgl-mochitest.ini index bca7eca5fa3..d6cd17dd6b4 100644 --- a/dom/canvas/test/webgl-mochitest.ini +++ b/dom/canvas/test/webgl-mochitest.ini @@ -30,13 +30,13 @@ skip-if = android_version == '10' || android_version == '18' #Android 2.3 and 4. [webgl-mochitest/test_texsubimage_float.html] [webgl-mochitest/test_uninit_data.html] [webgl-mochitest/test_webgl_available.html] -skip-if = toolkit == 'android' #bug 865443- seperate suite - the non_conf* tests pass except for one on armv6 tests #[webgl-mochitest/test_webgl_color_buffer_float.html] # We haven't cleaned up the Try results yet, but let's get this on the books first. [webgl-mochitest/test_webgl_conformance.html] skip-if = toolkit == 'android' #bug 865443- seperate suite - the non_conf* tests pass except for one on armv6 tests [webgl-mochitest/test_webgl_compressed_texture_es3.html] [webgl-mochitest/test_webgl_disjoint_timer_query.html] +[webgl-mochitest/test_webgl_force_enable.html] [webgl-mochitest/test_webgl_request_context.html] skip-if = toolkit == 'android' #bug 865443- seperate suite - the non_conf* tests pass except for one on armv6 tests [webgl-mochitest/test_webgl_request_mismatch.html] diff --git a/dom/canvas/test/webgl-mochitest/test_webgl_available.html b/dom/canvas/test/webgl-mochitest/test_webgl_available.html index 4b4611dd2db..f6817c98582 100644 --- a/dom/canvas/test/webgl-mochitest/test_webgl_available.html +++ b/dom/canvas/test/webgl-mochitest/test_webgl_available.html @@ -1,50 +1,19 @@ - -WebGL test: Check that WebGL works (or not) if it should (or should not). - - - - - - - - + + + + - + + diff --git a/dom/canvas/test/webgl-mochitest/test_webgl_force_enable.html b/dom/canvas/test/webgl-mochitest/test_webgl_force_enable.html new file mode 100644 index 00000000000..4b4611dd2db --- /dev/null +++ b/dom/canvas/test/webgl-mochitest/test_webgl_force_enable.html @@ -0,0 +1,50 @@ + + + +WebGL test: Check that WebGL works (or not) if it should (or should not). + + + + + + + + + + diff --git a/gfx/gl/GLLibraryEGL.cpp b/gfx/gl/GLLibraryEGL.cpp index 585324a3b97..3b8370b7750 100644 --- a/gfx/gl/GLLibraryEGL.cpp +++ b/gfx/gl/GLLibraryEGL.cpp @@ -153,6 +153,34 @@ GetAndInitDisplay(GLLibraryEGL& egl, void* displayType) return display; } +static EGLDisplay +GetAndInitDisplayForAccelANGLE(GLLibraryEGL& egl) +{ + EGLDisplay ret = 0; + + // D3D11 ANGLE only works with OMTC; there's a bug in the non-OMTC layer + // manager, and it's pointless to try to fix it. We also don't try + // D3D11 ANGLE if the layer manager is prefering D3D9 (hrm, do we care?) + if (gfxPrefs::LayersOffMainThreadCompositionEnabled() && + !gfxPrefs::LayersPreferD3D9()) + { + if (gfxPrefs::WebGLANGLEForceD3D11()) + return GetAndInitDisplay(egl, LOCAL_EGL_D3D11_ONLY_DISPLAY_ANGLE); + + if (gfxPrefs::WebGLANGLETryD3D11() && + gfxPlatform::CanUseDirect3D11ANGLE()) + { + ret = GetAndInitDisplay(egl, LOCAL_EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE); + } + } + + if (!ret) { + ret = GetAndInitDisplay(egl, EGL_DEFAULT_DISPLAY); + } + + return ret; +} + bool GLLibraryEGL::ReadbackEGLImage(EGLImage image, gfx::DataSourceSurface* out_surface) { @@ -367,30 +395,14 @@ GLLibraryEGL::EnsureInitialized(bool forceAccel) if (!chosenDisplay) { // If falling back to WARP did not work and we don't want to try - // using HW accelerated ANGLE, then fail + // using HW accelerated ANGLE, then fail. if (!shouldTryAccel) { NS_ERROR("Fallback WARP ANGLE context failed to initialize."); return false; } // Hardware accelerated ANGLE path - - // D3D11 ANGLE only works with OMTC; there's a bug in the non-OMTC layer - // manager, and it's pointless to try to fix it. We also don't try - // D3D11 ANGLE if the layer manager is prefering D3D9 (hrm, do we care?) - if (gfxPrefs::LayersOffMainThreadCompositionEnabled() && - !gfxPrefs::LayersPreferD3D9()) - { - if (gfxPrefs::WebGLANGLEForceD3D11()) { - chosenDisplay = GetAndInitDisplay(*this, - LOCAL_EGL_D3D11_ONLY_DISPLAY_ANGLE); - } else if (gfxPrefs::WebGLANGLETryD3D11() && - gfxPlatform::CanUseDirect3D11ANGLE()) - { - chosenDisplay = GetAndInitDisplay(*this, - LOCAL_EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE); - } - } + chosenDisplay = GetAndInitDisplayForAccelANGLE(*this); } } else { chosenDisplay = GetAndInitDisplay(*this, EGL_DEFAULT_DISPLAY);