diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-08-01 20:45:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-01 20:45:58 +0200 |
commit | f8761cf8c5233f75123a7245a1e6a0aa12e22160 (patch) | |
tree | c85031f115b088d6b60af6f7ad34a9ca9a64a134 /toolkit/modules/Troubleshoot.jsm | |
parent | e79f2ee69455df701e559c10f8a9408fe8870281 (diff) | |
parent | d84ee90be10b67358a2a2340041337aec0cf04d8 (diff) | |
download | UXP-f8761cf8c5233f75123a7245a1e6a0aa12e22160.tar UXP-f8761cf8c5233f75123a7245a1e6a0aa12e22160.tar.gz UXP-f8761cf8c5233f75123a7245a1e6a0aa12e22160.tar.lz UXP-f8761cf8c5233f75123a7245a1e6a0aa12e22160.tar.xz UXP-f8761cf8c5233f75123a7245a1e6a0aa12e22160.zip |
Merge pull request #688 from janekptacijarabaci/about-support_WebGL-information_expand_1
Expand about:support WebGL information
Diffstat (limited to 'toolkit/modules/Troubleshoot.jsm')
-rw-r--r-- | toolkit/modules/Troubleshoot.jsm | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/toolkit/modules/Troubleshoot.jsm b/toolkit/modules/Troubleshoot.jsm index cea7c8f29..8d84eec8c 100644 --- a/toolkit/modules/Troubleshoot.jsm +++ b/toolkit/modules/Troubleshoot.jsm @@ -419,7 +419,13 @@ 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 + "DriverExtensions"] = "-"; + data[keyPrefix + "Extensions"] = "-"; + data[keyPrefix + "WSIInfo"] = "-"; + let canvas = doc.createElement("canvas"); canvas.width = 1; canvas.height = 1; @@ -446,16 +452,22 @@ var dataProviders = { creationError = e.toString(); } } - if (!gl) - return creationError || "(no info)"; + if (!gl) { + data[keyPrefix + "Renderer"] = creationError || "(no creation error info)"; + return; + } + data[keyPrefix + "Extensions"] = gl.getSupportedExtensions().join(" "); - 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 + "DriverExtensions"] = ext.getParameter(ext.EXTENSIONS); + data[keyPrefix + "WSIInfo"] = ext.getParameter(ext.WSI_INFO); // Eagerly free resources. @@ -463,14 +475,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(); |