Bug 1268638 - Bitrot. draft
authorJeff Gilbert <jgilbert@mozilla.com>
Tue, 21 Jun 2016 18:02:07 -0700
changeset 380728 c37be66ffb219b606c351a9eee86686116fbd2fd
parent 380419 1a2db6efc5750185357d0f1b803e319721db4bd6
child 380729 a5ff5c8a05398d4fe1ce680ec79e674c0386b770
push id21304
push userbmo:jgilbert@mozilla.com
push dateWed, 22 Jun 2016 22:06:38 +0000
bugs1268638
milestone50.0a1
Bug 1268638 - Bitrot. MozReview-Commit-ID: QJjb2PW5C4
dom/canvas/WebGLContext.cpp
widget/windows/GfxInfo.cpp
--- a/dom/canvas/WebGLContext.cpp
+++ b/dom/canvas/WebGLContext.cpp
@@ -587,72 +587,75 @@ BaseCaps(const WebGLContextOptions& opti
 ////////////////////////////////////////
 
 static already_AddRefed<gl::GLContext>
 CreateGLWithEGL(const gl::SurfaceCaps& caps, gl::CreateContextFlags flags,
                 WebGLContext* webgl,
                 std::vector<WebGLContext::FailureReason>* const out_failReasons)
 {
     const gfx::IntSize dummySize(16, 16);
+    nsCString failureId;
     RefPtr<GLContext> gl = gl::GLContextProviderEGL::CreateOffscreen(dummySize, caps,
-                                                                     flags, out_failureId);
+                                                                     flags, &failureId);
     if (gl && gl->IsANGLE()) {
         gl = nullptr;
     }
 
     if (!gl) {
         out_failReasons->push_back(WebGLContext::FailureReason(
-            "FEATURE_FAILURE_WEBGL_EGL_INIT",
+            failureId,
             "Error during EGL OpenGL init."
         ));
         return nullptr;
     }
 
     return gl.forget();
 }
 
 static already_AddRefed<GLContext>
 CreateGLWithANGLE(const gl::SurfaceCaps& caps, gl::CreateContextFlags flags,
                   WebGLContext* webgl,
                   std::vector<WebGLContext::FailureReason>* const out_failReasons)
 {
     const gfx::IntSize dummySize(16, 16);
+    nsCString failureId;
     RefPtr<GLContext> gl = gl::GLContextProviderEGL::CreateOffscreen(dummySize, caps,
-                                                                     flags, out_failureId);
+                                                                     flags, &failureId);
     if (gl && !gl->IsANGLE()) {
         gl = nullptr;
     }
 
     if (!gl) {
         out_failReasons->push_back(WebGLContext::FailureReason(
-            "FEATURE_FAILURE_WEBGL_ANGLE_INIT",
+            failureId,
             "Error during ANGLE OpenGL init."
         ));
         return nullptr;
     }
 
     return gl.forget();
 }
 
 static already_AddRefed<gl::GLContext>
 CreateGLWithDefault(const gl::SurfaceCaps& caps, gl::CreateContextFlags flags,
                     WebGLContext* webgl,
                     std::vector<WebGLContext::FailureReason>* const out_failReasons)
 {
     const gfx::IntSize dummySize(16, 16);
+    nsCString failureId;
     RefPtr<GLContext> gl = gl::GLContextProvider::CreateOffscreen(dummySize, caps,
-                                                                  flags, out_failureId);
+                                                                  flags, &failureId);
 
     if (gl && gl->IsANGLE()) {
         gl = nullptr;
     }
 
     if (!gl) {
         out_failReasons->push_back(WebGLContext::FailureReason(
-            "FEATURE_FAILURE_WEBGL_DEFAULT_INIT",
+            failureId,
             "Error during native OpenGL init."
         ));
         return nullptr;
     }
 
     return gl.forget();
 }
 
