Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: tools/cc-frame-viewer/src/model/layer_impl.js

Issue 15736032: Remove old cc-frame-viewer now that it is upstreamed into trace_viewer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 /* Copyright (c) 2012 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.
4 */
5 'use strict';
6
7 base.require('model.constants');
8
9 base.exportTo('ccfv.model', function() {
10
11 /**
12 * Represents a cc::LayerImpl over the course of its lifetime.
13 *
14 * @constructor
15 */
16 function LayerImplHistory(id) {
17 this.id = id;
18 this.layersBySnapshotNumber = {};
19 this.args = {};
20 this.selected = false;
21 }
22
23 LayerImplHistory.prototype = {
24 get title() {
25 return 'LayerImpl ' + this.id;
26 },
27
28 getOrCreateLayerImplForLTHI: function(lthi) {
29 if (!this.layersBySnapshotNumber[lthi.snapshotNumber])
30 this.layersBySnapshotNumber[lthi.snapshotNumber] = new LayerImpl(this);
31 return this.layersBySnapshotNumber[lthi.snapshotNumber];
32 },
33
34 dumpToSimpleObject: function(obj) {
35 obj.id = this.id;
36 obj.args = this.args;
37 }
38 };
39
40 /**
41 * Represents a cc::LayerImpl at an instant in time.
42 *
43 * @constructor
44 */
45 function LayerImpl(history) {
46 this.history = history;
47 this.args = {}
48 }
49
50 LayerImpl.prototype = {
51 get id() {
52 return this.history.id;
53 },
54
55 get title() {
56 return 'LayerImpl ' + this.id;
57 },
58
59 get selected() {
60 return this.history.selected;
61 },
62
63 set selected(s) {
64 this.history.selected = s;
65 },
66
67 dumpToSimpleObject: function(obj) {
68 obj.history = {};
69 obj.args = this.args;
70 },
71 };
72
73 return {
74 LayerImpl: LayerImpl,
75 LayerImplHistory: LayerImplHistory
76 }
77 });
78
OLDNEW
« no previous file with comments | « tools/cc-frame-viewer/src/model/constants.js ('k') | tools/cc-frame-viewer/src/model/layer_tree_host_impl.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698