зеркало из https://github.com/mozilla/gecko-dev.git
Bug 712868 - tilt does not honour webgl.force-enabled preference. r=bjacob,msucan
This commit is contained in:
Родитель
cd8b6bd718
Коммит
9001f693a7
|
@ -1033,9 +1033,6 @@ pref("devtools.styleinspector.enabled", true);
|
|||
// Enable the Tilt inspector
|
||||
pref("devtools.tilt.enabled", true);
|
||||
|
||||
// Enable the Tilt inspector even if WebGL capabilities are not detected
|
||||
pref("devtools.tilt.force-enabled", false);
|
||||
|
||||
// Enable the rules view
|
||||
pref("devtools.ruleview.enabled", true);
|
||||
|
||||
|
|
|
@ -271,7 +271,7 @@ Tilt.prototype = {
|
|||
get enabled()
|
||||
{
|
||||
return (TiltVisualizer.Prefs.enabled &&
|
||||
(TiltVisualizer.Prefs.forceEnabled || TiltGL.isWebGLSupported()));
|
||||
(TiltGL.isWebGLForceEnabled() || TiltGL.isWebGLSupported()));
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
*
|
||||
***** END LICENSE BLOCK *****/
|
||||
|
||||
/*global Components, TiltMath, TiltUtils, mat4 */
|
||||
/*global Components, Services, TiltMath, TiltUtils, mat4 */
|
||||
"use strict";
|
||||
|
||||
const Cc = Components.classes;
|
||||
|
@ -46,6 +46,7 @@ const Cu = Components.utils;
|
|||
|
||||
const WEBGL_CONTEXT_NAME = "experimental-webgl";
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource:///modules/devtools/TiltMath.jsm");
|
||||
Cu.import("resource:///modules/devtools/TiltUtils.jsm");
|
||||
|
||||
|
@ -1554,6 +1555,11 @@ TiltGL.ColorShader = {
|
|||
].join("\n")
|
||||
};
|
||||
|
||||
TiltGL.isWebGLForceEnabled = function TGL_isWebGLForceEnabled()
|
||||
{
|
||||
return Services.prefs.getBoolPref("webgl.force-enabled");
|
||||
};
|
||||
|
||||
/**
|
||||
* Tests if the WebGL OpenGL or Angle renderer is available using the
|
||||
* GfxInfo service.
|
||||
|
|
|
@ -1548,20 +1548,6 @@ TiltVisualizer.Prefs = {
|
|||
this._enabled = value;
|
||||
},
|
||||
|
||||
/**
|
||||
* Specifies if Tilt should be enabled even if WebGL may not be available.
|
||||
*/
|
||||
get forceEnabled()
|
||||
{
|
||||
return this._forceEnabled;
|
||||
},
|
||||
|
||||
set forceEnabled(value)
|
||||
{
|
||||
TiltUtils.Preferences.set("force-enabled", "boolean", value);
|
||||
this._forceEnabled = value;
|
||||
},
|
||||
|
||||
/**
|
||||
* Loads the preferences.
|
||||
*/
|
||||
|
@ -1570,7 +1556,6 @@ TiltVisualizer.Prefs = {
|
|||
let prefs = TiltUtils.Preferences;
|
||||
|
||||
TiltVisualizer.Prefs._enabled = prefs.get("enabled", "boolean");
|
||||
TiltVisualizer.Prefs._forceEnabled = prefs.get("force-enabled", "boolean");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -31,11 +31,6 @@ function test() {
|
|||
|
||||
is(Tilt.visualizers[id], null,
|
||||
"A instance of the visualizer shouldn't be initialized yet.");
|
||||
|
||||
is(typeof TiltVisualizer.Prefs.enabled, "boolean",
|
||||
"The 'enabled' pref should have been loaded by now.");
|
||||
is(typeof TiltVisualizer.Prefs.forceEnabled, "boolean",
|
||||
"The 'force-enabled' pref should have been loaded by now.");
|
||||
},
|
||||
onTiltOpen: function(instance)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче