OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 | 5 |
6 /** | 6 /** |
7 * @fileoverview Helper functions for doing intersections and iteration | 7 * @fileoverview Helper functions for doing intersections and iteration |
8 * over sorted arrays and intervals. | 8 * over sorted arrays and intervals. |
9 * | 9 * |
10 */ | 10 */ |
11 cr.define('gpu', function() { | 11 cr.define('tracing', function() { |
12 /** | 12 /** |
13 * Finds the first index in the array whose value is >= loVal. | 13 * Finds the first index in the array whose value is >= loVal. |
14 * | 14 * |
15 * The key for the search is defined by the mapFn. This array must | 15 * The key for the search is defined by the mapFn. This array must |
16 * be prearranged such that ary.map(mapFn) would also be sorted in | 16 * be prearranged such that ary.map(mapFn) would also be sorted in |
17 * ascending order. | 17 * ascending order. |
18 * | 18 * |
19 * @param {Array} ary An array of arbitrary objects. | 19 * @param {Array} ary An array of arbitrary objects. |
20 * @param {function():*} mapFn Callback that produces a key value | 20 * @param {function():*} mapFn Callback that produces a key value |
21 * from an element in ary. | 21 * from an element in ary. |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 return tmp; | 148 return tmp; |
149 } | 149 } |
150 | 150 |
151 return { | 151 return { |
152 findLowIndexInSortedArray: findLowIndexInSortedArray, | 152 findLowIndexInSortedArray: findLowIndexInSortedArray, |
153 findLowIndexInSortedIntervals: findLowIndexInSortedIntervals, | 153 findLowIndexInSortedIntervals: findLowIndexInSortedIntervals, |
154 iterateOverIntersectingIntervals: iterateOverIntersectingIntervals, | 154 iterateOverIntersectingIntervals: iterateOverIntersectingIntervals, |
155 getIntersectingIntervals: getIntersectingIntervals | 155 getIntersectingIntervals: getIntersectingIntervals |
156 }; | 156 }; |
157 }); | 157 }); |
OLD | NEW |