summaryrefslogtreecommitdiff
path: root/chromium/third_party/catapult/tracing/tracing/ui/extras/chrome/cc/picture_view.html
blob: 74acef3e37bba114a0fd0c0e70a86538733e3a9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<!--
Copyright (c) 2013 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<link rel="stylesheet" href="/tracing/ui/extras/chrome/cc/picture_view.css">

<link rel="import" href="/tracing/extras/chrome/cc/picture.html">
<link rel="import" href="/tracing/ui/analysis/generic_object_view.html">
<link rel="import" href="/tracing/ui/analysis/object_snapshot_view.html">
<link rel="import" href="/tracing/ui/extras/chrome/cc/picture_debugger.html">

<script>
'use strict';

tr.exportTo('tr.ui.e.chrome.cc', function() {
  /*
   * Displays a picture snapshot in a human readable form.
   * @constructor
   */
  var PictureSnapshotView = tr.ui.b.define(
      'tr-ui-e-chrome-cc-picture-snapshot-view',
      tr.ui.analysis.ObjectSnapshotView);

  PictureSnapshotView.prototype = {
    __proto__: tr.ui.analysis.ObjectSnapshotView.prototype,

    decorate: function() {
      this.classList.add('tr-ui-e-chrome-cc-picture-snapshot-view');
      this.pictureDebugger_ = new tr.ui.e.chrome.cc.PictureDebugger();
      this.appendChild(this.pictureDebugger_);
    },

    updateContents: function() {
      if (this.objectSnapshot_ && this.pictureDebugger_)
        this.pictureDebugger_.picture = this.objectSnapshot_;
    }
  };

  tr.ui.analysis.ObjectSnapshotView.register(
      PictureSnapshotView,
      {
        typeNames: ['cc::Picture', 'cc::LayeredPicture'],
        showInstances: false
      });

  return {
    PictureSnapshotView: PictureSnapshotView
  };
});
</script>