Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / trace_viewer / gpu / state_view.html
1 <!DOCTYPE html>
2 <!--
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.
6 -->
7
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">
11
12 <script>
13 'use strict';
14
15 tvcm.exportTo('gpu', function() {
16   /*
17    * Displays a GPU state snapshot in a human readable form.
18    * @constructor
19    */
20   var StateSnapshotView = tvcm.ui.define(
21       'gpu-state-snapshot-view',
22       tracing.analysis.ObjectSnapshotView);
23
24   StateSnapshotView.prototype = {
25     __proto__: tracing.analysis.ObjectSnapshotView.prototype,
26
27     decorate: function() {
28       this.classList.add('gpu-state-snapshot-view');
29       this.screenshotImage_ = document.createElement('img');
30       this.appendChild(this.screenshotImage_);
31     },
32
33     updateContents: function() {
34       if (this.objectSnapshot_ && this.objectSnapshot_.screenshot) {
35         this.screenshotImage_.src = 'data:image/png;base64,' +
36             this.objectSnapshot_.screenshot;
37       }
38     }
39   };
40   tracing.analysis.ObjectSnapshotView.register('gpu::State', StateSnapshotView);
41
42   return {
43     StateSnapshotView: StateSnapshotView
44   };
45 });
46 </script>