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

Side by Side Diff: chrome/browser/resources/vr_shell/vr_shell_ui_api.js

Issue 2696293002: Adds in-out easing type. (Closed)
Patch Set: MakeUnique, default value, comments Created 3 years, 10 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
« no previous file with comments | « chrome/browser/resources/vr_shell/vr_shell_ui.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 var api = {}; 5 var api = {};
6 6
7 /** 7 /**
8 * Enumeration of scene update commands. 8 * Enumeration of scene update commands.
9 * @enum {number} 9 * @enum {number}
10 * @const 10 * @const
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 334
335 /** 335 /**
336 * Enumeration of easing type. 336 * Enumeration of easing type.
337 * @enum {number} 337 * @enum {number}
338 * @const 338 * @const
339 */ 339 */
340 api.EasingType = { 340 api.EasingType = {
341 'LINEAR': 0, 341 'LINEAR': 0,
342 'CUBICBEZIER': 1, 342 'CUBICBEZIER': 1,
343 'EASEIN': 2, 343 'EASEIN': 2,
344 'EASEOUT': 3 344 'EASEOUT': 3,
345 'EASEINOUT': 4
345 }; 346 };
346 347
347 /** @const */ var DEFAULT_EASING_POW = 2; 348 /** @const */ var DEFAULT_EASING_POW = 2;
348 /** @const */ var DEFAULT_CUBIC_BEZIER_P1X = 0.25; 349 /** @const */ var DEFAULT_CUBIC_BEZIER_P1X = 0.25;
349 /** @const */ var DEFAULT_CUBIC_BEZIER_P1Y = 0; 350 /** @const */ var DEFAULT_CUBIC_BEZIER_P1Y = 0;
350 /** @const */ var DEFAULT_CUBIC_BEZIER_P2X = 0.75; 351 /** @const */ var DEFAULT_CUBIC_BEZIER_P2X = 0.75;
351 /** @const */ var DEFAULT_CUBIC_BEZIER_P2Y = 1; 352 /** @const */ var DEFAULT_CUBIC_BEZIER_P2Y = 1;
352 353
353 /** 354 /**
354 * Abstract easing base class. 355 * Abstract easing base class.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 } 388 }
388 } 389 }
389 390
390 api.OutEasing = class extends api.Easing { 391 api.OutEasing = class extends api.Easing {
391 constructor(pow = DEFAULT_EASING_POW) { 392 constructor(pow = DEFAULT_EASING_POW) {
392 super(api.EasingType.EASEOUT); 393 super(api.EasingType.EASEOUT);
393 this.pow = pow; 394 this.pow = pow;
394 } 395 }
395 } 396 }
396 397
398 api.InOutEasing = class extends api.Easing {
399 constructor(pow = DEFAULT_EASING_POW) {
cjgrant 2017/02/16 20:54:07 nit: On POW vs POWER: https://engdoc.corp.google.
400 super(api.EasingType.EASEINOUT);
401 this.pow = pow;
402 }
403 }
404
397 /** 405 /**
398 * Base animation class. An animation can vary only one object property. 406 * Base animation class. An animation can vary only one object property.
399 * @struct 407 * @struct
400 */ 408 */
401 api.Animation = class { 409 api.Animation = class {
402 constructor(elementId, durationMs) { 410 constructor(elementId, durationMs) {
403 /** @private {number} */ 411 /** @private {number} */
404 this.id = -1; 412 this.id = -1;
405 /** @private {number} */ 413 /** @private {number} */
406 this.meshId = elementId; 414 this.meshId = elementId;
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 if ('updateTab' in dict) { 637 if ('updateTab' in dict) {
630 this.onUpdateTab(dict['updateTabs']); 638 this.onUpdateTab(dict['updateTabs']);
631 } 639 }
632 if ('removeTab' in dict) { 640 if ('removeTab' in dict) {
633 this.onRemoveTab(dict['removeTab']); 641 this.onRemoveTab(dict['removeTab']);
634 } 642 }
635 643
636 this.onCommandHandlerFinished() 644 this.onCommandHandlerFinished()
637 } 645 }
638 }; 646 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/vr_shell/vr_shell_ui.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698