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" href="/tracing/ui/extras/chrome/cc/picture_ops_chart_view
.css"> | 8 <link rel="stylesheet" href="/tracing/ui/extras/chrome/cc/picture_ops_chart_view
.css"> |
9 | 9 |
10 <link rel="import" href="/tracing/ui/base/dom_helpers.html"> | 10 <link rel="import" href="/tracing/ui/base/dom_helpers.html"> |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 var chartTop = 0; | 156 var chartTop = 0; |
157 var chartBottom = this.chartHeight_ - CHART_PADDING_BOTTOM; | 157 var chartBottom = this.chartHeight_ - CHART_PADDING_BOTTOM; |
158 var chartRight = chartLeft + totalBarWidth; | 158 var chartRight = chartLeft + totalBarWidth; |
159 | 159 |
160 if (x < chartLeft || x > chartRight || y < chartTop || y > chartBottom) | 160 if (x < chartLeft || x > chartRight || y < chartTop || y > chartBottom) |
161 return index; | 161 return index; |
162 | 162 |
163 index = Math.floor((x - chartLeft) / totalBarWidth * | 163 index = Math.floor((x - chartLeft) / totalBarWidth * |
164 this.pictureOps_.length); | 164 this.pictureOps_.length); |
165 | 165 |
166 index = tr.b.clamp(index, 0, this.pictureOps_.length - 1); | 166 index = tr.b.math.clamp(index, 0, this.pictureOps_.length - 1); |
167 | 167 |
168 return index; | 168 return index; |
169 }, | 169 }, |
170 | 170 |
171 onClick_: function(e) { | 171 onClick_: function(e) { |
172 var barClicked = this.extractBarIndex_(e); | 172 var barClicked = this.extractBarIndex_(e); |
173 | 173 |
174 if (barClicked === undefined) | 174 if (barClicked === undefined) |
175 return; | 175 return; |
176 | 176 |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 this.chartCtx_.fillText('No timing data available.', | 474 this.chartCtx_.fillText('No timing data available.', |
475 this.chartWidth_ * 0.5, this.chartHeight_ * 0.5); | 475 this.chartWidth_ * 0.5, this.chartHeight_ * 0.5); |
476 } | 476 } |
477 }; | 477 }; |
478 | 478 |
479 return { | 479 return { |
480 PictureOpsChartView, | 480 PictureOpsChartView, |
481 }; | 481 }; |
482 }); | 482 }); |
483 </script> | 483 </script> |
OLD | NEW |