diff --git a/webrender/Cargo.toml b/webrender/Cargo.toml index 3d5ddf9157..4e90212593 100644 --- a/webrender/Cargo.toml +++ b/webrender/Cargo.toml @@ -52,7 +52,7 @@ svg_fmt = "0.4" tracy-rs = "0.1.2" derive_more = { version = "0.99", default-features = false, features = ["add_assign"] } etagere = "0.2.6" -glean = "57.0.0" +glean = { version = "57.0.0", optional = true } firefox-on-glean = { version = "0.1.0", optional = true } swgl = { path = "../swgl", optional = true } topological-sort = "0.1" diff --git a/webrender/src/telemetry.rs b/webrender/src/telemetry.rs index 9b4c02d68e..44ccc580d0 100644 --- a/webrender/src/telemetry.rs +++ b/webrender/src/telemetry.rs @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#[cfg(feature = "gecko")] use glean::TimerId; #[cfg(feature = "gecko")] use firefox_on_glean::metrics::wr; @@ -9,16 +10,19 @@ use std::time::Duration; pub struct Telemetry; +#[cfg(not(feature = "gecko"))] +pub struct TimerId; + /// Defines the interface for hooking up an external telemetry reporter to WR. #[cfg(not(feature = "gecko"))] impl Telemetry { pub fn record_rasterize_blobs_time(_duration: Duration) { } - pub fn start_framebuild_time() -> TimerId { TimerId { id: 0 } } + pub fn start_framebuild_time() -> TimerId { TimerId { } } pub fn stop_and_accumulate_framebuild_time(_id: TimerId) { } pub fn record_renderer_time(_duration: Duration) { } pub fn record_renderer_time_no_sc(_duration: Duration) { } pub fn record_scenebuild_time(_duration: Duration) { } - pub fn start_sceneswap_time() -> TimerId { TimerId { id: 0 } } + pub fn start_sceneswap_time() -> TimerId { TimerId { } } pub fn stop_and_accumulate_sceneswap_time(_id: TimerId) { } pub fn cancel_sceneswap_time(_id: TimerId) { } pub fn record_texture_cache_update_time(_duration: Duration) { }