From 237674727355f507f4bb04564069b8761165471b Mon Sep 17 00:00:00 2001 From: Oriol Brufau Date: Mon, 22 May 2023 13:13:12 +0200 Subject: [PATCH] Further changes required by Servo --- components/style/driver.rs | 1 + components/style/lib.rs | 1 + components/style/parallel.rs | 2 ++ 3 files changed, 4 insertions(+) diff --git a/components/style/driver.rs b/components/style/driver.rs index 41833c9c320..82ed2a66386 100644 --- a/components/style/driver.rs +++ b/components/style/driver.rs @@ -140,6 +140,7 @@ where // ensures that we process all the elements at a given depth before // proceeding to the next depth, which is important for style sharing. rayon::scope_fifo(|scope| { + #[cfg(feature = "gecko")] gecko_profiler_label!(Layout, StyleComputation); parallel::traverse_nodes( drain, diff --git a/components/style/lib.rs b/components/style/lib.rs index ddfbd5d5995..b721ea0d952 100644 --- a/components/style/lib.rs +++ b/components/style/lib.rs @@ -34,6 +34,7 @@ extern crate debug_unreachable; #[macro_use] extern crate derive_more; #[macro_use] +#[cfg(feature = "gecko")] extern crate gecko_profiler; #[cfg(feature = "gecko")] #[macro_use] diff --git a/components/style/parallel.rs b/components/style/parallel.rs index fea031115a7..82f003cff71 100644 --- a/components/style/parallel.rs +++ b/components/style/parallel.rs @@ -274,6 +274,7 @@ pub fn traverse_nodes<'a, 'scope, E, D, I>( top_down_dom(&work, root, traversal_data, scope, pool, traversal, tls); } else { scope.spawn_fifo(move |scope| { + #[cfg(feature = "gecko")] gecko_profiler_label!(Layout, StyleComputation); let work = work; top_down_dom(&work, root, traversal_data, scope, pool, traversal, tls); @@ -284,6 +285,7 @@ pub fn traverse_nodes<'a, 'scope, E, D, I>( let nodes: WorkUnit = chunk.collect(); let traversal_data_copy = traversal_data.clone(); scope.spawn_fifo(move |scope| { + #[cfg(feature = "gecko")] gecko_profiler_label!(Layout, StyleComputation); let n = nodes; top_down_dom(&*n, root, traversal_data_copy, scope, pool, traversal, tls)