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

Side by Side Diff: tools/cc-frame-viewer/src/model/layer_tree_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('base.bbox2');
8 base.require('model.constants');
9 base.require('model.layer_impl');
10
11 base.exportTo('ccfv.model', function() {
12
13 /**
14 * Represents a cc::LayerTreeImpl
15 *
16 * @constructor
17 */
18 function LayerTreeImpl(lthi, which_tree) {
19 this.lthi = lthi;
20 this.which_tree = which_tree;
21 this.tiles_ = [];
22 this.allLayers = [];
23 this.tileBBox_ = undefined;
24 };
25
26 LayerTreeImpl.prototype = {
27 setTilesDirty: function() {
28 this.tiles_ = undefined;
29 this.tileBBox_ = undefined;
30 },
31
32 get tiles() {
33 if (!this.tiles_)
34 this.tiles_ = this.lthi.getTilesForTree(this.which_tree);
35 return this.tiles_;
36 },
37
38 getOrCreateLayerImpl: function(layerID) {
39 var layerHistory = this.lthi.history.getOrCreateLayerImplHistory(layerID);
40 var layer = layerHistory.getOrCreateLayerImplForLTHI(this);
41 this.allLayers.push(layer);
42 return layer;
43 },
44
45 get tileBBox() {
46 if (!this.tileBBox_) {
47 var bbox = new base.BBox2();
48 for (var i = 0; i < this.tiles.length; i++) {
49 var tile = this.tiles[i];
50 var priority = tile.priority[this.which_tree];
51 if (!priority.current_screen_quad)
52 continue;
53 bbox.addQuad(priority.current_screen_quad);
54 }
55 this.tileBBox_ = bbox;
56 }
57 return this.tileBBox_;
58 },
59
60 };
61
62 return {
63 LayerTreeImpl: LayerTreeImpl
64 }
65 });
66
OLDNEW
« no previous file with comments | « tools/cc-frame-viewer/src/model/layer_tree_host_impl.js ('k') | tools/cc-frame-viewer/src/model/tile.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698