mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
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>
This commit is contained in:
parent
a4c6c205d2
commit
5466c27f6f
41 changed files with 448 additions and 649 deletions
|
@ -4,28 +4,14 @@
|
|||
|
||||
//! Traits to be implemented by backends
|
||||
|
||||
use crate::ContextId;
|
||||
use crate::EnvironmentBlendMode;
|
||||
use crate::Error;
|
||||
use crate::Event;
|
||||
use crate::Floor;
|
||||
use crate::Frame;
|
||||
use crate::HitTestId;
|
||||
use crate::HitTestSource;
|
||||
use crate::InputSource;
|
||||
use crate::LayerId;
|
||||
use crate::LayerInit;
|
||||
use crate::Native;
|
||||
use crate::Quitter;
|
||||
use crate::Sender;
|
||||
use crate::Session;
|
||||
use crate::SessionBuilder;
|
||||
use crate::SessionInit;
|
||||
use crate::SessionMode;
|
||||
use crate::Viewports;
|
||||
|
||||
use euclid::{Point2D, RigidTransform3D};
|
||||
|
||||
use crate::{
|
||||
ContextId, EnvironmentBlendMode, Error, Event, Floor, Frame, HitTestId, HitTestSource,
|
||||
InputSource, LayerId, LayerInit, Native, Quitter, Sender, Session, SessionBuilder, SessionInit,
|
||||
SessionMode, Viewports,
|
||||
};
|
||||
|
||||
/// A trait for discovering XR devices
|
||||
pub trait DiscoveryAPI<GL>: 'static {
|
||||
fn request_session(
|
||||
|
@ -105,10 +91,10 @@ impl<GL: 'static> DiscoveryAPI<GL> for Box<dyn DiscoveryAPI<GL>> {
|
|||
init: &SessionInit,
|
||||
xr: SessionBuilder<GL>,
|
||||
) -> Result<Session, Error> {
|
||||
(&mut **self).request_session(mode, init, xr)
|
||||
(**self).request_session(mode, init, xr)
|
||||
}
|
||||
|
||||
fn supports_session(&self, mode: SessionMode) -> bool {
|
||||
(&**self).supports_session(mode)
|
||||
(**self).supports_session(mode)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue