Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use DisplayListSection everywhere #9059

Merged
merged 1 commit into from Jan 9, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Use DisplayListSection everywhere

DisplayListSection, StackingLevel, and BackgroundAndBorderLevel all
represent pretty much the same thing, a particular section of the
display list. Instead of maintaining three enums which do the same
thing, just use DisplayListSection everywhere. It's a superset of the
other two and this change will make it easier to flatten the DisplayList
in the future for WebRender.
  • Loading branch information
mrobinson committed Jan 8, 2016
commit d72045269857031c8bd5838808b312cf842224b2
@@ -146,6 +146,10 @@ impl DisplayList {
}
}

/// Adds the given display item at the specified section of this display list.
pub fn add_to_section(&mut self, display_item: DisplayItem, section: DisplayListSection) {
self.get_section_mut(section).push_back(display_item);
}

/// Creates a new display list which contains a single stacking context.
#[inline]
@@ -554,7 +558,7 @@ impl DisplayList {
}

#[derive(Clone, Copy, Debug)]
enum DisplayListSection {
pub enum DisplayListSection {
BackgroundAndBorders,
BlockBackgroundsAndBorders,
Floats,
@@ -876,7 +880,7 @@ impl StackingContextLayerCreator {
}
}

parent_stacking_context.display_list.get_section_mut(section).push_back(item);
parent_stacking_context.display_list.add_to_section(item, section);
return;
}

@@ -930,7 +934,7 @@ impl StackingContextLayerCreator {
}

if let Some(ref mut display_list) = self.display_list_for_next_layer {
display_list.get_section_mut(section).push_back(item);
display_list.add_to_section(item, section);
}
}

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.