1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 tvcm.requireStylesheet('gpu.state_view');
9 tvcm.require('tracing.analysis.object_snapshot_view');
10 tvcm.require('tracing.analysis.util');
12 tvcm.exportTo('gpu', function() {
15 * Displays a GPU state snapshot in a human readable form.
18 var StateSnapshotView = tvcm.ui.define(
19 'gpu-state-snapshot-view',
20 tracing.analysis.ObjectSnapshotView);
22 StateSnapshotView.prototype = {
23 __proto__: tracing.analysis.ObjectSnapshotView.prototype,
25 decorate: function() {
26 this.classList.add('gpu-state-snapshot-view');
27 this.screenshotImage_ = document.createElement('img');
28 this.appendChild(this.screenshotImage_);
31 updateContents: function() {
32 if (this.objectSnapshot_ && this.objectSnapshot_.screenshot) {
33 this.screenshotImage_.src = 'data:image/png;base64,' +
34 this.objectSnapshot_.screenshot;
39 tracing.analysis.ObjectSnapshotView.register(
40 'gpu::State', StateSnapshotView);
43 StateSnapshotView: StateSnapshotView