Separate stacking context collection and display list building state

These are two different passes during layout, but previously they
shared a state object. While some of the members are the same, many are
different so we separate them out into two separate objects. We also
change the HashMaps of these state objects to use the FnvHashMap.
This commit is contained in:
Martin Robinson 2017-08-30 20:03:44 +02:00
parent bffe158fa4
commit ee46bc57ed
15 changed files with 153 additions and 94 deletions

View file

@ -6,7 +6,7 @@
use app_units::Au;
use context::LayoutContext;
use display_list_builder::DisplayListBuildState;
use display_list_builder::{DisplayListBuildState, StackingContextCollectionState};
use euclid::{Point2D, Vector2D};
use floats::SpeculatedFloatPlacement;
use flow::{self, Flow, ImmutableFlowUtils, IS_ABSOLUTELY_POSITIONED};
@ -69,9 +69,10 @@ pub fn reflow(root: &mut Flow, layout_context: &LayoutContext, relayout_mode: Re
pub fn build_display_list_for_subtree<'a>(flow_root: &mut Flow,
layout_context: &'a LayoutContext)
-> DisplayListBuildState<'a> {
let mut state = DisplayListBuildState::new(layout_context);
let mut state = StackingContextCollectionState::new(layout_context.id);
flow_root.collect_stacking_contexts(&mut state);
let state = DisplayListBuildState::new(layout_context, state);
let mut build_display_list = BuildDisplayList {
state: state,
};