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
This commit is contained in:
bors-servo 2020-07-21 01:38:08 -04:00 committed by GitHub
commit c0778ff3c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
59 changed files with 37 additions and 309 deletions

View file

@ -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>> {