Skip to content

Commit

Permalink
Change quadtree iterators
Browse files Browse the repository at this point in the history
  • Loading branch information
eschweic committed Aug 20, 2013
1 parent d92cbe6 commit 5942468
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
1 change: 0 additions & 1 deletion src/components/gfx/render_task.rs
Expand Up @@ -24,7 +24,6 @@ use extra::arc::Arc;
use servo_util::time::{ProfilerChan, profile};
use servo_util::time;

use extra::arc;
use buffer_map::BufferMap;


Expand Down
36 changes: 18 additions & 18 deletions src/components/main/compositing/quadtree.rs
Expand Up @@ -310,7 +310,7 @@ impl<T: Tile> QuadtreeNode<T> {
status: Normal,
}
}

/// Determine which child contains a given point in page coords.
fn get_quadrant(&self, x: f32, y: f32) -> Quadrant {
if x < self.origin.x + self.size / 2.0 {
Expand Down Expand Up @@ -379,14 +379,14 @@ impl<T: Tile> QuadtreeNode<T> {
Some(old_tile) => ~[old_tile],
None => ~[],
};
// FIXME: This should be inline, but currently won't compile
let quads = [TL, TR, BL, BR];
for &quad in quads.iter() {
match self.quadrants[quad as int] {
Some(ref mut child) => unused_tiles.push_all_move(child.collect_tiles()),
for child in self.quadrants.mut_iter() {
match *child {
Some(ref mut node) => {
unused_tiles.push_all_move(node.collect_tiles());
}
None => {} // Nothing to do
}
self.quadrants[quad as int] = None;
*child = None;
}
self.status = Normal;
(self.tile_mem as int - old_size as int, unused_tiles)
Expand Down Expand Up @@ -569,14 +569,14 @@ impl<T: Tile> QuadtreeNode<T> {
let mut unused_tiles = ~[];
if redisplay {
let old_mem = self.tile_mem;
// FIXME: This should be inline, but currently won't compile
let quads = [TL, TR, BL, BR];
for &quad in quads.iter() {
match self.quadrants[quad as int] {
Some(ref mut child) => unused_tiles.push_all_move(child.collect_tiles()),
for child in self.quadrants.mut_iter() {
match *child {
Some(ref mut node) => {
unused_tiles.push_all_move(node.collect_tiles());
}
None => {} // Nothing to do
}
self.quadrants[quad as int] = None;
*child = None;
}
self.tile_mem = tile.get_mem();
delta = self.tile_mem as int - old_mem as int;
Expand Down Expand Up @@ -679,11 +679,11 @@ impl<T: Tile> QuadtreeNode<T> {
Some(tile) => ~[tile],
None => ~[],
};

let quadrants = [TL, TR, BL, BR];
for &quad in quadrants.iter() {
match self.quadrants[quad as int] {
Some(ref mut child) => ret.push_all_move(child.collect_tiles()),
for child in self.quadrants.mut_iter() {
match *child {
Some(ref mut node) => {
ret.push_all_move(node.collect_tiles());
}
None => {} // Nothing to do
}
}
Expand Down

5 comments on commit 5942468

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from metajack
at eschweic@5942468

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging eschweic/servo/manage-buffers = 5942468 into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eschweic/servo/manage-buffers = 5942468 merged ok, testing candidate = 83fba3d

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 83fba3d

Please sign in to comment.