Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Side by Side Diff: Source/devtools/front_end/elements/AnimationTimeline.js

Issue 1081753002: Devtools Animations: Support multiple frames in the animation timeline (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @constructor 6 * @constructor
7 * @extends {WebInspector.VBox} 7 * @extends {WebInspector.VBox}
8 */ 8 */
9 WebInspector.AnimationTimeline = function() 9 WebInspector.AnimationTimeline = function()
10 { 10 {
(...skipping 28 matching lines...) Expand all
39 { 39 {
40 /** 40 /**
41 * @param {!Event} event 41 * @param {!Event} event
42 * @this {WebInspector.AnimationTimeline} 42 * @this {WebInspector.AnimationTimeline}
43 */ 43 */
44 function playbackSliderInputHandler(event) 44 function playbackSliderInputHandler(event)
45 { 45 {
46 this._animationsPlaybackRate = WebInspector.AnimationsSidebarPane.Gl obalPlaybackRates[event.target.value]; 46 this._animationsPlaybackRate = WebInspector.AnimationsSidebarPane.Gl obalPlaybackRates[event.target.value];
47 var target = WebInspector.targetManager.mainTarget(); 47 var target = WebInspector.targetManager.mainTarget();
48 if (target) 48 if (target)
49 target.animationAgent().setPlaybackRate(this._animationsPlayback Rate); 49 target.animationModel.setPlaybackRate(this._animationsPlaybackRa te);
50 this._playbackLabel.textContent = this._animationsPlaybackRate + "x" ; 50 this._playbackLabel.textContent = this._animationsPlaybackRate + "x" ;
51 WebInspector.userMetrics.AnimationsPlaybackRateChanged.record(); 51 WebInspector.userMetrics.AnimationsPlaybackRateChanged.record();
52 if (this._scrubberPlayer) 52 if (this._scrubberPlayer)
53 this._scrubberPlayer.playbackRate = this._animationsPlaybackRate ; 53 this._scrubberPlayer.playbackRate = this._animationsPlaybackRate ;
54 } 54 }
55 55
56 var container = createElementWithClass("div", "animation-timeline-header "); 56 var container = createElementWithClass("div", "animation-timeline-header ");
57 var controls = container.createChild("div", "animation-controls"); 57 var controls = container.createChild("div", "animation-controls");
58 container.createChild("div", "animation-timeline-markers"); 58 container.createChild("div", "animation-timeline-markers");
59 59
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 if (!this._scrubberPlayer) 359 if (!this._scrubberPlayer)
360 return false; 360 return false;
361 361
362 this._originalScrubberTime = this._scrubberPlayer.currentTime; 362 this._originalScrubberTime = this._scrubberPlayer.currentTime;
363 this._timelineScrubber.classList.remove("animation-timeline-end"); 363 this._timelineScrubber.classList.remove("animation-timeline-end");
364 this._scrubberPlayer.pause(); 364 this._scrubberPlayer.pause();
365 this._originalMousePosition = new WebInspector.Geometry.Point(event.x, e vent.y); 365 this._originalMousePosition = new WebInspector.Geometry.Point(event.x, e vent.y);
366 366
367 var target = WebInspector.targetManager.mainTarget(); 367 var target = WebInspector.targetManager.mainTarget();
368 if (target) 368 if (target)
369 target.animationAgent().setPlaybackRate(0); 369 target.animationModel.setPlaybackRate(0);
370 return true; 370 return true;
371 }, 371 },
372 372
373 /** 373 /**
374 * @param {!Event} event 374 * @param {!Event} event
375 */ 375 */
376 _scrubberDragMove: function(event) 376 _scrubberDragMove: function(event)
377 { 377 {
378 var delta = event.x - this._originalMousePosition.x; 378 var delta = event.x - this._originalMousePosition.x;
379 this._scrubberPlayer.currentTime = Math.min(this._originalScrubberTime + delta / this.pixelMsRatio(), this.duration() - this._scrubberRadius / this.pixe lMsRatio()); 379 this._scrubberPlayer.currentTime = Math.min(this._originalScrubberTime + delta / this.pixelMsRatio(), this.duration() - this._scrubberRadius / this.pixe lMsRatio());
380 var currentTime = Math.max(0, Math.round(this._scrubberPlayer.currentTim e)); 380 var currentTime = Math.max(0, Math.round(this._scrubberPlayer.currentTim e));
381 this._timelineScrubberHead.textContent = WebInspector.UIString(Number.mi llisToString(currentTime)); 381 this._timelineScrubberHead.textContent = WebInspector.UIString(Number.mi llisToString(currentTime));
382 var targets = WebInspector.targetManager.targets(); 382 var targets = WebInspector.targetManager.targets();
383 for (var target of targets) 383 for (var target of targets)
384 target.animationAgent().setCurrentTime(/** @type {number} */(this.st artTime() + currentTime)); 384 target.animationAgent().setCurrentTime(/** @type {number} */(this.st artTime() + currentTime));
385 }, 385 },
386 386
387 /** 387 /**
388 * @param {!Event} event 388 * @param {!Event} event
389 */ 389 */
390 _scrubberDragEnd: function(event) 390 _scrubberDragEnd: function(event)
391 { 391 {
392 if (this._scrubberPlayer.currentTime < this.duration() - this._scrubberR adius / this.pixelMsRatio()) 392 if (this._scrubberPlayer.currentTime < this.duration() - this._scrubberR adius / this.pixelMsRatio())
393 this._scrubberPlayer.play(); 393 this._scrubberPlayer.play();
394 this._timelineScrubberHead.window().requestAnimationFrame(this._updateSc rubber.bind(this)); 394 this._timelineScrubberHead.window().requestAnimationFrame(this._updateSc rubber.bind(this));
395 var target = WebInspector.targetManager.mainTarget(); 395 var target = WebInspector.targetManager.mainTarget();
396 if (target) 396 if (target)
397 target.animationAgent().setPlaybackRate(this._animationsPlaybackRate ); 397 target.animationModel.setPlaybackRate(this._animationsPlaybackRate);
398 }, 398 },
399 399
400 __proto__: WebInspector.VBox.prototype 400 __proto__: WebInspector.VBox.prototype
401 } 401 }
402 402
403 /** 403 /**
404 * @constructor 404 * @constructor
405 * @param {!WebInspector.AnimationModel.AnimationNode} animationNode 405 * @param {!WebInspector.AnimationModel.AnimationNode} animationNode
406 */ 406 */
407 WebInspector.AnimationTimeline.NodeUI = function(animationNode) { 407 WebInspector.AnimationTimeline.NodeUI = function(animationNode) {
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 "Light Blue": WebInspector.Color.parse("#03A9F4"), 942 "Light Blue": WebInspector.Color.parse("#03A9F4"),
943 "Deep Orange": WebInspector.Color.parse("#FF5722"), 943 "Deep Orange": WebInspector.Color.parse("#FF5722"),
944 "Blue": WebInspector.Color.parse("#5677FC"), 944 "Blue": WebInspector.Color.parse("#5677FC"),
945 "Lime": WebInspector.Color.parse("#CDDC39"), 945 "Lime": WebInspector.Color.parse("#CDDC39"),
946 "Blue Grey": WebInspector.Color.parse("#607D8B"), 946 "Blue Grey": WebInspector.Color.parse("#607D8B"),
947 "Pink": WebInspector.Color.parse("#E91E63"), 947 "Pink": WebInspector.Color.parse("#E91E63"),
948 "Green": WebInspector.Color.parse("#0F9D58"), 948 "Green": WebInspector.Color.parse("#0F9D58"),
949 "Brown": WebInspector.Color.parse("#795548"), 949 "Brown": WebInspector.Color.parse("#795548"),
950 "Cyan": WebInspector.Color.parse("#00BCD4") 950 "Cyan": WebInspector.Color.parse("#00BCD4")
951 } 951 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/elements/AnimationControlPane.js ('k') | Source/devtools/front_end/sdk/AnimationModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698