Skip to content

Commit

Permalink
Make glean dependency optional for webrender
Browse files Browse the repository at this point in the history
  • Loading branch information
mrobinson committed Mar 1, 2024
1 parent 10c071d commit c93de5c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion webrender/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 6 additions & 2 deletions webrender/src/telemetry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,27 @@
* 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;
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) { }
Expand Down

0 comments on commit c93de5c

Please sign in to comment.