diff options
author | Martin Robinson <mrobinson@igalia.com> | 2016-02-19 14:52:56 -0800 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2016-02-19 15:53:12 -0800 |
commit | 630a9d4255c3fa0eecb69229be97df2d04e36f0a (patch) | |
tree | dbafd986396a8af5a597896459686090a1219e77 /components/layout/parallel.rs | |
parent | ff20a2d3dc574d73603783c5230a62e1c4c76723 (diff) | |
download | servo-630a9d4255c3fa0eecb69229be97df2d04e36f0a.tar.gz servo-630a9d4255c3fa0eecb69229be97df2d04e36f0a.zip |
Remove parallel display list construction
Parallel display list construction hasn't been shown to give any
performance gains. It is also incompatible with the current flat display
list implementation. Once flat display lists have landed, we can explore
possible benefits of parallel construction once again.
Diffstat (limited to 'components/layout/parallel.rs')
-rw-r--r-- | components/layout/parallel.rs | 60 |
1 files changed, 2 insertions, 58 deletions
diff --git a/components/layout/parallel.rs b/components/layout/parallel.rs index 4ea427b11ee..39986d86580 100644 --- a/components/layout/parallel.rs +++ b/components/layout/parallel.rs @@ -17,8 +17,8 @@ use std::sync::atomic::{AtomicIsize, Ordering}; use style::dom::{TNode, UnsafeNode}; use style::parallel::{CHUNK_SIZE, WorkQueueData}; use style::parallel::{run_queue_with_custom_work_data_type}; -use traversal::{AssignBSizesAndStoreOverflow, AssignISizes, BubbleISizes}; -use traversal::{BuildDisplayList, ComputeAbsolutePositions, PostorderNodeMutTraversal}; +use traversal::AssignBSizesAndStoreOverflow; +use traversal::{AssignISizes, BubbleISizes, PostorderNodeMutTraversal}; use util::opts; use util::workqueue::{WorkQueue, WorkUnit, WorkerProxy}; @@ -200,23 +200,6 @@ impl<'a> ParallelPreorderFlowTraversal for AssignISizes<'a> { impl<'a> ParallelPostorderFlowTraversal for AssignBSizesAndStoreOverflow<'a> {} -impl<'a> ParallelPreorderFlowTraversal for ComputeAbsolutePositions<'a> { - fn run_parallel(&self, - unsafe_flows: UnsafeFlowList, - proxy: &mut WorkerProxy<SharedLayoutContext, UnsafeFlowList>) { - self.run_parallel_helper(unsafe_flows, - proxy, - compute_absolute_positions, - build_display_list) - } - - fn should_record_thread_ids(&self) -> bool { - false - } -} - -impl<'a> ParallelPostorderFlowTraversal for BuildDisplayList<'a> {} - fn assign_inline_sizes(unsafe_flows: UnsafeFlowList, proxy: &mut WorkerProxy<SharedLayoutContext, UnsafeFlowList>) { let shared_layout_context = proxy.user_data(); @@ -237,28 +220,6 @@ fn assign_block_sizes_and_store_overflow( assign_block_sizes_traversal.run_parallel(unsafe_flow) } -fn compute_absolute_positions( - unsafe_flows: UnsafeFlowList, - proxy: &mut WorkerProxy<SharedLayoutContext, UnsafeFlowList>) { - let shared_layout_context = proxy.user_data(); - let layout_context = LayoutContext::new(shared_layout_context); - let compute_absolute_positions_traversal = ComputeAbsolutePositions { - layout_context: &layout_context, - }; - compute_absolute_positions_traversal.run_parallel(unsafe_flows, proxy); -} - -fn build_display_list(unsafe_flow: UnsafeFlow, - shared_layout_context: &SharedLayoutContext) { - let layout_context = LayoutContext::new(shared_layout_context); - - let build_display_list_traversal = BuildDisplayList { - layout_context: &layout_context, - }; - - build_display_list_traversal.run_parallel(unsafe_flow); -} - pub fn traverse_flow_tree_preorder( root: &mut FlowRef, profiler_metadata: Option<TimerMetadata>, @@ -281,20 +242,3 @@ pub fn traverse_flow_tree_preorder( }); }, shared_layout_context); } - -pub fn build_display_list_for_subtree( - root: &mut FlowRef, - profiler_metadata: Option<TimerMetadata>, - time_profiler_chan: time::ProfilerChan, - shared_layout_context: &SharedLayoutContext, - queue: &mut WorkQueue<SharedLayoutContext, WorkQueueData>) { - run_queue_with_custom_work_data_type(queue, |queue| { - profile(time::ProfilerCategory::LayoutParallelWarmup, profiler_metadata, - time_profiler_chan, || { - queue.push(WorkUnit { - fun: compute_absolute_positions, - data: (box vec![mut_owned_flow_to_unsafe_flow(root)], 0), - }) - }); - }, shared_layout_context); -} |