mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Pass a &mut Flow to traverse_flow_tree_preorder.
This commit is contained in:
parent
0efa583df4
commit
fa0e198c8f
3 changed files with 7 additions and 9 deletions
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
use context::{LayoutContext, SharedLayoutContext};
|
use context::{LayoutContext, SharedLayoutContext};
|
||||||
use flow::{self, Flow, MutableFlowUtils, PostorderFlowTraversal, PreorderFlowTraversal};
|
use flow::{self, Flow, MutableFlowUtils, PostorderFlowTraversal, PreorderFlowTraversal};
|
||||||
use flow_ref::{self, FlowRef};
|
use flow_ref::FlowRef;
|
||||||
use profile_traits::time::{self, TimerMetadata, profile};
|
use profile_traits::time::{self, TimerMetadata, profile};
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use std::sync::atomic::{AtomicIsize, Ordering};
|
use std::sync::atomic::{AtomicIsize, Ordering};
|
||||||
|
@ -220,7 +220,7 @@ fn assign_block_sizes_and_store_overflow(
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn traverse_flow_tree_preorder(
|
pub fn traverse_flow_tree_preorder(
|
||||||
root: &mut FlowRef,
|
root: &mut Flow,
|
||||||
profiler_metadata: Option<TimerMetadata>,
|
profiler_metadata: Option<TimerMetadata>,
|
||||||
time_profiler_chan: time::ProfilerChan,
|
time_profiler_chan: time::ProfilerChan,
|
||||||
shared_layout_context: &SharedLayoutContext,
|
shared_layout_context: &SharedLayoutContext,
|
||||||
|
@ -228,7 +228,7 @@ pub fn traverse_flow_tree_preorder(
|
||||||
if opts::get().bubble_inline_sizes_separately {
|
if opts::get().bubble_inline_sizes_separately {
|
||||||
let layout_context = LayoutContext::new(shared_layout_context);
|
let layout_context = LayoutContext::new(shared_layout_context);
|
||||||
let bubble_inline_sizes = BubbleISizes { layout_context: &layout_context };
|
let bubble_inline_sizes = BubbleISizes { layout_context: &layout_context };
|
||||||
flow_ref::deref_mut(root).traverse_postorder(&bubble_inline_sizes);
|
root.traverse_postorder(&bubble_inline_sizes);
|
||||||
}
|
}
|
||||||
|
|
||||||
run_queue_with_custom_work_data_type(queue, |queue| {
|
run_queue_with_custom_work_data_type(queue, |queue| {
|
||||||
|
@ -236,7 +236,7 @@ pub fn traverse_flow_tree_preorder(
|
||||||
time_profiler_chan, || {
|
time_profiler_chan, || {
|
||||||
queue.push(WorkUnit {
|
queue.push(WorkUnit {
|
||||||
fun: assign_inline_sizes,
|
fun: assign_inline_sizes,
|
||||||
data: (box vec![mut_owned_flow_to_unsafe_flow(root)], 0),
|
data: (box vec![borrowed_flow_to_unsafe_flow(root)], 0),
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
}, shared_layout_context);
|
}, shared_layout_context);
|
||||||
|
|
|
@ -41,7 +41,7 @@ pub fn resolve_generated_content(root: &mut Flow, shared_layout_context: &Shared
|
||||||
doit(root, 0, &mut traversal)
|
doit(root, 0, &mut traversal)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn traverse_flow_tree_preorder(root: &mut FlowRef,
|
pub fn traverse_flow_tree_preorder(root: &mut Flow,
|
||||||
shared_layout_context: &SharedLayoutContext) {
|
shared_layout_context: &SharedLayoutContext) {
|
||||||
fn doit(flow: &mut Flow,
|
fn doit(flow: &mut Flow,
|
||||||
assign_inline_sizes: AssignISizes,
|
assign_inline_sizes: AssignISizes,
|
||||||
|
@ -61,8 +61,6 @@ pub fn traverse_flow_tree_preorder(root: &mut FlowRef,
|
||||||
|
|
||||||
let layout_context = LayoutContext::new(shared_layout_context);
|
let layout_context = LayoutContext::new(shared_layout_context);
|
||||||
|
|
||||||
let root = flow_ref::deref_mut(root);
|
|
||||||
|
|
||||||
if opts::get().bubble_inline_sizes_separately {
|
if opts::get().bubble_inline_sizes_separately {
|
||||||
let bubble_inline_sizes = BubbleISizes { layout_context: &layout_context };
|
let bubble_inline_sizes = BubbleISizes { layout_context: &layout_context };
|
||||||
{
|
{
|
||||||
|
|
|
@ -875,7 +875,7 @@ impl LayoutThread {
|
||||||
fn solve_constraints(layout_root: &mut FlowRef,
|
fn solve_constraints(layout_root: &mut FlowRef,
|
||||||
shared_layout_context: &SharedLayoutContext) {
|
shared_layout_context: &SharedLayoutContext) {
|
||||||
let _scope = layout_debug_scope!("solve_constraints");
|
let _scope = layout_debug_scope!("solve_constraints");
|
||||||
sequential::traverse_flow_tree_preorder(layout_root, shared_layout_context);
|
sequential::traverse_flow_tree_preorder(flow_ref::deref_mut(layout_root), shared_layout_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Performs layout constraint solving in parallel.
|
/// Performs layout constraint solving in parallel.
|
||||||
|
@ -892,7 +892,7 @@ impl LayoutThread {
|
||||||
|
|
||||||
// NOTE: this currently computes borders, so any pruning should separate that
|
// NOTE: this currently computes borders, so any pruning should separate that
|
||||||
// operation out.
|
// operation out.
|
||||||
parallel::traverse_flow_tree_preorder(layout_root,
|
parallel::traverse_flow_tree_preorder(flow_ref::deref_mut(layout_root),
|
||||||
profiler_metadata,
|
profiler_metadata,
|
||||||
time_profiler_chan,
|
time_profiler_chan,
|
||||||
shared_layout_context,
|
shared_layout_context,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue