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 * @fileoverview Interactive visualizaiton of TimelineModel objects | 6 * @fileoverview Interactive visualizaiton of TimelineModel objects |
7 * based loosely on gantt charts. Each thread in the TimelineModel is given a | 7 * based loosely on gantt charts. Each thread in the TimelineModel is given a |
8 * set of TimelineTracks, one per subrow in the thread. The Timeline class | 8 * set of TimelineTracks, one per subrow in the thread. The Timeline class |
9 * acts as a controller, creating the individual tracks, while TimelineTracks | 9 * acts as a controller, creating the individual tracks, while TimelineTracks |
10 * do actual drawing. | 10 * do actual drawing. |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 if (!model) | 201 if (!model) |
202 throw Error('Model cannot be null'); | 202 throw Error('Model cannot be null'); |
203 if (this.model) { | 203 if (this.model) { |
204 throw Error('Cannot set model twice.'); | 204 throw Error('Cannot set model twice.'); |
205 } | 205 } |
206 this.model_ = model; | 206 this.model_ = model; |
207 | 207 |
208 // Create tracks. | 208 // Create tracks. |
209 this.tracks_.textContent = ''; | 209 this.tracks_.textContent = ''; |
210 var threads = model.getAllThreads(); | 210 var threads = model.getAllThreads(); |
211 threads.sort(gpu.TimelineThread.compare); | 211 threads.sort(tracing.TimelineThread.compare); |
212 for (var tI = 0; tI < threads.length; tI++) { | 212 for (var tI = 0; tI < threads.length; tI++) { |
213 var thread = threads[tI]; | 213 var thread = threads[tI]; |
214 var track = new TimelineThreadTrack(); | 214 var track = new TimelineThreadTrack(); |
215 track.thread = thread; | 215 track.thread = thread; |
216 track.viewport = this.viewport_; | 216 track.viewport = this.viewport_; |
217 this.tracks_.appendChild(track); | 217 this.tracks_.appendChild(track); |
218 | 218 |
219 } | 219 } |
220 | 220 |
221 this.needsViewportReset_ = true; | 221 this.needsViewportReset_ = true; |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 /** | 578 /** |
579 * The TimelineModel being viewed by the timeline | 579 * The TimelineModel being viewed by the timeline |
580 * @type {TimelineModel} | 580 * @type {TimelineModel} |
581 */ | 581 */ |
582 cr.defineProperty(Timeline, 'model', cr.PropertyKind.JS); | 582 cr.defineProperty(Timeline, 'model', cr.PropertyKind.JS); |
583 | 583 |
584 return { | 584 return { |
585 Timeline: Timeline | 585 Timeline: Timeline |
586 }; | 586 }; |
587 }); | 587 }); |
OLD | NEW |