mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Stop creating a LayoutContext in build_display_list_for_subtree.
This commit is contained in:
parent
871c207c44
commit
fd68208da6
2 changed files with 4 additions and 5 deletions
|
@ -82,14 +82,13 @@ pub fn build_display_list_for_subtree(root: &mut FlowRef,
|
|||
shared_layout_context: &SharedLayoutContext)
|
||||
-> Vec<DisplayItem> {
|
||||
let flow_root = flow_ref::deref_mut(root);
|
||||
let layout_context = LayoutContext::new(shared_layout_context);
|
||||
flow_root.traverse_preorder(&ComputeAbsolutePositions { layout_context: &layout_context });
|
||||
flow_root.traverse_preorder(&ComputeAbsolutePositions { layout_context: shared_layout_context });
|
||||
let mut children = vec![];
|
||||
flow_root.collect_stacking_contexts(root_stacking_context.id,
|
||||
&mut children);
|
||||
root_stacking_context.add_children(children);
|
||||
let mut build_display_list = BuildDisplayList {
|
||||
state: DisplayListBuildState::new(&layout_context.shared,
|
||||
state: DisplayListBuildState::new(shared_layout_context,
|
||||
flow::base(&*flow_root).stacking_context_id),
|
||||
};
|
||||
build_display_list.traverse(&mut *flow_root);
|
||||
|
|
|
@ -198,13 +198,13 @@ impl<'a> PostorderFlowTraversal for AssignBSizes<'a> {
|
|||
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct ComputeAbsolutePositions<'a> {
|
||||
pub layout_context: &'a LayoutContext<'a>,
|
||||
pub layout_context: &'a SharedLayoutContext,
|
||||
}
|
||||
|
||||
impl<'a> PreorderFlowTraversal for ComputeAbsolutePositions<'a> {
|
||||
#[inline]
|
||||
fn process(&self, flow: &mut Flow) {
|
||||
flow.compute_absolute_position(self.layout_context.shared);
|
||||
flow.compute_absolute_position(self.layout_context);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue