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/tracks/rect_track.css"> | 8 <link rel="stylesheet" href="/tracing/ui/tracks/rect_track.css"> |
9 | 9 |
10 <link rel="import" href="/tracing/base/sorted_array_utils.html"> | 10 <link rel="import" href="/tracing/base/math/sorted_array_utils.html"> |
11 <link rel="import" href="/tracing/model/proxy_selectable_item.html"> | 11 <link rel="import" href="/tracing/model/proxy_selectable_item.html"> |
12 <link rel="import" href="/tracing/ui/base/draw_helpers.html"> | 12 <link rel="import" href="/tracing/ui/base/draw_helpers.html"> |
13 <link rel="import" href="/tracing/ui/base/fast_rect_renderer.html"> | 13 <link rel="import" href="/tracing/ui/base/fast_rect_renderer.html"> |
14 <link rel="import" href="/tracing/ui/base/heading.html"> | 14 <link rel="import" href="/tracing/ui/base/heading.html"> |
15 <link rel="import" href="/tracing/ui/base/ui.html"> | 15 <link rel="import" href="/tracing/ui/base/ui.html"> |
16 <link rel="import" href="/tracing/ui/tracks/track.html"> | 16 <link rel="import" href="/tracing/ui/tracks/track.html"> |
17 | 17 |
18 <script> | 18 <script> |
19 'use strict'; | 19 'use strict'; |
20 | 20 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 }, this); | 154 }, this); |
155 }, | 155 }, |
156 | 156 |
157 addIntersectingEventsInRangeToSelectionInWorldSpace: function( | 157 addIntersectingEventsInRangeToSelectionInWorldSpace: function( |
158 loWX, hiWX, viewPixWidthWorld, selection) { | 158 loWX, hiWX, viewPixWidthWorld, selection) { |
159 function onRect(rect) { | 159 function onRect(rect) { |
160 rect.addToSelection(selection); | 160 rect.addToSelection(selection); |
161 } | 161 } |
162 onRect = onRect.bind(this); | 162 onRect = onRect.bind(this); |
163 var instantEventWidth = 2 * viewPixWidthWorld; | 163 var instantEventWidth = 2 * viewPixWidthWorld; |
164 tr.b.iterateOverIntersectingIntervals(this.rects_, | 164 tr.b.math.iterateOverIntersectingIntervals(this.rects_, |
165 function(x) { return x.start; }, | 165 function(x) { return x.start; }, |
166 function(x) { | 166 function(x) { |
167 return x.duration === 0 ? | 167 return x.duration === 0 ? |
168 x.duration + instantEventWidth : | 168 x.duration + instantEventWidth : |
169 x.duration; | 169 x.duration; |
170 }, | 170 }, |
171 loWX, hiWX, | 171 loWX, hiWX, |
172 onRect); | 172 onRect); |
173 }, | 173 }, |
174 | 174 |
(...skipping 30 matching lines...) Expand all Loading... |
205 var modelItem = this.rects_[i].modelItem; | 205 var modelItem = this.rects_[i].modelItem; |
206 if (!modelItem) | 206 if (!modelItem) |
207 continue; | 207 continue; |
208 if (filter.matchSlice(modelItem)) | 208 if (filter.matchSlice(modelItem)) |
209 selection.push(modelItem); | 209 selection.push(modelItem); |
210 } | 210 } |
211 }, | 211 }, |
212 | 212 |
213 addClosestEventToSelection: function(worldX, worldMaxDist, loY, hiY, | 213 addClosestEventToSelection: function(worldX, worldMaxDist, loY, hiY, |
214 selection) { | 214 selection) { |
215 var rect = tr.b.findClosestIntervalInSortedIntervals( | 215 var rect = tr.b.math.findClosestIntervalInSortedIntervals( |
216 this.rects_, | 216 this.rects_, |
217 function(x) { return x.start; }, | 217 function(x) { return x.start; }, |
218 function(x) { return x.end; }, | 218 function(x) { return x.end; }, |
219 worldX, | 219 worldX, |
220 worldMaxDist); | 220 worldMaxDist); |
221 | 221 |
222 if (!rect) | 222 if (!rect) |
223 return; | 223 return; |
224 | 224 |
225 rect.addToSelection(selection); | 225 rect.addToSelection(selection); |
(...skipping 18 matching lines...) Expand all Loading... |
244 Rect.prototype = { | 244 Rect.prototype = { |
245 __proto__: tr.model.ProxySelectableItem.prototype | 245 __proto__: tr.model.ProxySelectableItem.prototype |
246 }; | 246 }; |
247 | 247 |
248 return { | 248 return { |
249 RectTrack, | 249 RectTrack, |
250 Rect, | 250 Rect, |
251 }; | 251 }; |
252 }); | 252 }); |
253 </script> | 253 </script> |
OLD | NEW |