Bug 718281 - Hide Tilt outro transition in a pref; r=rcampbell
authorVictor Porof <vporof@mozilla.com>
Mon, 16 Jan 2012 09:00:57 +0200
changeset 85045 ca5b6d4d1892ca81139768e09a867c37cf522481
parent 85044 66fcdc7716dcecd62e412b204333358607a03cc1
child 85046 96036564910e079cee268f427cc715a82cd8c407
push id21892
push userrcampbell@mozilla.com
push dateSat, 21 Jan 2012 15:34:29 +0000
treeherdermozilla-central@d43360499b86 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrcampbell
bugs718281
milestone12.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 718281 - Hide Tilt outro transition in a pref; r=rcampbell
browser/app/profile/firefox.js
browser/devtools/tilt/TiltVisualizer.jsm
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1027,16 +1027,18 @@ pref("devtools.errorconsole.enabled", fa
 pref("devtools.inspector.enabled", true);
 pref("devtools.inspector.htmlHeight", 112);
 
 // Enable the style inspector
 pref("devtools.styleinspector.enabled", true);
 
 // Enable the Tilt inspector
 pref("devtools.tilt.enabled", true);
+pref("devtools.tilt.intro_transition", true);
+pref("devtools.tilt.outro_transition", true);
 
 // Enable the rules view
 pref("devtools.ruleview.enabled", true);
 
 // Enable the Scratchpad tool.
 pref("devtools.scratchpad.enabled", true);
 
 // Enable the Style Editor.
--- a/browser/devtools/tilt/TiltVisualizer.jsm
+++ b/browser/devtools/tilt/TiltVisualizer.jsm
@@ -293,16 +293,24 @@ TiltVisualizer.Presenter = function TV_P
       this.redraw = false;
       this.drawVisualization();
     }
 
     // call the attached ondraw event handler if specified (by the controller)
     if ("function" === typeof this.ondraw) {
       this.ondraw();
     }
+
+    if (!TiltVisualizer.Prefs.introTransition && !this.isExecutingDestruction) {
+      this.frames = INTRO_TRANSITION_DURATION;
+    }
+    if (!TiltVisualizer.Prefs.outroTransition && this.isExecutingDestruction) {
+      this.frames = OUTRO_TRANSITION_DURATION;
+    }
+
     if ("function" === typeof this.onInitializationFinished &&
         this.frames === INTRO_TRANSITION_DURATION &&
        !this.isExecutingDestruction) {
       this.onInitializationFinished();
     }
     if ("function" === typeof this.onDestructionFinished &&
         this.frames === OUTRO_TRANSITION_DURATION &&
         this.isExecutingDestruction) {
@@ -1749,24 +1757,49 @@ TiltVisualizer.Prefs = {
   },
 
   set enabled(value)
   {
     TiltUtils.Preferences.set("enabled", "boolean", value);
     this._enabled = value;
   },
 
+  get introTransition()
+  {
+    return this._introTransition;
+  },
+
+  set introTransition(value)
+  {
+    TiltUtils.Preferences.set("intro_transition", "boolean", value);
+    this._introTransition = value;
+  },
+
+  get outroTransition()
+  {
+    return this._outroTransition;
+  },
+
+  set outroTransition(value)
+  {
+    TiltUtils.Preferences.set("outro_transition", "boolean", value);
+    this._outroTransition = value;
+  },
+
   /**
    * Loads the preferences.
    */
   load: function TVC_load()
   {
-    let prefs = TiltUtils.Preferences;
+    let prefs = TiltVisualizer.Prefs;
+    let get = TiltUtils.Preferences.get;
 
-    TiltVisualizer.Prefs._enabled = prefs.get("enabled", "boolean");
+    prefs._enabled = get("enabled", "boolean");
+    prefs._introTransition = get("intro_transition", "boolean");
+    prefs._outroTransition = get("outro_transition", "boolean");
   }
 };
 
 /**
  * A custom visualization shader.
  *
  * @param {Attribute} vertexPosition: the vertex position
  * @param {Attribute} vertexTexCoord: texture coordinates used by the sampler