Stop storing display lists in an Arc

This commit is contained in:
Patrick Walton 2019-06-04 21:21:31 -07:00 committed by Josh Matthews
parent 7ca570dd1d
commit 6b9924bec4
2 changed files with 5 additions and 8 deletions

View file

@ -51,7 +51,7 @@ pub struct LayoutThreadData {
pub constellation_chan: IpcSender<ConstellationMsg>, pub constellation_chan: IpcSender<ConstellationMsg>,
/// The root stacking context. /// The root stacking context.
pub display_list: Option<Arc<DisplayList>>, pub display_list: Option<DisplayList>,
pub indexable_text: IndexableText, pub indexable_text: IndexableText,

View file

@ -1203,7 +1203,7 @@ impl LayoutThread {
&mut build_state.indexable_text, &mut build_state.indexable_text,
IndexableText::default(), 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 { if let Some(document) = document {
document.will_paint(); 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 { if self.dump_display_list {
display_list.print(); display_list.print();
@ -1232,11 +1233,7 @@ impl LayoutThread {
debug!("Layout done!"); debug!("Layout done!");
// TODO: Avoid the temporary conversion and build webrender sc/dl directly! // TODO: Avoid the temporary conversion and build webrender sc/dl directly!
let builder = rw_data let builder = display_list.convert_to_webrender(self.id);
.display_list
.as_ref()
.unwrap()
.convert_to_webrender(self.id);
let viewport_size = Size2D::new( let viewport_size = Size2D::new(
self.viewport_size.width.to_f32_px(), self.viewport_size.width.to_f32_px(),