1<!DOCTYPE html>
2<!--
3Copyright (c) 2013 The Chromium Authors. All rights reserved.
4Use of this source code is governed by a BSD-style license that can be
5found in the LICENSE file.
6-->
7
8<link rel="import" href="/tracing/base/base.html">
9<link rel="import" href="/tracing/model/object_instance.html">
10
11<script>
12'use strict';
13
14tr.exportTo('tr.e.gpu', function() {
15  var ObjectSnapshot = tr.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(
45    StateSnapshot,
46    {typeName: 'gpu::State'});
47
48  return {
49    StateSnapshot: StateSnapshot
50  };
51});
52</script>
53