@@ -736,17 +739,17 @@ WebGLContext::CreateAndInitGL(bool force
 
         bool tryNativeGL = true;
 #ifdef XP_WIN
         if (gfxPrefs::WebGLDisableWGL()) {
             tryNativeGL = false;
         }
 #endif
         if (tryNativeGL) {
-            if (CreateAndInitGLWith(CreateGLWithNative, baseCaps, flags, out_failReasons))
+            if (CreateAndInitGLWith(CreateGLWithDefault, baseCaps, flags, out_failReasons))
                 return true;
         }
     }
 
     //////
 
     bool useANGLE = false;
 #ifdef XP_WIN
@@ -982,25 +985,27 @@ WebGLContext::SetDimensions(int32_t sign
             Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_FAILURE_ID,
                                   NS_LITERAL_CSTRING("FEATURE_FAILURE_PERF_WARP"));
             const nsLiteralCString text("failIfMajorPerformanceCaveat: Driver is not"
                                         " hardware-accelerated.");
             ThrowEvent_WebGLContextCreationError(text);
             return NS_ERROR_FAILURE;
         }
 
+#ifdef XP_WIN
         if (gl->GetContextType() == gl::GLContextType::WGL &&
             !gl::sWGLLib.HasDXInterop2())
         {
             gl = nullptr;
 
             const nsLiteralCString text("Caveat: WGL without DXGLInterop2.");
             ThrowEvent_WebGLContextCreationError(text);
             return NS_ERROR_FAILURE;
         }
+#endif
     }
 
     if (!ResizeBackbuffer(width, height)) {
         Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_FAILURE_ID,
                               NS_LITERAL_CSTRING("FEATURE_FAILURE_WEBGL_RESIZE"));
         const nsLiteralCString text("Initializing WebGL backbuffer failed.");
         ThrowEvent_WebGLContextCreationError(text);
         return NS_ERROR_FAILURE;
--- a/widget/windows/GfxInfo.cpp
+++ b/widget/windows/GfxInfo.cpp
@@ -1111,29 +1111,29 @@ GfxInfo::GetGfxDriverInfo()
       (nsAString&)GfxDriverInfo::GetDeviceVendor(VendorIntel), (GfxDeviceFamily*)GfxDriverInfo::GetDeviceFamily(IntelGMAX4500HD),
       nsIGfxInfo::FEATURE_DIRECT3D_11_ANGLE, nsIGfxInfo::FEATURE_BLOCKED_DEVICE,
       DRIVER_LESS_THAN, GfxDriverInfo::allDriverVersions, "FEATURE_FAILURE_BUG_1153381");
 
     ////////////////////////////////////
     // WebGL
 
     // Older than 5-15-2016
-    APPEND_TO_DRIVER_BLOCKLIST2(DRIVER_OS_ALL,
+    APPEND_TO_DRIVER_BLOCKLIST2(OperatingSystem::Windows,
       (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorAMD), GfxDriverInfo::allDevices,
       nsIGfxInfo::FEATURE_WEBGL_OPENGL, nsIGfxInfo::FEATURE_DISCOURAGED, DRIVER_LESS_THAN,
       V(16,200,1010,1002), "WEBGL_NATIVE_GL_OLD_AMD");
 
     // Older than 11-18-2015
-    APPEND_TO_DRIVER_BLOCKLIST2(DRIVER_OS_ALL,
+    APPEND_TO_DRIVER_BLOCKLIST2(OperatingSystem::Windows,
       (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorIntel), GfxDriverInfo::allDevices,
       nsIGfxInfo::FEATURE_WEBGL_OPENGL, nsIGfxInfo::FEATURE_DISCOURAGED, DRIVER_LESS_THAN,
       V(20,19,15,4331), "WEBGL_NATIVE_GL_OLD_INTEL");
 
     // Older than 2-23-2016
-    APPEND_TO_DRIVER_BLOCKLIST2(DRIVER_OS_ALL,
+    APPEND_TO_DRIVER_BLOCKLIST2(OperatingSystem::Windows,
       (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorNVIDIA), GfxDriverInfo::allDevices,
       nsIGfxInfo::FEATURE_WEBGL_OPENGL, nsIGfxInfo::FEATURE_DISCOURAGED, DRIVER_LESS_THAN,
       V(10,18,13,6200), "WEBGL_NATIVE_GL_OLD_NVIDIA");
 
   }
   return *mDriverInfo;
 }