Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 Loading... | |
| 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 }; |
| OLD | NEW |