diff options
author | Daniel Adams <70986246+msub2@users.noreply.github.com> | 2024-08-18 00:37:14 -1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-18 10:37:14 +0000 |
commit | 1ef3e107bd194fdf0ca1da66d9167046538366d7 (patch) | |
tree | 2694f7cf6a9d352634234eef86858066c0885640 /components | |
parent | 280063eee2662a1bea925310652f4e9922051afe (diff) | |
download | servo-1ef3e107bd194fdf0ca1da66d9167046538366d7.tar.gz servo-1ef3e107bd194fdf0ca1da66d9167046538366d7.zip |
Add makeXRCompatible for WebGL2, update WebXR WPT expectations (#33097)
* Add makeXRCompatible to WebGLRenderContextBase
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Activate webgl2 for webxr wpt, update meta expectations
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Update meta legacy layout expectations
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Remove no longer existing expectations from meta files
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Remove files for fully passing tests
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Remove out-of-date expectations from meta legacy layout
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Update webgl conformance expectations
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Fix test numbering in expectations
Signed-off-by: Daniel Adams <msub2official@gmail.com>
---------
Signed-off-by: Daniel Adams <msub2official@gmail.com>
Diffstat (limited to 'components')
-rw-r--r-- | components/script/dom/webgl2renderingcontext.rs | 10 | ||||
-rw-r--r-- | components/script/dom/webidls/XRWebGLLayer.webidl | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/components/script/dom/webgl2renderingcontext.rs b/components/script/dom/webgl2renderingcontext.rs index d2b3cfe8ea3..b58b45ee85d 100644 --- a/components/script/dom/webgl2renderingcontext.rs +++ b/components/script/dom/webgl2renderingcontext.rs @@ -5,6 +5,7 @@ use std::cell::Cell; use std::cmp; use std::ptr::{self, NonNull}; +use std::rc::Rc; use canvas_traits::webgl::WebGLError::*; use canvas_traits::webgl::{ @@ -42,6 +43,7 @@ use crate::dom::bindings::root::{Dom, DomRoot, LayoutDom, MutNullableDom}; use crate::dom::bindings::str::DOMString; use crate::dom::globalscope::GlobalScope; use crate::dom::htmlcanvaselement::{HTMLCanvasElement, LayoutCanvasRenderingContextHelpers}; +use crate::dom::promise::Promise; use crate::dom::webgl_validations::tex_image_2d::{ TexImage2DValidator, TexImage2DValidatorResult, TexStorageValidator, TexStorageValidatorResult, }; @@ -4471,6 +4473,14 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { ) { self.tex_storage(3, target, levels, internal_format, width, height, depth) } + + /// <https://immersive-web.github.io/webxr/#dom-webglrenderingcontextbase-makexrcompatible> + fn MakeXRCompatible(&self) -> Rc<Promise> { + // XXXManishearth Fill in with compatibility checks when rust-webxr supports this + let p = Promise::new(&self.global()); + p.resolve_native(&()); + p + } } impl LayoutCanvasRenderingContextHelpers for LayoutDom<'_, WebGL2RenderingContext> { diff --git a/components/script/dom/webidls/XRWebGLLayer.webidl b/components/script/dom/webidls/XRWebGLLayer.webidl index 4a89ec2a40a..0007b457f8e 100644 --- a/components/script/dom/webidls/XRWebGLLayer.webidl +++ b/components/script/dom/webidls/XRWebGLLayer.webidl @@ -36,6 +36,6 @@ interface XRWebGLLayer: XRLayer { // static double getNativeFramebufferScaleFactor(XRSession session); }; -partial interface WebGLRenderingContext { +partial interface mixin WebGLRenderingContextBase { [Pref="dom.webxr.enabled"] Promise<undefined> makeXRCompatible(); }; |