feat: webxr feature flag (#34241)

* Add webxr feature flag

Add webxr feature flag to embedder_traits

Add webxr flag to constellation

Add webxr flag to compositor

Add webxr flag to canvas

Turn registry into optional

Add webxr flag to servo lib

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
Co-authored-by: august kline <me@augustkline.com>

* Cargo fmt

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

* Add missing license

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

* Cargo clippy

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

---------

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
Co-authored-by: august kline <me@augustkline.com>
This commit is contained in:
Ngo Iok Ui (Wu Yu Wei) 2024-11-14 02:16:58 +09:00 committed by GitHub
parent 91f96cc9dd
commit 47a243614f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 456 additions and 374 deletions

View file

@ -287,7 +287,7 @@ pub struct Window {
#[ignore_malloc_size_of = "defined in webxr"]
#[no_trace]
webxr_registry: webxr_api::Registry,
webxr_registry: Option<webxr_api::Registry>,
/// All of the elements that have an outstanding image request that was
/// initiated by layout during a reflow. They are stored in the script thread
@ -495,7 +495,7 @@ impl Window {
.map(|chan| WebGLCommandSender::new(chan.clone()))
}
pub fn webxr_registry(&self) -> webxr_api::Registry {
pub fn webxr_registry(&self) -> Option<webxr_api::Registry> {
self.webxr_registry.clone()
}
@ -2579,7 +2579,7 @@ impl Window {
creator_url: ServoUrl,
navigation_start: CrossProcessInstant,
webgl_chan: Option<WebGLChan>,
webxr_registry: webxr_api::Registry,
webxr_registry: Option<webxr_api::Registry>,
microtask_queue: Rc<MicrotaskQueue>,
webrender_document: DocumentId,
compositor_api: CrossProcessCompositorApi,