diff options
author | Patrick Walton <pcwalton@mimiga.net> | 2015-05-13 17:13:59 -0700 |
---|---|---|
committer | Patrick Walton <pcwalton@mimiga.net> | 2015-05-19 16:53:51 -0700 |
commit | 6a197719b30a5731b168b4ca5b6351f3d487d651 (patch) | |
tree | 96e5d1f6f3be89512dabbe055e03cf2409b116a7 /components/layout/flow.rs | |
parent | acb9824229bf9e02eaabdb9d924f7db242a1ac85 (diff) | |
download | servo-6a197719b30a5731b168b4ca5b6351f3d487d651.tar.gz servo-6a197719b30a5731b168b4ca5b6351f3d487d651.zip |
compositing: Implement display ports and avoid creating display lists
for items outside it.
This improves Servo's performance on large pages.
Diffstat (limited to 'components/layout/flow.rs')
-rw-r--r-- | components/layout/flow.rs | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/components/layout/flow.rs b/components/layout/flow.rs index 57edf9ccd45..11d1c017db6 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -271,7 +271,7 @@ pub trait Flow: fmt::Debug + Sync { } /// Phase 4 of reflow: computes absolute positions. - fn compute_absolute_position(&mut self) { + fn compute_absolute_position(&mut self, _: &LayoutContext) { // The default implementation is a no-op. } @@ -859,6 +859,12 @@ pub struct BaseFlow { /// The clipping region for this flow and its descendants, in layer coordinates. pub clip: ClippingRegion, + /// The stacking-relative position of the display port. + /// + /// FIXME(pcwalton): This might be faster as an Arc, since this varies only + /// per-stacking-context. + pub stacking_relative_position_of_display_port: Rect<Au>, + /// The results of display list building for this flow. pub display_list_building_result: DisplayListBuildingResult, @@ -909,10 +915,18 @@ impl Encodable for BaseFlow { FlowClass::Block => c.as_immutable_block().encode(e), FlowClass::Inline => c.as_immutable_inline().encode(e), FlowClass::Table => c.as_immutable_table().encode(e), - FlowClass::TableWrapper => c.as_immutable_table_wrapper().encode(e), - FlowClass::TableRowGroup => c.as_immutable_table_rowgroup().encode(e), - FlowClass::TableRow => c.as_immutable_table_row().encode(e), - FlowClass::TableCell => c.as_immutable_table_cell().encode(e), + FlowClass::TableWrapper => { + c.as_immutable_table_wrapper().encode(e) + } + FlowClass::TableRowGroup => { + c.as_immutable_table_rowgroup().encode(e) + } + FlowClass::TableRow => { + c.as_immutable_table_row().encode(e) + } + FlowClass::TableCell => { + c.as_immutable_table_cell().encode(e) + } _ => { Ok(()) } // TODO: Support captions } }) @@ -1024,6 +1038,7 @@ impl BaseFlow { display_list_building_result: DisplayListBuildingResult::None, absolute_position_info: AbsolutePositionInfo::new(writing_mode), clip: ClippingRegion::max(), + stacking_relative_position_of_display_port: Rect::zero(), flags: flags, writing_mode: writing_mode, thread_id: 0, |