From 723ecc70b617a1365b8ad107857b85e1aac29149 Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Thu, 14 May 2020 12:40:49 +0000 Subject: [PATCH] Bug 1637300 - Further reduce unnecessary scene building. r=gw Differential Revision: https://phabricator.services.mozilla.com/D74881 --- gfx/wr/webrender/src/scene_builder_thread.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gfx/wr/webrender/src/scene_builder_thread.rs b/gfx/wr/webrender/src/scene_builder_thread.rs index 3adf4a27d34a..b24dca653fb5 100644 --- a/gfx/wr/webrender/src/scene_builder_thread.rs +++ b/gfx/wr/webrender/src/scene_builder_thread.rs @@ -633,7 +633,6 @@ impl SceneBuilderThread { list_data, preserve_frame_state, } => { - rebuild_scene = true; let built_display_list = BuiltDisplayList::from_data(list_data, list_descriptor); let display_list_len = built_display_list.data().len(); @@ -645,6 +644,11 @@ impl SceneBuilderThread { continue; } + // Note: We could further reduce the amount of unnecessary scene + // building by keeping track of which pipelines are used by the + // scene (bug 1490751). + rebuild_scene = true; + scene.set_display_list( pipeline_id, epoch, @@ -669,8 +673,10 @@ impl SceneBuilderThread { } } SceneMsg::SetRootPipeline(pipeline_id) => { - rebuild_scene = true; - scene.set_root_pipeline_id(pipeline_id); + if scene.root_pipeline_id != Some(pipeline_id) { + rebuild_scene = true; + scene.set_root_pipeline_id(pipeline_id); + } } SceneMsg::RemovePipeline(pipeline_id) => { scene.remove_pipeline(pipeline_id);