Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync changes from mozilla-central gfx/wr #3844

Merged
merged 6 commits into from Jan 25, 2020

Bug 1558926 - Part 4: Avoid display list updates for removed pipelines

  • Loading branch information
mikokm authored and moz-gfx committed Jan 25, 2020
commit bf1ecebcb78b0cc479f58400e63dfa7daf174cea
@@ -255,6 +255,7 @@ pub struct SceneBuilderThread {
size_of_ops: Option<MallocSizeOfOps>,
hooks: Option<Box<dyn SceneBuilderHooks + Send>>,
simulate_slow_ms: u32,
removed_pipelines: FastHashSet<PipelineId>
}

pub struct SceneBuilderThreadChannels {
@@ -299,6 +300,7 @@ impl SceneBuilderThread {
size_of_ops,
hooks,
simulate_slow_ms: 0,
removed_pipelines: FastHashSet::default(),
}
}

@@ -529,7 +531,24 @@ impl SceneBuilderThread {
.or_insert_with(|| Document::new(Scene::new()));
let scene = &mut doc.scene;

for &(pipeline_id, epoch) in &txn.epoch_updates {
scene.update_epoch(pipeline_id, epoch);
}

if let Some(id) = txn.set_root_pipeline {
scene.set_root_pipeline_id(id);
}

for &(pipeline_id, _) in &txn.removed_pipelines {
scene.remove_pipeline(pipeline_id);
self.removed_pipelines.insert(pipeline_id);
}

for update in txn.display_list_updates.drain(..) {
if self.removed_pipelines.contains(&update.pipeline_id) {
continue;
}

scene.set_display_list(
update.pipeline_id,
update.epoch,
@@ -540,17 +559,7 @@ impl SceneBuilderThread {
);
}

for &(pipeline_id, epoch) in &txn.epoch_updates {
scene.update_epoch(pipeline_id, epoch);
}

if let Some(id) = txn.set_root_pipeline {
scene.set_root_pipeline_id(id);
}

for &(pipeline_id, _) in &txn.removed_pipelines {
scene.remove_pipeline(pipeline_id)
}
self.removed_pipelines.clear();

let mut built_scene = None;
let mut interner_updates = None;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.