diff options
author | Patrick Walton <pcwalton@mimiga.net> | 2014-10-28 14:28:34 -0700 |
---|---|---|
committer | Patrick Walton <pcwalton@mimiga.net> | 2014-10-28 14:28:34 -0700 |
commit | 93bf69a6fe8d026d087760925c309acb8e137148 (patch) | |
tree | beb73e2e8aa87dc99bef8ee25d5ceacd4cc08372 /components/layout/layout_task.rs | |
parent | 3aad350a648bd69ca3410011f6e7eccf5813cb31 (diff) | |
download | servo-93bf69a6fe8d026d087760925c309acb8e137148.tar.gz servo-93bf69a6fe8d026d087760925c309acb8e137148.zip |
layout: Use the new `append_from` method to get rid of a bunch of moves
in display list construction.
These were showing up in the profile.
Diffstat (limited to 'components/layout/layout_task.rs')
-rw-r--r-- | components/layout/layout_task.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index d35aed10bcd..852ebe971f8 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -710,11 +710,10 @@ impl LayoutTask { debug!("Done building display list. Display List = {}", flow::base(layout_root.deref()).display_list); - let root_display_list = - mem::replace(&mut flow::mut_base(layout_root.deref_mut()).display_list, - DisplayList::new()); - root_display_list.debug(); - let display_list = Arc::new(root_display_list.flatten(ContentStackingLevel)); + flow::mut_base(&mut *layout_root).display_list.flatten(ContentStackingLevel); + let display_list = + Arc::new(mem::replace(&mut flow::mut_base(&mut *layout_root).display_list, + DisplayList::new())); // FIXME(pcwalton): This is really ugly and can't handle overflow: scroll. Refactor // it with extreme prejudice. @@ -754,7 +753,7 @@ impl LayoutTask { scroll_policy: Scrollable, }; - rw_data.display_list = Some(display_list.clone()); + rw_data.display_list = Some(display_list); // TODO(pcwalton): Eventually, when we have incremental reflow, this will have to // be smarter in order to handle retained layer contents properly from reflow to |