| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 /** | 31 /** |
| 32 * @unrestricted | 32 * @unrestricted |
| 33 */ | 33 */ |
| 34 Timeline.TimelineEventOverview = class extends UI.TimelineOverviewBase { | 34 Timeline.TimelineEventOverview = class extends Perf_UI.TimelineOverviewBase { |
| 35 /** | 35 /** |
| 36 * @param {string} id | 36 * @param {string} id |
| 37 * @param {?string} title | 37 * @param {?string} title |
| 38 * @param {!TimelineModel.TimelineModel} model | 38 * @param {!TimelineModel.TimelineModel} model |
| 39 */ | 39 */ |
| 40 constructor(id, title, model) { | 40 constructor(id, title, model) { |
| 41 super(); | 41 super(); |
| 42 this.element.id = 'timeline-overview-' + id; | 42 this.element.id = 'timeline-overview-' + id; |
| 43 this.element.classList.add('overview-strip'); | 43 this.element.classList.add('overview-strip'); |
| 44 if (title) | 44 if (title) |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 } | 405 } |
| 406 } | 406 } |
| 407 }; | 407 }; |
| 408 | 408 |
| 409 /** | 409 /** |
| 410 * @unrestricted | 410 * @unrestricted |
| 411 */ | 411 */ |
| 412 Timeline.TimelineFilmStripOverview = class extends Timeline.TimelineEventOvervie
w { | 412 Timeline.TimelineFilmStripOverview = class extends Timeline.TimelineEventOvervie
w { |
| 413 /** | 413 /** |
| 414 * @param {!TimelineModel.TimelineModel} model | 414 * @param {!TimelineModel.TimelineModel} model |
| 415 * @param {!Components.FilmStripModel} filmStripModel | 415 * @param {!SDK.FilmStripModel} filmStripModel |
| 416 */ | 416 */ |
| 417 constructor(model, filmStripModel) { | 417 constructor(model, filmStripModel) { |
| 418 super('filmstrip', null, model); | 418 super('filmstrip', null, model); |
| 419 this._filmStripModel = filmStripModel; | 419 this._filmStripModel = filmStripModel; |
| 420 this.reset(); | 420 this.reset(); |
| 421 } | 421 } |
| 422 | 422 |
| 423 /** | 423 /** |
| 424 * @override | 424 * @override |
| 425 */ | 425 */ |
| (...skipping 12 matching lines...) Expand all Loading... |
| 438 return; | 438 return; |
| 439 var imageHeight = this.height() - 2 * Timeline.TimelineFilmStripOverview.P
adding; | 439 var imageHeight = this.height() - 2 * Timeline.TimelineFilmStripOverview.P
adding; |
| 440 var imageWidth = Math.ceil(imageHeight * image.naturalWidth / image.natura
lHeight); | 440 var imageWidth = Math.ceil(imageHeight * image.naturalWidth / image.natura
lHeight); |
| 441 var popoverScale = Math.min(200 / image.naturalWidth, 1); | 441 var popoverScale = Math.min(200 / image.naturalWidth, 1); |
| 442 this._emptyImage = new Image(image.naturalWidth * popoverScale, image.natu
ralHeight * popoverScale); | 442 this._emptyImage = new Image(image.naturalWidth * popoverScale, image.natu
ralHeight * popoverScale); |
| 443 this._drawFrames(imageWidth, imageHeight); | 443 this._drawFrames(imageWidth, imageHeight); |
| 444 }); | 444 }); |
| 445 } | 445 } |
| 446 | 446 |
| 447 /** | 447 /** |
| 448 * @param {!Components.FilmStripModel.Frame} frame | 448 * @param {!SDK.FilmStripModel.Frame} frame |
| 449 * @return {!Promise<!HTMLImageElement>} | 449 * @return {!Promise<!HTMLImageElement>} |
| 450 */ | 450 */ |
| 451 _imageByFrame(frame) { | 451 _imageByFrame(frame) { |
| 452 var imagePromise = this._frameToImagePromise.get(frame); | 452 var imagePromise = this._frameToImagePromise.get(frame); |
| 453 if (!imagePromise) { | 453 if (!imagePromise) { |
| 454 imagePromise = frame.imageDataPromise().then(createImage); | 454 imagePromise = frame.imageDataPromise().then(createImage); |
| 455 this._frameToImagePromise.set(frame, imagePromise); | 455 this._frameToImagePromise.set(frame, imagePromise); |
| 456 } | 456 } |
| 457 return imagePromise; | 457 return imagePromise; |
| 458 | 458 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 return element; | 548 return element; |
| 549 } | 549 } |
| 550 } | 550 } |
| 551 | 551 |
| 552 /** | 552 /** |
| 553 * @override | 553 * @override |
| 554 */ | 554 */ |
| 555 reset() { | 555 reset() { |
| 556 this._lastFrame = undefined; | 556 this._lastFrame = undefined; |
| 557 this._lastElement = null; | 557 this._lastElement = null; |
| 558 /** @type {!Map<!Components.FilmStripModel.Frame,!Promise<!HTMLImageElement>
>} */ | 558 /** @type {!Map<!SDK.FilmStripModel.Frame,!Promise<!HTMLImageElement>>} */ |
| 559 this._frameToImagePromise = new Map(); | 559 this._frameToImagePromise = new Map(); |
| 560 this._imageWidth = 0; | 560 this._imageWidth = 0; |
| 561 } | 561 } |
| 562 }; | 562 }; |
| 563 | 563 |
| 564 Timeline.TimelineFilmStripOverview.Padding = 2; | 564 Timeline.TimelineFilmStripOverview.Padding = 2; |
| 565 | 565 |
| 566 /** | 566 /** |
| 567 * @unrestricted | 567 * @unrestricted |
| 568 */ | 568 */ |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 counters[group] = this._quantDuration; | 778 counters[group] = this._quantDuration; |
| 779 this._callback(counters); | 779 this._callback(counters); |
| 780 interval -= this._quantDuration; | 780 interval -= this._quantDuration; |
| 781 } | 781 } |
| 782 this._counters = []; | 782 this._counters = []; |
| 783 this._counters[group] = interval; | 783 this._counters[group] = interval; |
| 784 this._lastTime = time; | 784 this._lastTime = time; |
| 785 this._remainder = this._quantDuration - interval; | 785 this._remainder = this._quantDuration - interval; |
| 786 } | 786 } |
| 787 }; | 787 }; |
| OLD | NEW |