Skip to content
Permalink
Browse files

Add XREnvironmentBlendMode

  • Loading branch information...
Manishearth committed Feb 19, 2019
1 parent 0c10702 commit 37872b8b9c57ab6d08ef32721cf653835b8e6a9a
Showing with 10 additions and 1 deletion.
  1. +1 −1 components/script/dom/webidls/XRSession.webidl
  2. +9 −0 components/script/dom/xrsession.rs
@@ -17,7 +17,7 @@ interface XRSession : EventTarget {
// // Attributes
readonly attribute XRSessionMode mode;
// readonly attribute XRPresentationContext outputContext;
// readonly attribute XREnvironmentBlendMode environmentBlendMode;
readonly attribute XREnvironmentBlendMode environmentBlendMode;

attribute double depthNear;
attribute double depthFar;
@@ -5,6 +5,7 @@
use crate::dom::bindings::codegen::Bindings::VRDisplayBinding::VRDisplayMethods;
use crate::dom::bindings::codegen::Bindings::XRBinding::XRSessionMode;
use crate::dom::bindings::codegen::Bindings::XRSessionBinding;
use crate::dom::bindings::codegen::Bindings::XRSessionBinding::XREnvironmentBlendMode;
use crate::dom::bindings::codegen::Bindings::XRSessionBinding::XRFrameRequestCallback;
use crate::dom::bindings::codegen::Bindings::XRSessionBinding::XRSessionMethods;
use crate::dom::bindings::codegen::Bindings::XRWebGLLayerBinding::XRWebGLLayerMethods;
@@ -26,6 +27,7 @@ pub struct XRSession {
eventtarget: EventTarget,
display: Dom<VRDisplay>,
base_layer: MutNullableDom<XRLayer>,
blend_mode: XREnvironmentBlendMode,
}

impl XRSession {
@@ -34,6 +36,8 @@ impl XRSession {
eventtarget: EventTarget::new_inherited(),
display: Dom::from_ref(display),
base_layer: Default::default(),
// we don't yet support any AR devices
blend_mode: XREnvironmentBlendMode::Opaque,
}
}

@@ -102,4 +106,9 @@ impl XRSessionMethods for XRSession {
fn CancelAnimationFrame(&self, frame: i32) {
self.display.xr_cancel_raf(frame)
}

/// https://immersive-web.github.io/webxr/#dom-xrsession-environmentblendmode
fn EnvironmentBlendMode(&self) -> XREnvironmentBlendMode {
self.blend_mode
}
}

0 comments on commit 37872b8

Please sign in to comment.
You can’t perform that action at this time.