| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
| 5 found in the LICENSE file. | 5 found in the LICENSE file. |
| 6 --> | 6 --> |
| 7 | 7 |
| 8 <link rel="stylesheet" | |
| 9 href="/tracing/ui/extras/chrome/cc/picture_ops_chart_summary_view.css"> | |
| 10 | |
| 11 <link rel="import" href="/tracing/ui/base/ui.html"> | 8 <link rel="import" href="/tracing/ui/base/ui.html"> |
| 12 | 9 |
| 13 <script> | 10 <script> |
| 14 'use strict'; | 11 'use strict'; |
| 15 | 12 |
| 16 tr.exportTo('tr.ui.e.chrome.cc', function() { | 13 tr.exportTo('tr.ui.e.chrome.cc', function() { |
| 17 const OPS_TIMING_ITERATIONS = 3; | 14 const OPS_TIMING_ITERATIONS = 3; |
| 18 const CHART_PADDING_LEFT = 65; | 15 const CHART_PADDING_LEFT = 65; |
| 19 const CHART_PADDING_RIGHT = 40; | 16 const CHART_PADDING_RIGHT = 40; |
| 20 const AXIS_PADDING_LEFT = 60; | 17 const AXIS_PADDING_LEFT = 60; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 35 * | 32 * |
| 36 * @constructor | 33 * @constructor |
| 37 */ | 34 */ |
| 38 const PictureOpsChartSummaryView = tr.ui.b.define( | 35 const PictureOpsChartSummaryView = tr.ui.b.define( |
| 39 'tr-ui-e-chrome-cc-picture-ops-chart-summary-view'); | 36 'tr-ui-e-chrome-cc-picture-ops-chart-summary-view'); |
| 40 | 37 |
| 41 PictureOpsChartSummaryView.prototype = { | 38 PictureOpsChartSummaryView.prototype = { |
| 42 __proto__: HTMLDivElement.prototype, | 39 __proto__: HTMLDivElement.prototype, |
| 43 | 40 |
| 44 decorate() { | 41 decorate() { |
| 42 this.style.flexGrow = 0; |
| 43 this.style.flexShrink = 0; |
| 44 this.style.flexBasis = 'auto'; |
| 45 this.style.fontSize = 0; |
| 46 this.style.margin = 0; |
| 47 this.style.minHeight = '200px'; |
| 48 this.style.minWidth = '200px'; |
| 49 this.style.overflow = 'hidden'; |
| 50 this.style.padding = 0; |
| 51 |
| 45 this.picture_ = undefined; | 52 this.picture_ = undefined; |
| 46 this.pictureDataProcessed_ = false; | 53 this.pictureDataProcessed_ = false; |
| 47 | 54 |
| 48 this.chartScale_ = window.devicePixelRatio; | 55 this.chartScale_ = window.devicePixelRatio; |
| 49 | 56 |
| 50 this.chart_ = document.createElement('canvas'); | 57 this.chart_ = document.createElement('canvas'); |
| 51 this.chartCtx_ = this.chart_.getContext('2d'); | 58 this.chartCtx_ = this.chart_.getContext('2d'); |
| 52 Polymer.dom(this).appendChild(this.chart_); | 59 Polymer.dom(this).appendChild(this.chart_); |
| 53 | 60 |
| 54 this.opsTimingData_ = []; | 61 this.opsTimingData_ = []; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 80 | 87 |
| 81 if (Polymer.dom(this).classList.contains('hidden')) return; | 88 if (Polymer.dom(this).classList.contains('hidden')) return; |
| 82 | 89 |
| 83 this.processPictureData_(); | 90 this.processPictureData_(); |
| 84 this.requiresRedraw = true; | 91 this.requiresRedraw = true; |
| 85 this.updateChartContents(); | 92 this.updateChartContents(); |
| 86 }, | 93 }, |
| 87 | 94 |
| 88 hide() { | 95 hide() { |
| 89 Polymer.dom(this).classList.add('hidden'); | 96 Polymer.dom(this).classList.add('hidden'); |
| 97 this.style.display = 'none'; |
| 90 }, | 98 }, |
| 91 | 99 |
| 92 show() { | 100 show() { |
| 93 Polymer.dom(this).classList.remove('hidden'); | 101 Polymer.dom(this).classList.remove('hidden'); |
| 102 this.style.display = ''; |
| 94 | 103 |
| 95 if (this.pictureDataProcessed_) return; | 104 if (this.pictureDataProcessed_) return; |
| 96 | 105 |
| 97 this.processPictureData_(); | 106 this.processPictureData_(); |
| 98 this.requiresRedraw = true; | 107 this.requiresRedraw = true; |
| 99 this.updateChartContents(); | 108 this.updateChartContents(); |
| 100 }, | 109 }, |
| 101 | 110 |
| 102 onMouseMove_(e) { | 111 onMouseMove_(e) { |
| 103 const lastBarMouseOverTarget = this.currentBarMouseOverTarget_; | 112 const lastBarMouseOverTarget = this.currentBarMouseOverTarget_; |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 resetOpsTimingData_() { | 443 resetOpsTimingData_() { |
| 435 this.opsTimingData_.length = 0; | 444 this.opsTimingData_.length = 0; |
| 436 } | 445 } |
| 437 }; | 446 }; |
| 438 | 447 |
| 439 return { | 448 return { |
| 440 PictureOpsChartSummaryView, | 449 PictureOpsChartSummaryView, |
| 441 }; | 450 }; |
| 442 }); | 451 }); |
| 443 </script> | 452 </script> |
| OLD | NEW |