Bug 1285661 - Add WebGL2 to about:support. - r=jrmuizel
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -361,16 +361,17 @@ var snapshotFormatters = {
delete data.numAcceleratedWindows;
delete data.numAcceleratedWindowsMessage;
addRow("features", "asyncPanZoom",
apzInfo.length
? apzInfo.join("; ")
: localizedMsg(["apzNone"]));
addRowFromKey("features", "webglRenderer");
+ addRowFromKey("features", "webgl2Renderer");
addRowFromKey("features", "supportsHardwareH264", "hardwareH264");
addRowFromKey("features", "direct2DEnabled", "#Direct2D");
if ("directWriteEnabled" in data) {
let message = data.directWriteEnabled;
if ("directWriteVersion" in data)
message += " (" + data.directWriteVersion + ")";
addRow("features", "#DirectWrite", message);
--- a/toolkit/locales/en-US/chrome/global/aboutSupport.properties
+++ b/toolkit/locales/en-US/chrome/global/aboutSupport.properties
@@ -45,18 +45,18 @@ tryNewerDriver = Blocked for your graphi
blockedGfxCard = Blocked for your graphics card because of unresolved driver issues.
# LOCALIZATION NOTE The verb "blocked" here refers to a graphics feature such as "Direct2D" or "OpenGL layers".
blockedOSVersion = Blocked for your operating system version.
# LOCALIZATION NOTE The verb "blocked" here refers to a graphics feature such as "Direct2D" or "OpenGL layers".
blockedMismatchedVersion = Blocked for your graphics driver version mismatch between registry and DLL.
-# LOCALIZATION NOTE In the following strings, "Direct2D", "DirectWrite" and "ClearType"
-# are proper nouns and should not be translated. Feel free to leave english strings if
+# LOCALIZATION NOTE In the following strings, "Direct2D", "DirectWrite" and "ClearType"
+# are proper nouns and should not be translated. Feel free to leave english strings if
# there are no good translations, these are only used in about:support
clearTypeParameters = ClearType Parameters
compositing = Compositing
hardwareH264 = Hardware H264 Decoding
mainThreadNoOMTC = main thread, no OMTC
yes = Yes
no = No
@@ -66,16 +66,17 @@ gpuVendorID = Vendor ID
gpuDeviceID = Device ID
gpuSubsysID = Subsys ID
gpuDrivers = Drivers
gpuRAM = RAM
gpuDriverVersion = Driver Version
gpuDriverDate = Driver Date
gpuActive = Active
webglRenderer = WebGL Renderer
+webgl2Renderer = WebGL2 Renderer
GPU1 = GPU #1
GPU2 = GPU #2
blocklistedBug = Blocklisted due to known issues
# LOCALIZATION NOTE %1$S will be replaced with a bug number string.
bugLink = bug %1$S
# LOCALIZATION NOTE %1$S will be replaced with an arbitrary identifier
# string that can be searched on DXR/MXR or grepped in the source tree.
unknownFailure = Blocklisted; failure code %1$S
--- a/toolkit/modules/Troubleshoot.jsm
+++ b/toolkit/modules/Troubleshoot.jsm
@@ -415,54 +415,73 @@ var dataProviders = {
}
catch (e) {}
}
if (("direct2DEnabled" in data) && !data.direct2DEnabled)
data.direct2DEnabledMessage =
statusMsgForFeature(Ci.nsIGfxInfo.FEATURE_DIRECT2D);
+ //////
+
let doc =
Cc["@mozilla.org/xmlextras/domparser;1"]
.createInstance(Ci.nsIDOMParser)
.parseFromString("<html/>", "text/html");
- let canvas = doc.createElement("canvas");
- canvas.width = 1;
- canvas.height = 1;
+ function GetWebGLInfo(contextType) {
+ let canvas = doc.createElement("canvas");
+ canvas.width = 1;
+ canvas.height = 1;
+
+ ///////
+
+ let creationError = "(no info)";
+
+ canvas.addEventListener(
+ "webglcontextcreationerror",
- let gl;
- try {
- gl = canvas.getContext("experimental-webgl");
- } catch(e) {}
+ function(e) {
+ creationError = e.statusMessage;
+ },
+
+ false
+ );
+
+ let gl = canvas.getContext(contextType);
+ if (!gl)
+ return creationError;
+
+ ///////
- if (gl) {
- let ext = gl.getExtension("WEBGL_debug_renderer_info");
- // this extension is unconditionally available to chrome. No need to check.
- data.webglRenderer = gl.getParameter(ext.UNMASKED_VENDOR_WEBGL)
- + " -- "
- + gl.getParameter(ext.UNMASKED_RENDERER_WEBGL);
- } else {
- let feature;
- if (AppConstants.platform == "win") {
- // If ANGLE is not available but OpenGL is, we want to report on the
- // OpenGL feature, because that's what's going to get used. In all
- // other cases we want to report on the ANGLE feature.
- let angle = gfxInfo.getFeatureStatus(gfxInfo.FEATURE_WEBGL_ANGLE) ==
- gfxInfo.FEATURE_STATUS_OK;
- let opengl = gfxInfo.getFeatureStatus(gfxInfo.FEATURE_WEBGL_OPENGL) ==
- gfxInfo.FEATURE_STATUS_OK;
- feature = !angle && opengl ? gfxInfo.FEATURE_WEBGL_OPENGL :
- gfxInfo.FEATURE_WEBGL_ANGLE;
- } else {
- feature = gfxInfo.FEATURE_WEBGL_OPENGL;
- }
- data.webglRendererMessage = statusMsgForFeature(feature);
+ let infoExt = gl.getExtension("WEBGL_debug_renderer_info");
+ // This extension is unconditionally available to chrome. No need to check.
+ let vendor = gl.getParameter(infoExt.UNMASKED_VENDOR_WEBGL);
+ let renderer = gl.getParameter(infoExt.UNMASKED_RENDERER_WEBGL);
+
+ let contextInfo = vendor + " -- " + renderer;
+
+ ///////
+
+ // Eagerly free resources.
+ let loseExt = gl.getExtension("WEBGL_lose_context");
+ loseExt.loseContext();
+
+ ///////
+
+ return contextInfo;
}
+ //////
+
+ data.webglRenderer = GetWebGLInfo("webgl");
+ data.webgl2Renderer = GetWebGLInfo("webgl2");
+
+ //////
+
let infoInfo = gfxInfo.getInfo();
if (infoInfo)
data.info = infoInfo;
let failureCount = {};
let failureIndices = {};
let failures = gfxInfo.getFailures(failureCount, failureIndices);
--- a/toolkit/modules/tests/browser/browser_Troubleshoot.js
+++ b/toolkit/modules/tests/browser/browser_Troubleshoot.js
@@ -292,16 +292,19 @@ const SNAPSHOT_SCHEMA = {
type: "string",
},
clearTypeParameters: {
type: "string",
},
webglRenderer: {
type: "string",
},
+ webgl2Renderer: {
+ type: "string",
+ },
info: {
type: "object",
},
failures: {
type: "array",
items: {
type: "string",
},
@@ -310,19 +313,16 @@ const SNAPSHOT_SCHEMA = {
type: "object",
},
crashGuards: {
type: "array",
},
direct2DEnabledMessage: {
type: "array",
},
- webglRendererMessage: {
- type: "array",
- },
},
},
javaScript: {
required: true,
type: "object",
properties: {
incrementalGCEnabled: {
type: "boolean",