summaryrefslogtreecommitdiff
path: root/toolkit/modules
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-08-01 08:58:59 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-08-01 08:58:59 +0200
commite7f7100ba6759f30295dbc49f819ebb9c4785298 (patch)
tree939f31b2484c41ec415e9eb56aee1c2934752e65 /toolkit/modules
parentddb2b976802181e05cb37a94480e9fb42ae6708a (diff)
downloaduxp-e7f7100ba6759f30295dbc49f819ebb9c4785298.tar.gz
Bug 1335296 - Expand about:support WebGL information
Diffstat (limited to 'toolkit/modules')
-rw-r--r--toolkit/modules/Troubleshoot.jsm31
-rw-r--r--toolkit/modules/tests/browser/browser_Troubleshoot.js20
2 files changed, 38 insertions, 13 deletions
diff --git a/toolkit/modules/Troubleshoot.jsm b/toolkit/modules/Troubleshoot.jsm
index cea7c8f29d..65342b6239 100644
--- a/toolkit/modules/Troubleshoot.jsm
+++ b/toolkit/modules/Troubleshoot.jsm
@@ -419,7 +419,12 @@ var dataProviders = {
.createInstance(Ci.nsIDOMParser)
.parseFromString("<html/>", "text/html");
- function GetWebGLInfo(contextType) {
+ function GetWebGLInfo(data, keyPrefix, contextType) {
+ data[keyPrefix + "Renderer"] = "-";
+ data[keyPrefix + "Version"] = "-";
+ data[keyPrefix + "Extensions"] = "-";
+ data[keyPrefix + "WSIInfo"] = "-";
+
let canvas = doc.createElement("canvas");
canvas.width = 1;
canvas.height = 1;
@@ -446,16 +451,21 @@ var dataProviders = {
creationError = e.toString();
}
}
- if (!gl)
- return creationError || "(no info)";
+ if (!gl) {
+ data[keyPrefix + "Renderer"] = creationError || "(no creation error info)";
+ return;
+ }
- let infoExt = gl.getExtension("WEBGL_debug_renderer_info");
+ let ext = gl.getExtension("MOZ_debug_get");
// 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 vendor = ext.getParameter(gl.VENDOR);
+ let renderer = ext.getParameter(gl.RENDERER);
- let contextInfo = vendor + " -- " + renderer;
+ data[keyPrefix + "Renderer"] = vendor + " -- " + renderer;
+ data[keyPrefix + "Version"] = ext.getParameter(gl.VERSION);
+ data[keyPrefix + "Extensions"] = ext.getParameter(ext.EXTENSIONS);
+ data[keyPrefix + "WSIInfo"] = ext.getParameter(ext.WSI_INFO);
// Eagerly free resources.
@@ -463,14 +473,11 @@ var dataProviders = {
if (loseExt) {
loseExt.loseContext();
}
-
-
- return contextInfo;
}
- data.webglRenderer = GetWebGLInfo("webgl");
- data.webgl2Renderer = GetWebGLInfo("webgl2");
+ GetWebGLInfo(data, "webgl1", "webgl");
+ GetWebGLInfo(data, "webgl2", "webgl2");
let infoInfo = gfxInfo.getInfo();
diff --git a/toolkit/modules/tests/browser/browser_Troubleshoot.js b/toolkit/modules/tests/browser/browser_Troubleshoot.js
index 7f0069dc91..e449e99a33 100644
--- a/toolkit/modules/tests/browser/browser_Troubleshoot.js
+++ b/toolkit/modules/tests/browser/browser_Troubleshoot.js
@@ -298,12 +298,30 @@ const SNAPSHOT_SCHEMA = {
clearTypeParameters: {
type: "string",
},
- webglRenderer: {
+ webgl1Renderer: {
+ type: "string",
+ },
+ webgl1Version: {
+ type: "string",
+ },
+ webgl1Extensions: {
+ type: "string",
+ },
+ webgl1WSIInfo: {
type: "string",
},
webgl2Renderer: {
type: "string",
},
+ webgl2Version: {
+ type: "string",
+ },
+ webgl2Extensions: {
+ type: "string",
+ },
+ webgl2WSIInfo: {
+ type: "string",
+ },
info: {
type: "object",
},