aboutsummaryrefslogtreecommitdiffstats
path: root/components/compositing/windowing.rs
diff options
context:
space:
mode:
authorNgo Iok Ui (Wu Yu Wei) <yuweiwu@pm.me>2024-11-14 02:16:58 +0900
committerGitHub <noreply@github.com>2024-11-13 17:16:58 +0000
commit47a243614f920cb9cf4c058ee9d0584377a2a11e (patch)
tree1e284fdc1ec846050dce7dc43b53b5ff4fd04209 /components/compositing/windowing.rs
parent91f96cc9dd028939715a2854b11bbdade6050a5e (diff)
downloadservo-47a243614f920cb9cf4c058ee9d0584377a2a11e.tar.gz
servo-47a243614f920cb9cf4c058ee9d0584377a2a11e.zip
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>
Diffstat (limited to 'components/compositing/windowing.rs')
-rw-r--r--components/compositing/windowing.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/components/compositing/windowing.rs b/components/compositing/windowing.rs
index 7f56d29dc62..5d7a45bcd10 100644
--- a/components/compositing/windowing.rs
+++ b/components/compositing/windowing.rs
@@ -8,7 +8,7 @@ use std::fmt::{Debug, Error, Formatter};
use std::time::Duration;
use base::id::{PipelineId, TopLevelBrowsingContextId};
-use embedder_traits::{EmbedderProxy, EventLoopWaker};
+use embedder_traits::EventLoopWaker;
use euclid::Scale;
use keyboard_types::KeyboardEvent;
use libc::c_void;
@@ -219,8 +219,14 @@ pub trait EmbedderMethods {
/// Returns a thread-safe object to wake up the window's event loop.
fn create_event_loop_waker(&mut self) -> Box<dyn EventLoopWaker>;
+ #[cfg(feature = "webxr")]
/// Register services with a WebXR Registry.
- fn register_webxr(&mut self, _: &mut webxr::MainThreadRegistry, _: EmbedderProxy) {}
+ fn register_webxr(
+ &mut self,
+ _: &mut webxr::MainThreadRegistry,
+ _: embedder_traits::EmbedderProxy,
+ ) {
+ }
/// Returns the user agent string to report in network requests.
fn get_user_agent_string(&self) -> Option<String> {