mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +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
|
@ -18,7 +18,7 @@ use net_traits::FetchResponseMsg;
|
|||
use net_traits::image_cache::PendingImageResponse;
|
||||
use profile_traits::mem::{self as profile_mem, OpaqueSender, ReportsChan};
|
||||
use profile_traits::time::{self as profile_time};
|
||||
use script_traits::{LayoutMsg, Painter, ScriptMsg, ScriptThreadMessage};
|
||||
use script_traits::{Painter, ScriptMsg, ScriptThreadMessage};
|
||||
use stylo_atoms::Atom;
|
||||
use timers::TimerScheduler;
|
||||
#[cfg(feature = "webgpu")]
|
||||
|
@ -88,7 +88,6 @@ impl MixedMessage {
|
|||
#[cfg(feature = "webgpu")]
|
||||
ScriptThreadMessage::SetWebGPUPort(..) => None,
|
||||
ScriptThreadMessage::SetScrollStates(id, ..) => Some(*id),
|
||||
ScriptThreadMessage::SetEpochPaintTime(id, ..) => Some(*id),
|
||||
},
|
||||
MixedMessage::FromScript(inner_msg) => match inner_msg {
|
||||
MainThreadScriptMsg::Common(CommonScriptMsg::Task(_, _, pipeline_id, _)) => {
|
||||
|
@ -318,10 +317,6 @@ pub(crate) struct ScriptThreadSenders {
|
|||
#[no_trace]
|
||||
pub(crate) pipeline_to_constellation_sender: IpcSender<(PipelineId, ScriptMsg)>,
|
||||
|
||||
/// A sender for layout to communicate to the constellation.
|
||||
#[no_trace]
|
||||
pub(crate) layout_to_constellation_ipc_sender: IpcSender<LayoutMsg>,
|
||||
|
||||
/// The shared [`IpcSender`] which is sent to the `ImageCache` when requesting an image. The
|
||||
/// messages on this channel are routed to crossbeam [`Sender`] on the router thread, which
|
||||
/// in turn sends messages to [`ScriptThreadReceivers::image_cache_receiver`].
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue