mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Support for webxr layer management
This commit is contained in:
parent
af110ac21f
commit
349619ed2d
34 changed files with 949 additions and 642 deletions
|
@ -16,6 +16,7 @@ use crate::dom::xrlayer::XRLayer;
|
|||
use crate::dom::xrsession::XRSession;
|
||||
use crate::dom::xrview::XRView;
|
||||
use crate::dom::xrwebglsubimage::XRWebGLSubImage;
|
||||
use canvas_traits::webgl::WebGLContextId;
|
||||
use dom_struct::dom_struct;
|
||||
|
||||
#[dom_struct]
|
||||
|
@ -53,6 +54,19 @@ impl WebGLRenderingContextOrWebGL2RenderingContext {
|
|||
}
|
||||
}
|
||||
|
||||
impl RootedWebGLRenderingContextOrWebGL2RenderingContext {
|
||||
pub(crate) fn context_id(&self) -> WebGLContextId {
|
||||
match self {
|
||||
RootedWebGLRenderingContextOrWebGL2RenderingContext::WebGLRenderingContext(
|
||||
ref context,
|
||||
) => context.context_id(),
|
||||
RootedWebGLRenderingContextOrWebGL2RenderingContext::WebGL2RenderingContext(
|
||||
ref context,
|
||||
) => context.base_context().context_id(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl XRWebGLBindingMethods for XRWebGLBinding {
|
||||
/// https://immersive-web.github.io/layers/#dom-xrwebglbinding-getsubimage
|
||||
fn GetSubImage(&self, _layer: &XRLayer, _frame: &XRFrame) -> Option<DomRoot<XRWebGLSubImage>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue