| 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/drawing_container.css"> | 8 <link rel="stylesheet" href="/tracing/ui/tracks/drawing_container.css"> |
| 9 | 9 |
| 10 <link rel="import" href="/tracing/base/raf.html"> | 10 <link rel="import" href="/tracing/base/raf.html"> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 DrawingContainer.prototype = { | 33 DrawingContainer.prototype = { |
| 34 __proto__: tr.ui.tracks.Track.prototype, | 34 __proto__: tr.ui.tracks.Track.prototype, |
| 35 | 35 |
| 36 decorate: function(viewport) { | 36 decorate: function(viewport) { |
| 37 tr.ui.tracks.Track.prototype.decorate.call(this, viewport); | 37 tr.ui.tracks.Track.prototype.decorate.call(this, viewport); |
| 38 this.classList.add('drawing-container'); | 38 this.classList.add('drawing-container'); |
| 39 | 39 |
| 40 this.canvas_ = document.createElement('canvas'); | 40 this.canvas_ = document.createElement('canvas'); |
| 41 this.canvas_.className = 'drawing-container-canvas'; | 41 this.canvas_.className = 'drawing-container-canvas'; |
| 42 this.canvas_.style.left = tr.ui.b.constants.HEADING_WIDTH + 'px'; | 42 this.canvas_.style.left = tr.ui.b.constants.HEADING_WIDTH + 'px'; |
| 43 this.appendChild(this.canvas_); | 43 Polymer.dom(this).appendChild(this.canvas_); |
| 44 | 44 |
| 45 this.ctx_ = this.canvas_.getContext('2d'); | 45 this.ctx_ = this.canvas_.getContext('2d'); |
| 46 | 46 |
| 47 this.viewportChange_ = this.viewportChange_.bind(this); | 47 this.viewportChange_ = this.viewportChange_.bind(this); |
| 48 this.viewport.addEventListener('change', this.viewportChange_); | 48 this.viewport.addEventListener('change', this.viewportChange_); |
| 49 }, | 49 }, |
| 50 | 50 |
| 51 // Needed to support the calls in TimelineTrackView. | 51 // Needed to support the calls in TimelineTrackView. |
| 52 get canvas() { | 52 get canvas() { |
| 53 return this.canvas_; | 53 return this.canvas_; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 } | 167 } |
| 168 } | 168 } |
| 169 }; | 169 }; |
| 170 | 170 |
| 171 return { | 171 return { |
| 172 DrawingContainer: DrawingContainer, | 172 DrawingContainer: DrawingContainer, |
| 173 DrawType: DrawType | 173 DrawType: DrawType |
| 174 }; | 174 }; |
| 175 }); | 175 }); |
| 176 </script> | 176 </script> |
| OLD | NEW |