aboutsummaryrefslogtreecommitdiffstats
path: root/components/shared/script_layout/lib.rs
diff options
context:
space:
mode:
authoratbrakhi <atbrakhi@igalia.com>2024-09-13 07:51:19 +0200
committerGitHub <noreply@github.com>2024-09-13 05:51:19 +0000
commit497df024b185feb7370d3f9ebca10e18e7585099 (patch)
treeb64cae11866ee03e5fa4e3afb76568d6bd2e855e /components/shared/script_layout/lib.rs
parent03abf7751aead3d42f5a4e2207567dd3012cee96 (diff)
downloadservo-497df024b185feb7370d3f9ebca10e18e7585099.tar.gz
servo-497df024b185feb7370d3f9ebca10e18e7585099.zip
Trace more functions by adding perfetto tracing events (#33417)
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Diffstat (limited to 'components/shared/script_layout/lib.rs')
-rw-r--r--components/shared/script_layout/lib.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/components/shared/script_layout/lib.rs b/components/shared/script_layout/lib.rs
index c5e3bf89d60..3969cc332fb 100644
--- a/components/shared/script_layout/lib.rs
+++ b/components/shared/script_layout/lib.rs
@@ -140,6 +140,7 @@ pub struct TrustedNodeAddress(pub *const c_void);
unsafe impl Send for TrustedNodeAddress {}
/// Whether the pending image needs to be fetched or is waiting on an existing fetch.
+#[derive(Debug)]
pub enum PendingImageState {
Unrequested(ServoUrl),
PendingResponse,
@@ -148,6 +149,7 @@ pub enum PendingImageState {
/// The data associated with an image that is not yet present in the image cache.
/// Used by the script thread to hold on to DOM elements that need to be repainted
/// when an image fetch is complete.
+#[derive(Debug)]
pub struct PendingImage {
pub state: PendingImageState,
pub node: UntrustedNodeAddress,
@@ -365,19 +367,21 @@ impl ReflowGoal {
}
/// Information needed for a reflow.
+#[derive(Debug)]
pub struct Reflow {
/// A clipping rectangle for the page, an enlarged rectangle containing the viewport.
pub page_clip_rect: Rect<Au>,
}
/// Information derived from a layout pass that needs to be returned to the script thread.
-#[derive(Default)]
+#[derive(Debug, Default)]
pub struct ReflowComplete {
/// The list of images that were encountered that are in progress.
pub pending_images: Vec<PendingImage>,
}
/// Information needed for a script-initiated reflow.
+#[derive(Debug)]
pub struct ScriptReflow {
/// General reflow data.
pub reflow_info: Reflow,