From 6b9924bec437b2a5504656ad1d27ffa99e3735bc Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Tue, 4 Jun 2019 21:21:31 -0700 Subject: [PATCH] Stop storing display lists in an `Arc` --- components/layout/query.rs | 2 +- components/layout_thread/lib.rs | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/components/layout/query.rs b/components/layout/query.rs index a74eda165e2..789056753d5 100644 --- a/components/layout/query.rs +++ b/components/layout/query.rs @@ -51,7 +51,7 @@ pub struct LayoutThreadData { pub constellation_chan: IpcSender, /// The root stacking context. - pub display_list: Option>, + pub display_list: Option, pub indexable_text: IndexableText, diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index bbd3c238b5b..1afe8e37e9f 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -1203,7 +1203,7 @@ impl LayoutThread { &mut build_state.indexable_text, IndexableText::default(), ); - rw_data.display_list = Some(Arc::new(build_state.to_display_list())); + rw_data.display_list = Some(build_state.to_display_list()); } } @@ -1220,7 +1220,8 @@ impl LayoutThread { if let Some(document) = document { document.will_paint(); } - let display_list = (*rw_data.display_list.as_ref().unwrap()).clone(); + + let display_list = rw_data.display_list.as_mut().unwrap(); if self.dump_display_list { display_list.print(); @@ -1232,11 +1233,7 @@ impl LayoutThread { debug!("Layout done!"); // TODO: Avoid the temporary conversion and build webrender sc/dl directly! - let builder = rw_data - .display_list - .as_ref() - .unwrap() - .convert_to_webrender(self.id); + let builder = display_list.convert_to_webrender(self.id); let viewport_size = Size2D::new( self.viewport_size.width.to_f32_px(),