mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
layout: Switch display list building from bottom-up to top-down.
This eliminates a lot of allocations and O(n^2) behavior.
This commit is contained in:
parent
f4b95dd00b
commit
d3d2dd05f2
5 changed files with 35 additions and 58 deletions
|
@ -875,9 +875,10 @@ impl LayoutThread {
|
|||
false,
|
||||
None);
|
||||
|
||||
sequential::build_display_list_for_subtree(layout_root,
|
||||
&mut root_stacking_context,
|
||||
shared_layout_context);
|
||||
let display_list_entries =
|
||||
sequential::build_display_list_for_subtree(layout_root,
|
||||
&mut root_stacking_context,
|
||||
shared_layout_context);
|
||||
|
||||
if data.goal == ReflowGoal::ForDisplay {
|
||||
debug!("Done building display list.");
|
||||
|
@ -900,11 +901,9 @@ impl LayoutThread {
|
|||
ScrollPolicy::Scrollable,
|
||||
None,
|
||||
root_background_color));
|
||||
let display_list = DisplayList::new(
|
||||
root_stacking_context,
|
||||
&mut flow::mut_base(flow_ref::deref_mut(layout_root))
|
||||
.display_list_building_result);
|
||||
|
||||
let display_list = DisplayList::new(root_stacking_context,
|
||||
&mut Some(display_list_entries));
|
||||
if opts::get().dump_display_list {
|
||||
display_list.print();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue