aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/xrwebgllayer.rs
diff options
context:
space:
mode:
authorbors-servo <servo-ops@mozilla.com>2020-07-21 01:38:08 -0400
committerGitHub <noreply@github.com>2020-07-21 01:38:08 -0400
commitc0778ff3c581366fb270b491e6aae5301425b247 (patch)
tree68fe97b85592a5bc38b3804f27254d1f14916511 /components/script/dom/xrwebgllayer.rs
parent132d8b46014eb3a1db7721b603d5b994c95e8d5e (diff)
parentc34e5871405c1c7dd1ff43369f937ac449ba9a82 (diff)
downloadservo-c0778ff3c581366fb270b491e6aae5301425b247.tar.gz
servo-c0778ff3c581366fb270b491e6aae5301425b247.zip
Auto merge of #27313 - jdm:layer-idl, r=asajeffrey
Update XRWebGLLayer to match specification. This unbreaks most of the webxr WPT tests. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #27312 - [x] There are tests for these changes
Diffstat (limited to 'components/script/dom/xrwebgllayer.rs')
-rw-r--r--components/script/dom/xrwebgllayer.rs39
1 files changed, 15 insertions, 24 deletions
diff --git a/components/script/dom/xrwebgllayer.rs b/components/script/dom/xrwebgllayer.rs
index dd77cedb27e..e0b4a558c8c 100644
--- a/components/script/dom/xrwebgllayer.rs
+++ b/components/script/dom/xrwebgllayer.rs
@@ -71,6 +71,7 @@ pub struct XRWebGLLayer {
depth: bool,
stencil: bool,
alpha: bool,
+ ignore_depth_values: bool,
context: RenderingContext,
session: Dom<XRSession>,
/// If none, this is an inline session (the composition disabled flag is true)
@@ -94,6 +95,7 @@ impl XRWebGLLayer {
depth: init.depth,
stencil: init.stencil,
alpha: init.alpha,
+ ignore_depth_values: init.ignoreDepthValues,
layer_id,
context: match context {
XRWebGLRenderingContext::WebGLRenderingContext(ctx) => {
@@ -303,31 +305,8 @@ impl XRWebGLLayer {
framebuffer.upcast::<WebGLObject>().context().Flush();
Some(())
}
-}
-
-impl XRWebGLLayerMethods for XRWebGLLayer {
- /// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-depth
- fn Depth(&self) -> bool {
- self.depth
- }
-
- /// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-stencil
- fn Stencil(&self) -> bool {
- self.stencil
- }
-
- /// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-antialias
- fn Antialias(&self) -> bool {
- self.antialias
- }
- /// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-alpha
- fn Alpha(&self) -> bool {
- self.alpha
- }
-
- /// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-context
- fn Context(&self) -> XRWebGLRenderingContext {
+ pub(crate) fn context(&self) -> XRWebGLRenderingContext {
match self.context {
RenderingContext::WebGL1(ref ctx) => {
XRWebGLRenderingContext::WebGLRenderingContext(DomRoot::from_ref(&**ctx))
@@ -337,6 +316,18 @@ impl XRWebGLLayerMethods for XRWebGLLayer {
},
}
}
+}
+
+impl XRWebGLLayerMethods for XRWebGLLayer {
+ /// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-antialias
+ fn Antialias(&self) -> bool {
+ self.antialias
+ }
+
+ /// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-ignoredepthvalues
+ fn IgnoreDepthValues(&self) -> bool {
+ self.ignore_depth_values
+ }
/// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-framebuffer
fn GetFramebuffer(&self) -> Option<DomRoot<WebGLFramebuffer>> {