diff options
author | Martin Robinson <mrobinson@igalia.com> | 2025-01-31 17:41:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-31 16:41:57 +0000 |
commit | 5466c27f6f9a151ae7f5357cb663cc2580fbca15 (patch) | |
tree | a306c16a4fc0af3fa8ab3976de0b5c79f8503de1 /components/shared/webxr/view.rs | |
parent | a4c6c205d2d26dd16ac1cd03e73a0262eb4c12f4 (diff) | |
download | servo-5466c27f6f9a151ae7f5357cb663cc2580fbca15.tar.gz servo-5466c27f6f9a151ae7f5357cb663cc2580fbca15.zip |
Finish the integration of `webxr` into the Cargo workspace (#35229)
- Run `cargo fmt` on `webxr` and `webxr-api`
- Fix clippy warnings in the existing `webxr` code
- Integrate the new crates into the workspace
- Expose `webxr` via the libservo API rather than requiring embedders to
depend on it explicitly.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'components/shared/webxr/view.rs')
-rw-r--r-- | components/shared/webxr/view.rs | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/components/shared/webxr/view.rs b/components/shared/webxr/view.rs index 566748f8a7a..9490f051729 100644 --- a/components/shared/webxr/view.rs +++ b/components/shared/webxr/view.rs @@ -4,35 +4,32 @@ //! This crate uses `euclid`'s typed units, and exposes different coordinate spaces. -use euclid::Rect; -use euclid::RigidTransform3D; -use euclid::Transform3D; +use std::marker::PhantomData; +use euclid::{Rect, RigidTransform3D, Transform3D}; #[cfg(feature = "ipc")] use serde::{Deserialize, Serialize}; -use std::marker::PhantomData; - /// The coordinate space of the viewer -/// https://immersive-web.github.io/webxr/#dom-xrreferencespacetype-viewer +/// <https://immersive-web.github.io/webxr/#dom-xrreferencespacetype-viewer> #[derive(Clone, Copy, Debug)] #[cfg_attr(feature = "ipc", derive(Serialize, Deserialize))] pub enum Viewer {} /// The coordinate space of the floor -/// https://immersive-web.github.io/webxr/#dom-xrreferencespacetype-local-floor +/// <https://immersive-web.github.io/webxr/#dom-xrreferencespacetype-local-floor> #[derive(Clone, Copy, Debug)] #[cfg_attr(feature = "ipc", derive(Serialize, Deserialize))] pub enum Floor {} /// The coordinate space of the left eye -/// https://immersive-web.github.io/webxr/#dom-xreye-left +/// <https://immersive-web.github.io/webxr/#dom-xreye-left> #[derive(Clone, Copy, Debug)] #[cfg_attr(feature = "ipc", derive(Serialize, Deserialize))] pub enum LeftEye {} /// The coordinate space of the right eye -/// https://immersive-web.github.io/webxr/#dom-xreye-right +/// <https://immersive-web.github.io/webxr/#dom-xreye-right> #[derive(Clone, Copy, Debug)] #[cfg_attr(feature = "ipc", derive(Serialize, Deserialize))] pub enum RightEye {} @@ -115,7 +112,7 @@ pub enum Capture {} /// its projection onto its display. /// For stereo displays, we have a `View<LeftEye>` and a `View<RightEye>`. /// For mono displays, we hagve a `View<Viewer>` -/// https://immersive-web.github.io/webxr/#xrview +/// <https://immersive-web.github.io/webxr/#xrview> #[derive(Clone, Debug)] #[cfg_attr(feature = "ipc", derive(Serialize, Deserialize))] pub struct View<Eye> { @@ -144,6 +141,7 @@ impl<Eye> View<Eye> { /// Whether a device is mono or stereo, and the views it supports. #[derive(Clone, Debug)] #[cfg_attr(feature = "ipc", derive(Serialize, Deserialize))] +#[allow(clippy::large_enum_variant)] pub enum Views { /// Mono view for inline VR, viewport and projection matrices are calculated by client Inline, |