Bug 1558926 - Part 4: Avoid display list updates for removed pipelines
☠☠ backed out by 65b1787817bd ☠ ☠
authorMiko Mynttinen <mikokm@gmail.com>
Wed, 22 Jan 2020 22:19:08 +0000
changeset 511697 1865e6d29dcfdcc1ec7adb5a5fa8fa9df183083b
parent 511696 92b415dac733b24ce8013e2ba6dd629c25c7af5c
child 511698 974bcab6b1bf3cea22595e23d06cd9457d302299
push id37054
push userbtara@mozilla.com
push dateSat, 25 Jan 2020 09:45:27 +0000
treeherdermozilla-central@f7f534f08b48 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1558926
milestone74.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1558926 - Part 4: Avoid display list updates for removed pipelines Depends on D60759 Differential Revision: https://phabricator.services.mozilla.com/D60760
gfx/wr/webrender/src/scene_builder_thread.rs
--- a/gfx/wr/webrender/src/scene_builder_thread.rs
+++ b/gfx/wr/webrender/src/scene_builder_thread.rs
@@ -250,16 +250,17 @@ pub struct SceneBuilderThread {
     documents: FastHashMap<DocumentId, Document>,
     rx: Receiver<SceneBuilderRequest>,
     tx: Sender<SceneBuilderResult>,
     api_tx: MsgSender<ApiMsg>,
     config: FrameBuilderConfig,
     size_of_ops: Option<MallocSizeOfOps>,
     hooks: Option<Box<dyn SceneBuilderHooks + Send>>,
     simulate_slow_ms: u32,
+    removed_pipelines: FastHashSet<PipelineId>
 }
 
 pub struct SceneBuilderThreadChannels {
     rx: Receiver<SceneBuilderRequest>,
     tx: Sender<SceneBuilderResult>,
     api_tx: MsgSender<ApiMsg>,
 }
 
@@ -294,16 +295,17 @@ impl SceneBuilderThread {
             documents: Default::default(),
             rx,
             tx,
             api_tx,
             config,
             size_of_ops,
             hooks,
             simulate_slow_ms: 0,
+            removed_pipelines: FastHashSet::default(),
         }
     }
 
     /// Send a message to the render backend thread.
     ///
     /// We first put something in the result queue and then send a wake-up
     /// message to the api queue that the render backend is blocking on.
     pub fn send(&self, msg: SceneBuilderResult) {
@@ -524,38 +526,45 @@ impl SceneBuilderThread {
 
         let scene_build_start_time = precise_time_ns();
 
         let doc = self.documents
                       .entry(txn.document_id)
                       .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,
                 update.built_display_list,
                 update.background,
                 update.viewport_size,
                 update.content_size,
             );
         }
 
-        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;
         if scene.has_root_pipeline() {
             if let Some(request) = txn.request_scene_build.take() {
                 let built = SceneBuilder::build(
                     &scene,
                     request.font_instances,