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

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

Issue 12225131: [cc] Initial checkin of cc-frame-viewer (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 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
10 base.exportTo('ccfv.model', function() {
11
12 /**
13 * Represents a cc::LayerTreeImpl
14 *
15 * @constructor
16 */
17 function LayerTreeImpl(which_tree) {
18 this.which_tree = which_tree;
19 this.tiles = [];
20 this.tileBBox_ = undefined;
21 };
22
23 LayerTreeImpl.prototype = {
24 resetTiles: function() {
25 this.tilse = [];
26 this.tileBBox_ = undefined;
27 },
28
29 get tileBBox() {
30 if (!this.tileBBox_) {
31 var bbox = new base.BBox2();
32 for (var i = 0; i < this.tiles.length; i++) {
33 var tile = this.tiles[i];
34 var priority = tile.priority[this.which_tree];
35 if (!priority.current_screen_quad)
36 continue;
37 bbox.addQuad(priority.current_screen_quad);
38 }
39 this.tileBBox_ = bbox;
40 }
41 return this.tileBBox_;
42 },
43
44 };
45
46 return {
47 LayerTreeImpl: LayerTreeImpl
48 }
49 });
50
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