From d1c50b456a9e0f9b236a5d9130c5dd9274d935c3 Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Tue, 10 Mar 2020 11:03:58 +0000 Subject: [PATCH] Bug 1618132 - Avoid redundant hit test tree builds. r=gw build_frame is called by update_document which calls rebuild_hit_tester if the hit test tree is invalidated. The advantage of doing it there is that it is after the frame has been submitted to the renderer so we are out of the critical path and the work can overlap with draw call submission. So we don't need to do the work in build_frame, and since we don't currently set the validity flag there we are often re-building the hit test tree a second time after frame building. Differential Revision: https://phabricator.services.mozilla.com/D64328 --HG-- extra : moz-landing-system : lando --- gfx/wr/webrender/src/render_backend.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/gfx/wr/webrender/src/render_backend.rs b/gfx/wr/webrender/src/render_backend.rs index 420e0a069ae2..c3887efc4a31 100644 --- a/gfx/wr/webrender/src/render_backend.rs +++ b/gfx/wr/webrender/src/render_backend.rs @@ -581,15 +581,10 @@ impl Document { tile_cache_logger, ); - let hit_tester = Arc::new(self.scene.create_hit_tester(&self.data_stores.clip)); - self.hit_tester = Some(Arc::clone(&hit_tester)); - self.shared_hit_tester.update(hit_tester); - frame }; self.frame_is_valid = true; - self.hit_tester_is_valid = true; let is_new_scene = self.has_built_scene; self.has_built_scene = false;