aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/table_row.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-03-02 06:21:08 +0530
committerbors-servo <lbergstrom+bors@mozilla.com>2016-03-02 06:21:08 +0530
commit62814f7cb486bc267a796b7ce58c51d59240fad0 (patch)
tree1476f7bcc391edddf6392bd9327b5e014d9475ce /components/layout/table_row.rs
parent70941e3806786d4bc4da3165e234e70249316de0 (diff)
parente7019f2721acd586496a14e8c7132928da9d3594 (diff)
downloadservo-62814f7cb486bc267a796b7ce58c51d59240fad0.tar.gz
servo-62814f7cb486bc267a796b7ce58c51d59240fad0.zip
Auto merge of #9756 - mrobinson:flat-display-lists-webrender, r=pcwalton
Flatten display list structure Instead of producing a tree of stacking contexts, display list generation now produces a flat list of display items and a tree of stacking contexts. This will eventually allow display list construction to produce and modify WebRender vertex buffers directly, removing the overhead of display list conversion. This change also moves layerization of the display list to the paint thread, since it isn't currently useful for WebRender. To accomplish this, display list generation now takes three passes of the flow tree: 1. Calculation of absolute positions. 2. Collection of a tree of stacking contexts. 3. Creation of a list of display items. After collection of display items, they are sorted based upon the index of their parent stacking contexts and their position in CSS 2.1 Appendeix E stacking order. This is a big change, but it actually simplifies display list generation. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9756) <!-- Reviewable:end -->
Diffstat (limited to 'components/layout/table_row.rs')
-rw-r--r--components/layout/table_row.rs17
1 files changed, 11 insertions, 6 deletions
diff --git a/components/layout/table_row.rs b/components/layout/table_row.rs
index a7da3b19749..f0e326414e2 100644
--- a/components/layout/table_row.rs
+++ b/components/layout/table_row.rs
@@ -10,12 +10,12 @@ use app_units::Au;
use block::{BlockFlow, ISizeAndMarginsComputer};
use context::LayoutContext;
use cssparser::{Color, RGBA};
-use display_list_builder::{BlockFlowDisplayListBuilding, BorderPaintingMode};
+use display_list_builder::{BlockFlowDisplayListBuilding, BorderPaintingMode, DisplayListBuildState};
use euclid::Point2D;
use flow::{self, EarlyAbsolutePositionInfo, Flow, FlowClass, ImmutableFlowUtils, OpaqueFlow};
use flow_list::MutFlowListIterator;
use fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
-use gfx::display_list::DisplayList;
+use gfx::display_list::{StackingContext, StackingContextId};
use layout_debug;
use model::MaybeAuto;
use rustc_serialize::{Encodable, Encoder};
@@ -420,7 +420,7 @@ impl Flow for TableRowFlow {
self.block_flow.update_late_computed_block_position_if_necessary(block_position)
}
- fn build_display_list(&mut self, layout_context: &LayoutContext) {
+ fn build_display_list(&mut self, state: &mut DisplayListBuildState) {
let border_painting_mode = match self.block_flow
.fragment
.style
@@ -430,9 +430,14 @@ impl Flow for TableRowFlow {
border_collapse::T::collapse => BorderPaintingMode::Hidden,
};
- self.block_flow.build_display_list_for_block(box DisplayList::new(),
- layout_context,
- border_painting_mode);
+ self.block_flow.build_display_list_for_block(state, border_painting_mode);
+ }
+
+ fn collect_stacking_contexts(&mut self,
+ parent_id: StackingContextId,
+ contexts: &mut Vec<StackingContext>)
+ -> StackingContextId {
+ self.block_flow.collect_stacking_contexts(parent_id, contexts)
}
fn repair_style(&mut self, new_style: &Arc<ComputedValues>) {