Commit graph

12 commits

Author SHA1 Message Date
Martin Robinson
5466c27f6f
Finish the integration of webxr into the Cargo workspace (#35229)
- Run `cargo fmt` on `webxr` and `webxr-api`
- Fix clippy warnings in the existing `webxr` code
- Integrate the new crates into the workspace
- Expose `webxr` via the libservo API rather than requiring embedders to
  depend on it explicitly.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-31 16:41:57 +00:00
Martin Robinson
9dbc942bee
libservo: Port desktop servoshell to use the new WebView API (#35183)
This removes all uses of `EmbedderEvent` in the desktop servoshell to
use the new `WebView` API -- filling it out when necessary.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Delan Azabani <dazabani@igalia.com>
2025-01-28 14:57:57 +00:00
Martin Robinson
0e616e0c5d
api: Flatten and simplify Servo preferences (#34966)
Flatten and simplify Servo's preferences code. In addition, have both
preferences and options passed in as arguments to `Servo::new()` and
make sure not to use the globally set preferences in `servoshell` (as
much as possible now).

Instead of a complex procedural macro to generate preferences, just
expose a very simple derive macro that adds string based getters and
setters.

- All command-line parsing is moved to servoshell.
- There is no longer the concept of a missing preference.
- Preferences no longer have to be part of the resources bundle because
  they now have reasonable default values.
- servoshell specific preferences are no longer part of the preferences
  exposed by the Servo API.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-14 13:54:06 +00:00
Ngo Iok Ui (Wu Yu Wei)
da2074e5d6
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>
2025-01-03 03:01:30 +00:00
Ngo Iok Ui (Wu Yu Wei)
d581acab3b
chore: remove WindowMethods::rendering_context (#34780)
* Create Servo without initial webview ID

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

* Add rendering context in App struct

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

* Make webview manager optional

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

* Move window creation to init

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

* Create window from external rendering context

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

* Resize surface in compositor

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

* Obey clippy

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

* Update Android and OHOS

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

* Add missing arguent on OHOS

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

* Show webview after focused on Android and OH

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

* Remove rendering_context in ServoWindowCallbacks

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

* Create surface before swapchain in headless mode

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

---------

Signed-off-by: Wu Yuwei <yuweiwu@pm.me>
2025-01-01 08:26:23 +00:00
Nico Burns
63793ccbb7
Use webrender_api::units::DevicePixel rather than style_traits::DevicePixel unless interfacing with Stylo (#34353)
* Use webrender_api::units::DevicePixel rather than style_traits::DevicePixel unless interfacing with Stylo

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix OpenHarmony build

Signed-off-by: Nico Burns <nico@nicoburns.com>

---------

Signed-off-by: Nico Burns <nico@nicoburns.com>
2024-11-25 23:42:04 +00:00
Martin Robinson
850e59f98e
servoshell: Allow overriding screen resolution with a command-line argument (#34038)
There is a command-line argument to override the default window size,
but not one for overriding the default screen resolution. This is
important for testing pages that use screen size to have different
behavior.

In addition to adding the new option this change:

 - Renames the `--resolution` command-line argument to `--window-size`
   to remove ambiguity with the `--screen-size` argument.
 - Passes the screen size as device independent (device pixels scaled by
   HiDPI factor) to Servo internals. Not only it make it simpler to pass
   the `--window-size` override, it makes more sense. Different screens
   can have different HiDPI factors and these can be different from the
   scale of the window. This makes the screen HiDPI factor totally
   independent of the one that Servo uses for the window.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-10-30 11:54:13 +00:00
Gae24
fd19409f31
Upgrade to egui@0.29.1 and winit@0.30.5 (#33751)
* update egui dependencies

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* update glow to 0.14.1

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* update winit to 0.30.5

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* update servo-tidy.toml

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* Use more imports to avoid qualified usage, fix build, and silence warnings about deprecated methods

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-10-10 17:18:03 +00:00
Martin Robinson
9195344b75
compositor: Create a single cross-process compositor API (#33619) (#33660)
Instead of exposing many different kinds of messages to the compositor
that are routed through the constellation, expose a single message type
which can be sent across IPC channels. In addition, this IPC channel and
the route to the crossbeam channel with the compositor is created along
with the `CompositorProxy`, simplifying what needs to be passed around
during pipeline initialization.

Previously, some image updates (from video) were sent over IPC with a
special serialization routine and some were sent via crossbeam channels
(canvas). Now all updates go over the IPC channel `IpcSharedMemory` is
used to avoid serialization penalties. This should improve performance
and reduce copies for video, but add a memory copy overhead for canvas.
This will improve in the future when canvas renders directly into a
texture.

All-in-all this is a simplification which opens the path toward having a
standard compositor API and reduces the number of duplicate messages and
proxying that had to happen in libservo.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-10-09 17:30:24 +00:00
Martin Robinson
48f8ff6236
Revert "compositor: Create a single cross-process compositor API (#33619)" (#33645)
This reverts commit f2f5614ad6.

This is causing intermittent crashes: 3104425501

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-10-04 09:08:19 +00:00
Martin Robinson
f2f5614ad6
compositor: Create a single cross-process compositor API (#33619)
Instead of exposing many different kinds of messages to the compositor
that are routed through the constellation, expose a single message type
which can be sent across IPC channels. In addition, this IPC channel and
the route to the crossbeam channel with the compositor is created along
with the `CompositorProxy`, simplifying what needs to be passed around
during pipeline initialization.

Previously, some image updates (from video) were sent over IPC with a
special serialization routine and some were sent via crossbeam channels
(canvas). Now all updates go over the IPC channel `IpcSharedMemory` is
used to avoid serialization penalties. This should improve performance
and reduce copies for video, but add a memory copy overhead for canvas.
This will improve in the future when canvas renders directly into a
texture.

All-in-all this is a simplification which opens the path toward having a
standard compositor API and reduces the number of duplicate messages and
proxying that had to happen in libservo.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-10-03 14:42:04 +00:00
Jonathan Schwender
ff4cd4af96
Split servoshell into Desktop and common part (#32457)
* servoshell: Move desktop files

Move files related to winit into a desktop module.
This is a preparation to merge the android and ohos apps into
servoshell.

* servoshell: Format imports

* servoshell: Move panic hook into separate file

* servoshell: Move desktop main

* Consider ohos as not desktop

* servoshell: Adjust dependencies for shared code

* servoshell: Remove native-bluetooth from default features

There currently is no good way to have target specific default features.

* Rename desktop_main.rs to cli.rs

* Remove todo
2024-06-14 06:26:35 +00:00
Renamed from ports/servoshell/headless_window.rs (Browse further)