Bug 1571838 - Backed out changeset a6f3fd30a0a7 (bug 1443181). r=jbonisteel
authorLee Salzman <lsalzman@mozilla.com>
Thu, 22 Aug 2019 15:15:08 +0000
changeset 489457 975f26e0fff1c7535a1d663130e12daf7fb12733
parent 489456 7340ca11674b4dad21a9b4eb505c6ecd7f3d6609
child 489458 da6c34e227b23a255555ef6d6b499316d11d9db7
push id93350
push userlsalzman@mozilla.com
push dateThu, 22 Aug 2019 15:16:21 +0000
treeherderautoland@975f26e0fff1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjbonisteel
bugs1571838, 1443181
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1571838 - Backed out changeset a6f3fd30a0a7 (bug 1443181). r=jbonisteel Differential Revision: https://phabricator.services.mozilla.com/D43080
gfx/gl/GLLibraryEGL.cpp
--- a/gfx/gl/GLLibraryEGL.cpp
+++ b/gfx/gl/GLLibraryEGL.cpp
@@ -275,16 +275,18 @@ class AngleErrorReporting {
  private:
   nsACString* mFailureId;
 };
 
 AngleErrorReporting gAngleErrorReporter;
 
 static EGLDisplay GetAndInitDisplayForAccelANGLE(
     GLLibraryEGL& egl, nsACString* const out_failureId) {
+  EGLDisplay ret = 0;
+
   if (wr::RenderThread::IsInRenderThread()) {
     return GetAndInitDisplayForWebRender(egl, EGL_DEFAULT_DISPLAY);
   }
 
   FeatureState& d3d11ANGLE = gfxConfig::GetFeature(Feature::D3D11_HW_ANGLE);
 
   if (!StaticPrefs::webgl_angle_try_d3d11()) {
     d3d11ANGLE.UserDisable("User disabled D3D11 ANGLE by pref",
@@ -298,31 +300,26 @@ static EGLDisplay GetAndInitDisplayForAc
 
   auto guardShutdown = mozilla::MakeScopeExit([&] {
     gAngleErrorReporter.SetFailureId(nullptr);
     // NOTE: Ideally we should be calling ANGLEPlatformShutdown after the
     //       ANGLE display is destroyed. However gAngleErrorReporter
     //       will live longer than the ANGLE display so we're fine.
   });
 
-  EGLDisplay ret = nullptr;
-  if (d3d11ANGLE.IsEnabled()) {
-    ret = egl.fGetDisplay(
-        EGL_DEFAULT_DISPLAY);  // This will try d3d11, then d3d9.
-  } else {
-    // D3D9-only.
-    const EGLint attribs[] = {LOCAL_EGL_PLATFORM_ANGLE_TYPE_ANGLE,
-                              LOCAL_EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE,
-                              LOCAL_EGL_NONE};
-    ret = egl.fGetPlatformDisplayEXT(LOCAL_EGL_PLATFORM_ANGLE_ANGLE,
-                                     EGL_DEFAULT_DISPLAY, attribs);
+  if (gfxConfig::IsForcedOnByUser(Feature::D3D11_HW_ANGLE)) {
+    return GetAndInitDisplay(egl, LOCAL_EGL_D3D11_ONLY_DISPLAY_ANGLE);
   }
 
-  if (ret && !egl.fInitialize(ret, nullptr, nullptr)) {
-    ret = nullptr;
+  if (d3d11ANGLE.IsEnabled()) {
+    ret = GetAndInitDisplay(egl, LOCAL_EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE);
+  }
+
+  if (!ret) {
+    ret = GetAndInitDisplay(egl, EGL_DEFAULT_DISPLAY);
   }
 
   if (!ret && out_failureId->IsEmpty()) {
     *out_failureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_ACCL_ANGLE_NO_DISP");
   }
 
   return ret;
 }