Skip to content

Commit

Permalink
Update remove_tile, add automatic tile removal, fix tests for quadtree
Browse files Browse the repository at this point in the history
  • Loading branch information
eschweic committed Jul 17, 2013
1 parent 3bb4713 commit 5468885
Show file tree
Hide file tree
Showing 3 changed files with 200 additions and 123 deletions.
12 changes: 4 additions & 8 deletions src/components/main/compositing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,9 @@ impl CompositorTask {
let ask_for_tiles: @fn() = || {
match *quadtree {
Some(ref mut quad) => {
let valid = |tile: &~LayerBuffer| -> bool {
tile.resolution == *world_zoom
};
let (tile_request, redisplay) = quad.get_tile_rects(Rect(Point2D(world_offset.x as int,
world_offset.y as int),
*window_size), valid, *world_zoom);
*window_size), *world_zoom);

if !tile_request.is_empty() {
match *render_chan {
Expand Down Expand Up @@ -415,10 +412,9 @@ impl CompositorTask {

NewLayer(new_size, tile_size) => {
*page_size = Size2D(new_size.width as f32, new_size.height as f32);
*quadtree = Some(Quadtree::new(0, 0,
new_size.width.max(&(window_size.width as uint)),
*quadtree = Some(Quadtree::new(new_size.width.max(&(window_size.width as uint)),
new_size.height.max(&(window_size.height as uint)),
tile_size));
tile_size, Some(10000000u)));
ask_for_tiles();

}
Expand Down Expand Up @@ -569,7 +565,7 @@ impl CompositorTask {
composite();
}

timer::sleep(&uv_global_loop::get(), 100);
timer::sleep(&uv_global_loop::get(), 10);

// If a pinch-zoom happened recently, ask for tiles at the new resolution
if *zoom_action && precise_time_s() - *zoom_time > 0.3 {
Expand Down
Loading

7 comments on commit 5468885

@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 pcwalton
at eschweic@5468885

@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/del-tiles = 5468885 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/del-tiles = 5468885 merged ok, testing candidate = c17ede3

@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 = c17ede3

@aydinkim
Copy link

Choose a reason for hiding this comment

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

As I tested this commit, It may exists some memory leakage at the time of tile removal.

@eschweic
Copy link

Choose a reason for hiding this comment

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

@aydinkim Textures seem to be deleting correctly according to the OpenGL Profiler. Where do you see the leak?

Please sign in to comment.