webxr: create glwindow with Rc window and without rendering context (#34813)

* Create webxr glwindow with Rc window

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

* Remove obselte gurad type

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

* Update GlWindow trait method

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

* Update how webxr discorvery is created

Now glwindow will create a hidden window. It's better to not use it
unless we really want to use this port.

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

* Link back to upstream webxr repo

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

---------

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
Signed-off-by: Wu Yuwei <yuweiwu@pm.me>
This commit is contained in:
Ngo Iok Ui (Wu Yu Wei) 2025-01-03 12:01:30 +09:00 committed by GitHub
parent b252f238d1
commit da2074e5d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 26 additions and 97 deletions

View file

@ -5,6 +5,8 @@
//! Definition of Window.
//! Implemented by headless and headed windows.
use std::rc::Rc;
use euclid::{Length, Scale};
use servo::compositing::windowing::{EmbedderEvent, WindowMethods};
use servo::config::opts;
@ -41,7 +43,7 @@ pub trait WindowPortsMethods: WindowMethods {
fn new_glwindow(
&self,
event_loop: &winit::event_loop::ActiveEventLoop,
) -> Box<dyn webxr::glwindow::GlWindow>;
) -> Rc<dyn webxr::glwindow::GlWindow>;
fn winit_window(&self) -> Option<&winit::window::Window>;
fn toolbar_height(&self) -> Length<f32, DeviceIndependentPixel>;
fn set_toolbar_height(&self, height: Length<f32, DeviceIndependentPixel>);