aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/layout_thread.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2016-03-02 15:41:50 -0800
committerPatrick Walton <pcwalton@mimiga.net>2016-03-03 13:09:56 -0800
commitd3d2dd05f23918d27e554de98663ddcfd040235a (patch)
treeb798f75b77da277e8d8a857e7f178086760aa6e8 /components/layout/layout_thread.rs
parentf4b95dd00b00c0b43a424712b74b28577f139d79 (diff)
downloadservo-d3d2dd05f23918d27e554de98663ddcfd040235a.tar.gz
servo-d3d2dd05f23918d27e554de98663ddcfd040235a.zip
layout: Switch display list building from bottom-up to top-down.
This eliminates a lot of allocations and O(n^2) behavior.
Diffstat (limited to 'components/layout/layout_thread.rs')
-rw-r--r--components/layout/layout_thread.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/components/layout/layout_thread.rs b/components/layout/layout_thread.rs
index bf4a6ac9745..a361e42fb15 100644
--- a/components/layout/layout_thread.rs
+++ b/components/layout/layout_thread.rs
@@ -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();
}