Remove the WebXR dependency on ancient time@0.1 crate (#32862)

`webxr` depends on a very old verison of `time`, which allowed serializing
monotonic clock output. This isn't possible on all platforms, so newer
versions of `time` do not allow this. In order to stop using the old
0.1 versions of `time` we have to stop relying on times passed from `webxr`
to Servo. This change does that, at the cost of removing the XR
profiling feature. It has to be rewritten in another way in the `webxr`
crate.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson 2024-07-26 15:53:34 +02:00 committed by GitHub
parent eac54183c1
commit f7448b5d61
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 5 additions and 54 deletions

View file

@ -12,7 +12,6 @@ path = "lib.rs"
[features]
webgl_backtrace = ["canvas_traits/webgl_backtrace"]
xr-profile = ["webxr-api/profile", "time"]
[dependencies]
app_units = { workspace = true }
@ -41,7 +40,6 @@ sparkle = { workspace = true }
style = { workspace = true }
style_traits = { workspace = true }
surfman = { workspace = true }
time = { workspace = true, optional = true }
unicode-script = { workspace = true }
webrender = { workspace = true }
webrender_api = { workspace = true }

View file

@ -51,11 +51,6 @@ use webxr_api::{
use crate::webgl_limits::GLLimitsDetect;
#[cfg(feature = "xr-profile")]
fn to_ms(ns: u64) -> f64 {
ns as f64 / 1_000_000.
}
struct GLContextData {
ctx: Context,
gl: Rc<Gl>,
@ -831,14 +826,6 @@ impl WebGLThread {
#[allow(unused)]
let mut end_swap = 0;
#[cfg(feature = "xr-profile")]
{
end_swap = time::precise_time_ns();
println!(
"WEBXR PROFILING [swap buffer]:\t{}ms",
to_ms(end_swap - start_swap)
);
}
completed_sender.send(end_swap).unwrap();
}