| 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/extras/chrome/gpu/state_view.css"> | 8 <link rel="stylesheet" href="/tracing/ui/extras/chrome/gpu/state_view.css"> |
| 9 | 9 |
| 10 <link rel="import" href="/tracing/ui/analysis/object_snapshot_view.html"> | 10 <link rel="import" href="/tracing/ui/analysis/object_snapshot_view.html"> |
| 11 | 11 |
| 12 <script> | 12 <script> |
| 13 'use strict'; | 13 'use strict'; |
| 14 | 14 |
| 15 tr.exportTo('tr.ui.e.chrome.gpu', function() { | 15 tr.exportTo('tr.ui.e.chrome.gpu', function() { |
| 16 /* | 16 /* |
| 17 * Displays a GPU state snapshot in a human readable form. | 17 * Displays a GPU state snapshot in a human readable form. |
| 18 * @constructor | 18 * @constructor |
| 19 */ | 19 */ |
| 20 var StateSnapshotView = tr.ui.b.define( | 20 var StateSnapshotView = tr.ui.b.define( |
| 21 'tr-ui-e-chrome-gpu-state-snapshot-view', | 21 'tr-ui-e-chrome-gpu-state-snapshot-view', |
| 22 tr.ui.analysis.ObjectSnapshotView); | 22 tr.ui.analysis.ObjectSnapshotView); |
| 23 | 23 |
| 24 StateSnapshotView.prototype = { | 24 StateSnapshotView.prototype = { |
| 25 __proto__: tr.ui.analysis.ObjectSnapshotView.prototype, | 25 __proto__: tr.ui.analysis.ObjectSnapshotView.prototype, |
| 26 | 26 |
| 27 decorate: function() { | 27 decorate: function() { |
| 28 this.classList.add('tr-ui-e-chrome-gpu-state-snapshot-view'); | 28 this.classList.add('tr-ui-e-chrome-gpu-state-snapshot-view'); |
| 29 this.screenshotImage_ = document.createElement('img'); | 29 this.screenshotImage_ = document.createElement('img'); |
| 30 this.appendChild(this.screenshotImage_); | 30 Polymer.dom(this).appendChild(this.screenshotImage_); |
| 31 }, | 31 }, |
| 32 | 32 |
| 33 updateContents: function() { | 33 updateContents: function() { |
| 34 if (this.objectSnapshot_ && this.objectSnapshot_.screenshot) { | 34 if (this.objectSnapshot_ && this.objectSnapshot_.screenshot) { |
| 35 this.screenshotImage_.src = 'data:image/png;base64,' + | 35 this.screenshotImage_.src = 'data:image/png;base64,' + |
| 36 this.objectSnapshot_.screenshot; | 36 this.objectSnapshot_.screenshot; |
| 37 } | 37 } |
| 38 } | 38 } |
| 39 }; | 39 }; |
| 40 tr.ui.analysis.ObjectSnapshotView.register( | 40 tr.ui.analysis.ObjectSnapshotView.register( |
| 41 StateSnapshotView, | 41 StateSnapshotView, |
| 42 {typeName: 'gpu::State'}); | 42 {typeName: 'gpu::State'}); |
| 43 | 43 |
| 44 return { | 44 return { |
| 45 StateSnapshotView: StateSnapshotView | 45 StateSnapshotView: StateSnapshotView |
| 46 }; | 46 }; |
| 47 }); | 47 }); |
| 48 </script> | 48 </script> |
| OLD | NEW |