mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
auto merge of #2080 : mbrubeck/servo/2069-forget-tiles, r=larsbergstrom
This fixes a pixmap leak and task failure (#2069).
This commit is contained in:
commit
5d12dc805b
2 changed files with 15 additions and 1 deletions
|
@ -394,6 +394,11 @@ impl IOCompositor {
|
|||
|
||||
ContainerLayer::add_child_start(self.root_layer.clone(),
|
||||
ContainerLayerKind(new_layer.root_layer.clone()));
|
||||
|
||||
// Release all tiles from the layer before dropping it.
|
||||
for layer in self.compositor_layer.mut_iter() {
|
||||
layer.clear_all_tiles();
|
||||
}
|
||||
self.compositor_layer = Some(new_layer);
|
||||
}
|
||||
|
||||
|
|
|
@ -879,7 +879,7 @@ impl CompositorLayer {
|
|||
}
|
||||
|
||||
// Send back all tiles to renderer.
|
||||
child.get_mut_ref().child.clear();
|
||||
child.get_mut_ref().child.clear_all_tiles();
|
||||
|
||||
self.build_layer_tree(graphics_context);
|
||||
true
|
||||
|
@ -951,6 +951,15 @@ impl CompositorLayer {
|
|||
}
|
||||
}
|
||||
|
||||
/// Destroys tiles for this layer and all descendent layers, sending the buffers back to the
|
||||
/// renderer to be destroyed or reused.
|
||||
pub fn clear_all_tiles(&mut self) {
|
||||
self.clear();
|
||||
for kid in self.children.mut_iter() {
|
||||
kid.child.clear_all_tiles();
|
||||
}
|
||||
}
|
||||
|
||||
/// Destroys all tiles of all layers, including children, *without* sending them back to the
|
||||
/// renderer. You must call this only when the render task is destined to be going down;
|
||||
/// otherwise, you will leak tiles.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue