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:
Martin Robinson 2025-01-31 17:41:57 +01:00 committed by GitHub
parent a4c6c205d2
commit 5466c27f6f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 448 additions and 649 deletions

View file

@ -4,11 +4,11 @@
//! An implementation of layer management using surfman
use crate::gl_utils::GlClearer;
use euclid::{Point2D, Rect, Size2D};
use glow::{self as gl, Context as Gl, HasContext, PixelUnpackData};
use std::collections::HashMap;
use std::num::NonZeroU32;
use euclid::{Point2D, Rect, Size2D};
use glow::{self as gl, Context as Gl, HasContext, PixelUnpackData};
use surfman::chains::{PreserveBuffer, SwapChains, SwapChainsAPI};
use surfman::{Context as SurfmanContext, Device as SurfmanDevice, SurfaceAccess, SurfaceTexture};
use webxr_api::{
@ -16,7 +16,9 @@ use webxr_api::{
SubImages, Viewports,
};
#[derive(Copy, Clone, Debug)]
use crate::gl_utils::GlClearer;
#[derive(Clone, Copy, Debug)]
pub enum SurfmanGL {}
impl GLTypes for SurfmanGL {
@ -63,7 +65,7 @@ impl LayerManagerAPI<SurfmanGL> for SurfmanLayerManager {
init: LayerInit,
) -> Result<LayerId, Error> {
let texture_size = init.texture_size(&self.viewports);
let layer_id = LayerId::new();
let layer_id = LayerId::default();
let access = SurfaceAccess::GPUOnly;
let size = texture_size.to_untyped();
// TODO: Treat depth and stencil separately?