mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
metrics: Simplify ProgressiveWebMetrics
(#35985)
Simply how `ProgressiveWebMetrics` works: 1. Keep only a single struct instead of one in layout and one script that both implement the `ProgressiveWebMetrics` trait. Since layout and script are the same thread these can now just be a single `ProgressiveWebMetrics` struct stored in script. 2. Have the compositor be responsible for informing the Constellation (which informs the ScripThread) about paint metrics. This makes communication flow one way and removes one dependency between the compositor and script (of two). 3. All units tests are moved into the `metrics` crate itself since there is only one struct there now. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
1f232eb17c
commit
5424479768
26 changed files with 416 additions and 787 deletions
|
@ -305,6 +305,15 @@ pub struct CompositorDisplayListInfo {
|
|||
/// The `ScrollTreeNodeId` of the topmost scrolling frame of this info's scroll
|
||||
/// tree.
|
||||
pub root_scroll_node_id: ScrollTreeNodeId,
|
||||
|
||||
/// Contentful paint i.e. whether the display list contains items of type
|
||||
/// text, image, non-white canvas or SVG). Used by metrics.
|
||||
/// See <https://w3c.github.io/paint-timing/#first-contentful-paint>.
|
||||
pub is_contentful: bool,
|
||||
|
||||
/// Whether the first layout or a subsequent (incremental) layout triggered this
|
||||
/// display list creation.
|
||||
pub first_reflow: bool,
|
||||
}
|
||||
|
||||
impl CompositorDisplayListInfo {
|
||||
|
@ -316,6 +325,7 @@ impl CompositorDisplayListInfo {
|
|||
pipeline_id: PipelineId,
|
||||
epoch: Epoch,
|
||||
viewport_scroll_sensitivity: AxesScrollSensitivity,
|
||||
first_reflow: bool,
|
||||
) -> Self {
|
||||
let mut scroll_tree = ScrollTree::default();
|
||||
let root_reference_frame_id = scroll_tree.add_scroll_tree_node(
|
||||
|
@ -343,6 +353,8 @@ impl CompositorDisplayListInfo {
|
|||
scroll_tree,
|
||||
root_reference_frame_id,
|
||||
root_scroll_node_id,
|
||||
is_contentful: false,
|
||||
first_reflow,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue