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 Renders an array of slices into the provided div, | 7 * @fileoverview Renders an array of slices into the provided div, |
8 * using a child canvas element. Uses a FastRectRenderer to draw only | 8 * using a child canvas element. Uses a FastRectRenderer to draw only |
9 * the visible slices. | 9 * the visible slices. |
10 */ | 10 */ |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 loWX, hiWX, | 408 loWX, hiWX, |
409 onPickHit); | 409 onPickHit); |
410 }, | 410 }, |
411 | 411 |
412 /** | 412 /** |
413 * Find the index for the given slice. | 413 * Find the index for the given slice. |
414 * @return {index} Index of the given slice, or undefined. | 414 * @return {index} Index of the given slice, or undefined. |
415 * @private | 415 * @private |
416 */ | 416 */ |
417 indexOfSlice_: function(slice) { | 417 indexOfSlice_: function(slice) { |
418 var index = gpu.findLowIndexInSortedArray(this.slices_, | 418 var index = tracing.findLowIndexInSortedArray(this.slices_, |
419 function(x) { return x.start; }, | 419 function(x) { return x.start; }, |
420 slice.start); | 420 slice.start); |
421 while (index < this.slices_.length && | 421 while (index < this.slices_.length && |
422 slice.start == this.slices_[index].start && | 422 slice.start == this.slices_[index].start && |
423 slice.colorId != this.slices_[index].colorId) { | 423 slice.colorId != this.slices_[index].colorId) { |
424 index++; | 424 index++; |
425 } | 425 } |
426 return index < this.slices_.length ? index : undefined; | 426 return index < this.slices_.length ? index : undefined; |
427 }, | 427 }, |
428 | 428 |
(...skipping 28 matching lines...) Expand all Loading... |
457 return index != undefined ? this.slices_[index] : undefined; | 457 return index != undefined ? this.slices_[index] : undefined; |
458 }, | 458 }, |
459 | 459 |
460 }; | 460 }; |
461 | 461 |
462 return { | 462 return { |
463 TimelineSliceTrack: TimelineSliceTrack, | 463 TimelineSliceTrack: TimelineSliceTrack, |
464 TimelineThreadTrack: TimelineThreadTrack | 464 TimelineThreadTrack: TimelineThreadTrack |
465 }; | 465 }; |
466 }); | 466 }); |
OLD | NEW |