mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Merge webxr repository (#35228)
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
64b40ea700
commit
534e78db53
30 changed files with 7303 additions and 2 deletions
25
components/webxr/openxr/graphics.rs
Normal file
25
components/webxr/openxr/graphics.rs
Normal file
|
@ -0,0 +1,25 @@
|
|||
use euclid::{Size2D, UnknownUnit};
|
||||
use openxr::{ExtensionSet, FrameStream, FrameWaiter, Graphics, Instance, Session, SystemId};
|
||||
use surfman::Context as SurfmanContext;
|
||||
use surfman::Device as SurfmanDevice;
|
||||
use surfman::Error as SurfmanError;
|
||||
use surfman::SurfaceTexture;
|
||||
use webxr_api::Error;
|
||||
|
||||
pub enum GraphicsProvider {}
|
||||
|
||||
pub trait GraphicsProviderMethods<G: Graphics> {
|
||||
fn enable_graphics_extensions(exts: &mut ExtensionSet);
|
||||
fn pick_format(formats: &[u32]) -> u32;
|
||||
fn create_session(
|
||||
device: &SurfmanDevice,
|
||||
instance: &Instance,
|
||||
system: SystemId,
|
||||
) -> Result<(Session<G>, FrameWaiter, FrameStream<G>), Error>;
|
||||
fn surface_texture_from_swapchain_texture(
|
||||
image: <G as Graphics>::SwapchainImage,
|
||||
device: &mut SurfmanDevice,
|
||||
context: &mut SurfmanContext,
|
||||
size: &Size2D<i32, UnknownUnit>,
|
||||
) -> Result<SurfaceTexture, SurfmanError>;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue