OLD | NEW |
1 /** | 1 /** |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 return; | 517 return; |
518 this._updateTimerId = this.element.window().requestAnimationFrame(this.updat
e.bind(this)); | 518 this._updateTimerId = this.element.window().requestAnimationFrame(this.updat
e.bind(this)); |
519 } | 519 } |
520 | 520 |
521 update() { | 521 update() { |
522 this._updateTimerId = 0; | 522 this._updateTimerId = 0; |
523 var timelineData = this._timelineData(); | 523 var timelineData = this._timelineData(); |
524 if (!timelineData) | 524 if (!timelineData) |
525 return; | 525 return; |
526 this._resetCanvas( | 526 this._resetCanvas( |
527 this._overviewContainer.clientWidth, this._overviewContainer.clientHeigh
t - UI.FlameChart.DividersBarHeight); | 527 this._overviewContainer.clientWidth, this._overviewContainer.clientHeigh
t - UI.FlameChart.HeaderHeight); |
528 this._overviewCalculator._updateBoundaries(this); | 528 this._overviewCalculator._updateBoundaries(this); |
529 this._overviewGrid.updateDividers(this._overviewCalculator); | 529 this._overviewGrid.updateDividers(this._overviewCalculator); |
530 this._drawOverviewCanvas(); | 530 this._drawOverviewCanvas(); |
531 } | 531 } |
532 | 532 |
533 _drawOverviewCanvas() { | 533 _drawOverviewCanvas() { |
534 var canvasWidth = this._overviewCanvas.width; | 534 var canvasWidth = this._overviewCanvas.width; |
535 var canvasHeight = this._overviewCanvas.height; | 535 var canvasHeight = this._overviewCanvas.height; |
536 var drawData = this._calculateDrawData(canvasWidth); | 536 var drawData = this._calculateDrawData(canvasWidth); |
537 var context = this._overviewCanvas.getContext('2d'); | 537 var context = this._overviewCanvas.getContext('2d'); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 * @param {number} height | 588 * @param {number} height |
589 */ | 589 */ |
590 _resetCanvas(width, height) { | 590 _resetCanvas(width, height) { |
591 var ratio = window.devicePixelRatio; | 591 var ratio = window.devicePixelRatio; |
592 this._overviewCanvas.width = width * ratio; | 592 this._overviewCanvas.width = width * ratio; |
593 this._overviewCanvas.height = height * ratio; | 593 this._overviewCanvas.height = height * ratio; |
594 this._overviewCanvas.style.width = width + 'px'; | 594 this._overviewCanvas.style.width = width + 'px'; |
595 this._overviewCanvas.style.height = height + 'px'; | 595 this._overviewCanvas.style.height = height + 'px'; |
596 } | 596 } |
597 }; | 597 }; |
OLD | NEW |