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
5 found in the LICENSE file.
8 <link rel="stylesheet" href="/gpu/state_view.css">
9 <link rel="import" href="/tracing/analysis/object_snapshot_view.html">
10 <link rel="import" href="/tracing/analysis/util.html">
15 tvcm.exportTo('gpu', function() {
17 * Displays a GPU state snapshot in a human readable form.
20 var StateSnapshotView = tvcm.ui.define(
21 'gpu-state-snapshot-view',
22 tracing.analysis.ObjectSnapshotView);
24 StateSnapshotView.prototype = {
25 __proto__: tracing.analysis.ObjectSnapshotView.prototype,
27 decorate: function() {
28 this.classList.add('gpu-state-snapshot-view');
29 this.screenshotImage_ = document.createElement('img');
30 this.appendChild(this.screenshotImage_);
33 updateContents: function() {
34 if (this.objectSnapshot_ && this.objectSnapshot_.screenshot) {
35 this.screenshotImage_.src = 'data:image/png;base64,' +
36 this.objectSnapshot_.screenshot;
40 tracing.analysis.ObjectSnapshotView.register('gpu::State', StateSnapshotView);
43 StateSnapshotView: StateSnapshotView