mirror of
https://github.com/servo/servo.git
synced 2025-06-24 17:14:33 +01:00
Correct draw order for frame tree layers
This commit is contained in:
parent
48f9e9aaa5
commit
a07ff5d1b5
4 changed files with 30 additions and 30 deletions
|
@ -109,7 +109,7 @@ impl CompositorLayer {
|
|||
}
|
||||
|
||||
let child_layer = ~CompositorLayer::from_frame_tree(frame_tree, tile_size, max_mem);
|
||||
container.add_child(ContainerLayerKind(child_layer.root_layer));
|
||||
container.add_child_start(ContainerLayerKind(child_layer.root_layer));
|
||||
|
||||
CompositorLayerChild {
|
||||
child: child_layer,
|
||||
|
@ -342,25 +342,9 @@ impl CompositorLayer {
|
|||
self.root_layer.remove_child(trash);
|
||||
}
|
||||
|
||||
// Add child layers.
|
||||
for child in self.children.mut_iter().filter(|x| !x.child.hidden) {
|
||||
current_layer_child = match current_layer_child {
|
||||
None => {
|
||||
child.container.common.parent = None;
|
||||
child.container.common.prev_sibling = None;
|
||||
child.container.common.next_sibling = None;
|
||||
self.root_layer.add_child(ContainerLayerKind(child.container));
|
||||
None
|
||||
}
|
||||
Some(_) => {
|
||||
fail!("CompositorLayer: Layer tree failed to delete");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Add new tiles.
|
||||
let quadtree = match self.quadtree {
|
||||
NoTree(_, _) => fail!("CompositorLayer: cannot get buffer request for %?,
|
||||
NoTree(_, _) => fail!("CompositorLayer: cannot get build layer tree for %?,
|
||||
no quadtree initialized", self.pipeline.id),
|
||||
Tree(ref mut quadtree) => quadtree,
|
||||
};
|
||||
|
@ -376,7 +360,7 @@ impl CompositorLayer {
|
|||
debug!("osmain: adding new texture layer");
|
||||
texture_layer = @mut TextureLayer::new(@buffer.draw_target.clone() as @TextureManager,
|
||||
buffer.screen_pos.size);
|
||||
self.root_layer.add_child(TextureLayerKind(texture_layer));
|
||||
self.root_layer.add_child_end(TextureLayerKind(texture_layer));
|
||||
None
|
||||
}
|
||||
Some(TextureLayerKind(existing_texture_layer)) => {
|
||||
|
@ -399,6 +383,23 @@ impl CompositorLayer {
|
|||
texture_layer.common.set_transform(transform);
|
||||
}
|
||||
|
||||
// Add child layers.
|
||||
for child in self.children.mut_iter().filter(|x| !x.child.hidden) {
|
||||
current_layer_child = match current_layer_child {
|
||||
None => {
|
||||
child.container.common.parent = None;
|
||||
child.container.common.prev_sibling = None;
|
||||
child.container.common.next_sibling = None;
|
||||
self.root_layer.add_child_end(ContainerLayerKind(child.container));
|
||||
None
|
||||
}
|
||||
Some(_) => {
|
||||
fail!("CompositorLayer: Layer tree failed to delete");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Add LayerBuffers to the specified layer. Returns false if the layer is not found.
|
||||
|
@ -472,7 +473,7 @@ impl CompositorLayer {
|
|||
clipping_rect.origin.y,
|
||||
0.0));
|
||||
let child = ~CompositorLayer::new(pipeline, page_size, tile_size, max_mem);
|
||||
container.add_child(ContainerLayerKind(child.root_layer));
|
||||
container.add_child_start(ContainerLayerKind(child.root_layer));
|
||||
self.children.push(CompositorLayerChild {
|
||||
child: child,
|
||||
container: container,
|
||||
|
|
|
@ -263,7 +263,7 @@ impl CompositorTask {
|
|||
let layer = CompositorLayer::from_frame_tree(frame_tree,
|
||||
self.opts.tile_size,
|
||||
Some(10000000u));
|
||||
root_layer.add_child(ContainerLayerKind(layer.root_layer));
|
||||
root_layer.add_child_start(ContainerLayerKind(layer.root_layer));
|
||||
compositor_layer = Some(layer);
|
||||
|
||||
constellation_chan = Some(new_constellation_chan);
|
||||
|
@ -294,7 +294,7 @@ impl CompositorTask {
|
|||
Some(old_layer) => root_layer.remove_child(old_layer),
|
||||
None => {}
|
||||
}
|
||||
root_layer.add_child(ContainerLayerKind(new_layer.root_layer));
|
||||
root_layer.add_child_start(ContainerLayerKind(new_layer.root_layer));
|
||||
compositor_layer = Some(new_layer);
|
||||
|
||||
ask_for_tiles();
|
||||
|
|
|
@ -340,10 +340,15 @@ impl<T: Tile> QuadtreeNode<T> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Get all tiles in the tree, parents last.
|
||||
/// Get all tiles in the tree, parents first.
|
||||
fn get_all_tiles<'r>(&'r self) -> ~[&'r T] {
|
||||
let mut ret = ~[];
|
||||
|
||||
match self.tile {
|
||||
Some(ref tile) => ret = ret + ~[tile],
|
||||
None => {}
|
||||
}
|
||||
|
||||
for quad in self.quadrants.iter() {
|
||||
match *quad {
|
||||
Some(ref child) => ret = ret + child.get_all_tiles(),
|
||||
|
@ -351,12 +356,6 @@ impl<T: Tile> QuadtreeNode<T> {
|
|||
}
|
||||
}
|
||||
|
||||
match self.tile {
|
||||
Some(ref tile) => ret = ret + ~[tile],
|
||||
None => {}
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 1383a7610349c9120013d9930a81cc0a659804ae
|
||||
Subproject commit 8e469443a9fec36de8eec09036f8051723ee59bc
|
Loading…
Add table
Add a link
Reference in a new issue