Skip to content

Commit

Permalink
dependencies: Upgrade surfman to 0.9 (#31224)
Browse files Browse the repository at this point in the history
This upgrades surfman and webxr. The main benefit to this upgrade is
that surfman (and thus libservo) no longer depends on winit. servoshell
still does, but this should make upgrades a lot easier.
  • Loading branch information
mrobinson committed Jan 30, 2024
1 parent e726893 commit a07ad85
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
9 changes: 4 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ string_cache = "0.8"
string_cache_codegen = "0.5"
style_traits = { path = "components/style_traits", features = ["servo"] }
# NOTE: the sm-angle feature only enables ANGLE on Windows, not other platforms!
surfman = { version = "0.8", features = ["chains", "sm-angle", "sm-angle-default"] }
surfman = { version = "0.9", features = ["chains", "sm-angle", "sm-angle-default"] }
syn = { version = "2", default-features = false, features = ["clone-impls", "derive", "parsing"] }
synstructure = "0.13"
thin-vec = "0.2.13"
Expand Down
7 changes: 5 additions & 2 deletions ports/servoshell/headed_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl Window {
.expect("Failed to create adapter");
let window_handle = winit_window.raw_window_handle();
let native_widget = connection
.create_native_widget_from_rwh(window_handle)
.create_native_widget_from_raw_window_handle(window_handle, Size2D::new(width, height))
.expect("Failed to create native widget");
let surface_type = SurfaceType::Widget { native_widget };
let rendering_context = RenderingContext::create(&connection, &adapter, surface_type)
Expand Down Expand Up @@ -671,9 +671,12 @@ impl webxr::glwindow::GlWindow for XRWindow {
device: &mut Device,
_context: &mut Context,
) -> webxr::glwindow::GlWindowRenderTarget {
let window_handle = self.winit_window.raw_window_handle();
let size = self.winit_window.inner_size();
let size = Size2D::new(size.width as i32, size.height as i32);
let native_widget = device
.connection()
.create_native_widget_from_winit_window(&self.winit_window)
.create_native_widget_from_raw_window_handle(window_handle, size)
.expect("Failed to create native widget");
webxr::glwindow::GlWindowRenderTarget::NativeWidget(native_widget)
}
Expand Down

0 comments on commit a07ad85

Please sign in to comment.