| <!DOCTYPE html> |
| <!-- |
| Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| Use of this source code is governed by a BSD-style license that can be |
| found in the LICENSE file. |
| --> |
| |
| <link rel="stylesheet" href="/extras/chrome/gpu/state_view.css"> |
| <link rel="import" href="/core/analysis/object_snapshot_view.html"> |
| <link rel="import" href="/base/units/util.html"> |
| |
| <script> |
| 'use strict'; |
| |
| tr.exportTo('tr.e.gpu', function() { |
| /* |
| * Displays a GPU state snapshot in a human readable form. |
| * @constructor |
| */ |
| var StateSnapshotView = tr.b.ui.define( |
| 'gpu-state-snapshot-view', |
| tr.c.analysis.ObjectSnapshotView); |
| |
| StateSnapshotView.prototype = { |
| __proto__: tr.c.analysis.ObjectSnapshotView.prototype, |
| |
| decorate: function() { |
| this.classList.add('gpu-state-snapshot-view'); |
| this.screenshotImage_ = document.createElement('img'); |
| this.appendChild(this.screenshotImage_); |
| }, |
| |
| updateContents: function() { |
| if (this.objectSnapshot_ && this.objectSnapshot_.screenshot) { |
| this.screenshotImage_.src = 'data:image/png;base64,' + |
| this.objectSnapshot_.screenshot; |
| } |
| } |
| }; |
| tr.c.analysis.ObjectSnapshotView.register( |
| StateSnapshotView, |
| {typeName: 'gpu::State'}); |
| |
| return { |
| StateSnapshotView: StateSnapshotView |
| }; |
| }); |
| </script> |