mirror of
https://github.com/servo/servo.git
synced 2025-08-08 15:05:35 +01:00
compositing: Implement display ports and avoid creating display lists
for items outside it. This improves Servo's performance on large pages.
This commit is contained in:
parent
acb9824229
commit
6a197719b3
26 changed files with 340 additions and 66 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue