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

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

Issue 12287014: [cc-frame-viewer] Show layers and levels of detail (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/cc-frame-viewer/src/model.js ('k') | tools/cc-frame-viewer/src/model/layer_tree_host_impl.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/cc-frame-viewer/src/model/layer_impl.js
diff --git a/tools/cc-frame-viewer/src/model/layer_impl.js b/tools/cc-frame-viewer/src/model/layer_impl.js
new file mode 100644
index 0000000000000000000000000000000000000000..343cec3fec6d61fe43de31c548d1a86c0f98b3eb
--- /dev/null
+++ b/tools/cc-frame-viewer/src/model/layer_impl.js
@@ -0,0 +1,78 @@
+/* Copyright (c) 2012 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.
+ */
+'use strict';
+
+base.require('model.constants');
+
+base.exportTo('ccfv.model', function() {
+
+ /**
+ * Represents a cc::LayerImpl over the course of its lifetime.
+ *
+ * @constructor
+ */
+ function LayerImplHistory(id) {
+ this.id = id;
+ this.layersBySnapshotNumber = {};
+ this.args = {};
+ this.selected = false;
+ }
+
+ LayerImplHistory.prototype = {
+ get title() {
+ return 'LayerImpl ' + this.id;
+ },
+
+ getOrCreateLayerImplForLTHI: function(lthi) {
+ if (!this.layersBySnapshotNumber[lthi.snapshotNumber])
+ this.layersBySnapshotNumber[lthi.snapshotNumber] = new LayerImpl(this);
+ return this.layersBySnapshotNumber[lthi.snapshotNumber];
+ },
+
+ dumpToSimpleObject: function(obj) {
+ obj.id = this.id;
+ obj.args = this.args;
+ }
+ };
+
+ /**
+ * Represents a cc::LayerImpl at an instant in time.
+ *
+ * @constructor
+ */
+ function LayerImpl(history) {
+ this.history = history;
+ this.args = {}
+ }
+
+ LayerImpl.prototype = {
+ get id() {
+ return this.history.id;
+ },
+
+ get title() {
+ return 'LayerImpl ' + this.id;
+ },
+
+ get selected() {
+ return this.history.selected;
+ },
+
+ set selected(s) {
+ this.history.selected = s;
+ },
+
+ dumpToSimpleObject: function(obj) {
+ obj.history = {};
+ obj.args = this.args;
+ },
+ };
+
+ return {
+ LayerImpl: LayerImpl,
+ LayerImplHistory: LayerImplHistory
+ }
+});
+
« no previous file with comments | « tools/cc-frame-viewer/src/model.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