Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / trace_viewer / gpu / state.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="import" href="/tvcm.html">
9 <link rel="import" href="/tracing/trace_model/object_instance.html">
10
11 <script>
12 'use strict';
13
14 tvcm.exportTo('gpu', function() {
15   var ObjectSnapshot = tracing.trace_model.ObjectSnapshot;
16
17   /**
18    * @constructor
19    */
20   function StateSnapshot() {
21     ObjectSnapshot.apply(this, arguments);
22   }
23
24   StateSnapshot.prototype = {
25     __proto__: ObjectSnapshot.prototype,
26
27     preInitialize: function() {
28       this.screenshot_ = undefined;
29     },
30
31     initialize: function() {
32       if (this.args.screenshot)
33         this.screenshot_ = this.args.screenshot;
34     },
35
36     /**
37      * @return {String} a base64 encoded screenshot if available.
38      */
39     get screenshot() {
40       return this.screenshot_;
41     }
42   };
43
44   ObjectSnapshot.register('gpu::State', StateSnapshot);
45
46   return {
47     StateSnapshot: StateSnapshot
48   };
49 });
50 </script>