OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 'use strict'; | 5 'use strict'; |
6 | 6 |
7 base.require('model.constants'); | 7 base.require('model.constants'); |
8 | 8 |
9 base.exportTo('ccfv.model', function() { | 9 base.exportTo('ccfv.model', function() { |
10 | 10 |
11 /** | 11 /** |
12 * Represents a cc::Tile over the course of its lifetime. | 12 * Represents a cc::Tile over the course of its lifetime. |
13 * | 13 * |
14 * @constructor | 14 * @constructor |
15 */ | 15 */ |
16 function TileHistory(id) { | 16 function TileHistory(id) { |
17 this.id = id; | 17 this.id = id; |
18 this.tilesBySnapshotNumber = {}; | 18 this.tilesBySnapshotNumber = {}; |
| 19 this.layerID = undefined; |
19 this.picturePile = undefined; | 20 this.picturePile = undefined; |
20 this.contentsScale = undefined; | 21 this.contentsScale = undefined; |
21 | 22 |
22 this.selected = false; | 23 this.selected = false; |
23 } | 24 } |
24 | 25 |
25 TileHistory.prototype = { | 26 TileHistory.prototype = { |
26 get title() { | 27 get title() { |
27 return 'TileHistory ' + this.id; | 28 return 'TileHistory ' + this.id; |
28 }, | 29 }, |
29 | 30 |
30 getOrCreateTileForLTHI: function(lthi) { | 31 getOrCreateTileForLTHI: function(lthi) { |
31 if (!this.tilesBySnapshotNumber[lthi.snapshotNumber]) | 32 if (!this.tilesBySnapshotNumber[lthi.snapshotNumber]) |
32 this.tilesBySnapshotNumber[lthi.snapshotNumber] = new Tile(this); | 33 this.tilesBySnapshotNumber[lthi.snapshotNumber] = new Tile(this); |
33 return this.tilesBySnapshotNumber[lthi.snapshotNumber]; | 34 return this.tilesBySnapshotNumber[lthi.snapshotNumber]; |
34 }, | 35 }, |
35 | 36 |
36 dumpToSimpleObject: function(obj) { | 37 dumpToSimpleObject: function(obj) { |
37 obj.id = this.id; | 38 obj.id = this.id; |
| 39 obj.layerID = this.layerID; |
38 obj.picturePile = this.picturePile; | 40 obj.picturePile = this.picturePile; |
39 obj.contentsScale = this.contentsScale; | 41 obj.contentsScale = this.contentsScale; |
40 } | 42 } |
41 }; | 43 }; |
42 | 44 |
43 /** | 45 /** |
44 * Represents a cc::Tile at an instant in time. | 46 * Represents a cc::Tile at an instant in time. |
45 * | 47 * |
46 * @constructor | 48 * @constructor |
47 */ | 49 */ |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 obj[k] = this[k]; | 96 obj[k] = this[k]; |
95 } | 97 } |
96 } | 98 } |
97 | 99 |
98 return { | 100 return { |
99 Tile: Tile, | 101 Tile: Tile, |
100 TileHistory: TileHistory | 102 TileHistory: TileHistory |
101 } | 103 } |
102 }); | 104 }); |
103 | 105 |
OLD | NEW |