mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Ensure compositor layers are collected when removed from layout.
This commit is contained in:
parent
e44ae6404f
commit
6506468e19
2 changed files with 57 additions and 0 deletions
|
@ -379,6 +379,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
(Msg::InitializeLayersForPipeline(pipeline_id, epoch, properties),
|
||||
ShutdownState::NotShuttingDown) => {
|
||||
self.get_or_create_pipeline_details(pipeline_id).current_epoch = epoch;
|
||||
self.collect_old_layers(pipeline_id, &properties);
|
||||
for (index, layer_properties) in properties.iter().enumerate() {
|
||||
if index == 0 {
|
||||
self.create_or_update_base_layer(pipeline_id, *layer_properties);
|
||||
|
@ -671,6 +672,17 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
self.find_layer_with_pipeline_and_layer_id(pipeline_id, LayerId::null())
|
||||
}
|
||||
|
||||
fn collect_old_layers(&mut self,
|
||||
pipeline_id: PipelineId,
|
||||
new_layers: &Vec<LayerProperties>) {
|
||||
let root_layer = match self.scene.root {
|
||||
Some(ref root_layer) => root_layer.clone(),
|
||||
None => return,
|
||||
};
|
||||
|
||||
root_layer.collect_old_layers(self, pipeline_id, new_layers);
|
||||
}
|
||||
|
||||
fn remove_pipeline_root_layer(&mut self, pipeline_id: PipelineId) {
|
||||
let root_layer = match self.scene.root {
|
||||
Some(ref root_layer) => root_layer.clone(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue