Bug 1268638 - Bitrot.
MozReview-Commit-ID: QJjb2PW5C4
--- 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;
}