diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 98e3a5a2d543..65bc015462df 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -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); diff --git a/browser/devtools/tilt/Tilt.jsm b/browser/devtools/tilt/Tilt.jsm index 9e7d9b648aaa..2b31ec3f13b7 100644 --- a/browser/devtools/tilt/Tilt.jsm +++ b/browser/devtools/tilt/Tilt.jsm @@ -271,7 +271,7 @@ Tilt.prototype = { get enabled() { return (TiltVisualizer.Prefs.enabled && - (TiltVisualizer.Prefs.forceEnabled || TiltGL.isWebGLSupported())); + (TiltGL.isWebGLForceEnabled() || TiltGL.isWebGLSupported())); }, /** diff --git a/browser/devtools/tilt/TiltGL.jsm b/browser/devtools/tilt/TiltGL.jsm index cf5d2895fc7a..084a5c33a4dc 100644 --- a/browser/devtools/tilt/TiltGL.jsm +++ b/browser/devtools/tilt/TiltGL.jsm @@ -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. diff --git a/browser/devtools/tilt/TiltVisualizer.jsm b/browser/devtools/tilt/TiltVisualizer.jsm index 17f4219c586a..a80287808d4a 100644 --- a/browser/devtools/tilt/TiltVisualizer.jsm +++ b/browser/devtools/tilt/TiltVisualizer.jsm @@ -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"); } }; diff --git a/browser/devtools/tilt/test/browser_tilt_04_initialization.js b/browser/devtools/tilt/test/browser_tilt_04_initialization.js index 2b68c1db1946..cb587d9669ce 100644 --- a/browser/devtools/tilt/test/browser_tilt_04_initialization.js +++ b/browser/devtools/tilt/test/browser_tilt_04_initialization.js @@ -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) {