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="import" href="/tracing/ui/base/heading.html"> | 8 <link rel="import" href="/tracing/ui/base/heading.html"> |
9 <link rel="import" href="/tracing/ui/base/ui.html"> | 9 <link rel="import" href="/tracing/ui/base/ui.html"> |
10 <link rel="import" href="/tracing/ui/tracks/track.html"> | 10 <link rel="import" href="/tracing/ui/tracks/track.html"> |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 */ | 58 */ |
59 addIntersectingEventsInRangeToSelectionInWorldSpace: function( | 59 addIntersectingEventsInRangeToSelectionInWorldSpace: function( |
60 loWX, hiWX, viewPixWidthWorld, selection) { | 60 loWX, hiWX, viewPixWidthWorld, selection) { |
61 function onSnapshot(snapshot) { | 61 function onSnapshot(snapshot) { |
62 selection.push(snapshot); | 62 selection.push(snapshot); |
63 } | 63 } |
64 | 64 |
65 var snapshots = this.objectInstance_.snapshots; | 65 var snapshots = this.objectInstance_.snapshots; |
66 var maxBounds = this.objectInstance_.parent.model.bounds.max; | 66 var maxBounds = this.objectInstance_.parent.model.bounds.max; |
67 | 67 |
68 tr.b.iterateOverIntersectingIntervals( | 68 tr.b.math.iterateOverIntersectingIntervals( |
69 snapshots, | 69 snapshots, |
70 function(x) { return x.ts; }, | 70 function(x) { return x.ts; }, |
71 function(x, i) { | 71 function(x, i) { |
72 if (i === snapshots.length - 1) { | 72 if (i === snapshots.length - 1) { |
73 if (snapshots.length === 1) | 73 if (snapshots.length === 1) |
74 return maxBounds; | 74 return maxBounds; |
75 | 75 |
76 return snapshots[i].ts - snapshots[i - 1].ts; | 76 return snapshots[i].ts - snapshots[i - 1].ts; |
77 } | 77 } |
78 | 78 |
(...skipping 24 matching lines...) Expand all Loading... |
103 return true; | 103 return true; |
104 } | 104 } |
105 return false; | 105 return false; |
106 }, | 106 }, |
107 | 107 |
108 addAllEventsMatchingFilterToSelection: function(filter, selection) { | 108 addAllEventsMatchingFilterToSelection: function(filter, selection) { |
109 }, | 109 }, |
110 | 110 |
111 addClosestEventToSelection: function(worldX, worldMaxDist, loY, hiY, | 111 addClosestEventToSelection: function(worldX, worldMaxDist, loY, hiY, |
112 selection) { | 112 selection) { |
113 var snapshot = tr.b.findClosestElementInSortedArray( | 113 var snapshot = tr.b.math.findClosestElementInSortedArray( |
114 this.objectInstance_.snapshots, | 114 this.objectInstance_.snapshots, |
115 function(x) { return x.ts; }, | 115 function(x) { return x.ts; }, |
116 worldX, | 116 worldX, |
117 worldMaxDist); | 117 worldMaxDist); |
118 | 118 |
119 if (!snapshot) | 119 if (!snapshot) |
120 return; | 120 return; |
121 | 121 |
122 selection.push(snapshot); | 122 selection.push(snapshot); |
123 } | 123 } |
124 }; | 124 }; |
125 | 125 |
126 return { | 126 return { |
127 StackedBarsTrack, | 127 StackedBarsTrack, |
128 }; | 128 }; |
129 }); | 129 }); |
130 </script> | 130 </script> |
OLD | NEW |