Auto merge of #9962 - mrobinson:display-list-simplification, r=pcwalton

Simplify the display list slightly

Now that WebRender uses an Iframe display item, we do not need the Noop
item for the non-WebRender path. We can simply reuse the Iframe display
item. Also remove the layer_id member from the LayeredItem struct, as
it is unused.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9962)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-03-11 11:22:29 +05:30
commit 40083a7aa8
3 changed files with 14 additions and 29 deletions

View file

@ -1141,28 +1141,22 @@ impl FragmentDisplayListBuilding for Fragment {
}
SpecificFragmentInfo::Iframe(ref fragment_info) => {
if !stacking_relative_content_box.is_empty() {
let item = DisplayItem::IframeClass(box IframeDisplayItem {
base: BaseDisplayItem::new(
&stacking_relative_content_box,
DisplayItemMetadata::new(self.node,
&*self.style,
Cursor::DefaultCursor),
clip),
iframe: fragment_info.pipeline_id,
});
if opts::get().use_webrender {
state.add_display_item(DisplayItem::IframeClass(box IframeDisplayItem {
base: BaseDisplayItem::new(
&stacking_relative_content_box,
DisplayItemMetadata::new(self.node,
&*self.style,
Cursor::DefaultCursor),
clip),
iframe: fragment_info.pipeline_id,
}), DisplayListSection::Content);
state.add_display_item(item, DisplayListSection::Content);
} else {
let layer_id = self.layer_id();
state.add_display_item(DisplayItem::LayeredItemClass(box LayeredItem {
item: DisplayItem::NoopClass(
box BaseDisplayItem::new(
&stacking_relative_content_box,
DisplayItemMetadata::new(self.node,
&*self.style,
Cursor::DefaultCursor),
clip)),
layer_id: layer_id,
layer_info: LayerInfo::new(layer_id,
item: item,
layer_info: LayerInfo::new(self.layer_id(),
ScrollPolicy::Scrollable,
Some(fragment_info.pipeline_id),
color::transparent()),
@ -1248,7 +1242,6 @@ impl FragmentDisplayListBuilding for Fragment {
} else {
state.add_display_item(DisplayItem::LayeredItemClass(box LayeredItem {
item: display_item,
layer_id: layer_id,
layer_info: LayerInfo::new(layer_id,
ScrollPolicy::Scrollable,
None,

View file

@ -504,8 +504,7 @@ impl WebRenderDisplayItemConverter for DisplayItem {
DisplayItem::LineClass(..) => {
println!("TODO DisplayItem::LineClass");
}
DisplayItem::LayeredItemClass(..) |
DisplayItem::NoopClass(..) => {
DisplayItem::LayeredItemClass(..) => {
panic!("Unexpected in webrender!");
}
DisplayItem::BoxShadowClass(ref item) => {