gfx: Box stacking contexts to minimize memmove traffic.

`memmove` was showing up high in the profile when concatenating and
shorting display lists. This change drastically reduces the `memmove`
cost in exchange for some minor additional allocation cost.
This commit is contained in:
Patrick Walton 2016-03-02 11:47:02 -08:00
parent 3ff5082798
commit 4233e0f163
15 changed files with 35 additions and 36 deletions

View file

@ -224,7 +224,7 @@ pub trait Flow: fmt::Debug + Sync + Send + 'static {
fn collect_stacking_contexts(&mut self,
_parent_id: StackingContextId,
_: &mut Vec<StackingContext>)
_: &mut Vec<Box<StackingContext>>)
-> StackingContextId;
/// If this is a float, places it. The default implementation does nothing.
@ -1203,7 +1203,7 @@ impl BaseFlow {
pub fn collect_stacking_contexts_for_children(&mut self,
parent_id: StackingContextId,
contexts: &mut Vec<StackingContext>) {
contexts: &mut Vec<Box<StackingContext>>) {
for kid in self.children.iter_mut() {
kid.collect_stacking_contexts(parent_id, contexts);
}