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.
7 base.require('model.constants');
9 base.exportTo('ccfv.model', function() {
12 * Represents a cc::LayerImpl over the course of its lifetime.
16 function LayerImplHistory(id) {
18 this.layersBySnapshotNumber = {};
20 this.selected = false;
23 LayerImplHistory.prototype = {
25 return 'LayerImpl ' + this.id;
28 getOrCreateLayerImplForLTHI: function(lthi) {
29 if (!this.layersBySnapshotNumber[lthi.snapshotNumber])
30 this.layersBySnapshotNumber[lthi.snapshotNumber] = new LayerImpl(this);
31 return this.layersBySnapshotNumber[lthi.snapshotNumber];
34 dumpToSimpleObject: function(obj) {
41 * Represents a cc::LayerImpl at an instant in time.
45 function LayerImpl(history) {
46 this.history = history;
50 LayerImpl.prototype = {
52 return this.history.id;
56 return 'LayerImpl ' + this.id;
60 return this.history.selected;
64 this.history.selected = s;
67 dumpToSimpleObject: function(obj) {
75 LayerImplHistory: LayerImplHistory