aboutsummaryrefslogtreecommitdiffstats
path: root/components/compositing/Cargo.toml
Commit message (Collapse)AuthorAgeFilesLines
* compositing: Add memory reporter for WebRender. (#36557)Josh Matthews9 days1-0/+2
| | | | | | | | | | This adds a memory reporter for WebRender's memory usage. I seeded it with a couple entries that looked reasonable based on https://searchfox.org/mozilla-central/rev/2c71f1e9b5947612abdc16b64008162c58c1b9d3/gfx/thebes/gfxPlatform.cpp#722-738. Testing: Verified that new numbers appear in about:memory for servo.org. The new images category is surprisingly large (40mb). Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* libservo: Remove the unused `multiview` feature (#36485)Martin Robinson11 days1-1/+0
| | | Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* compositing: Send `CompositorDisplayListInfo` as bytes to compositor (#36484)Martin Robinson13 days1-0/+1
| | | | | | | | | | | | | `CompositorDisplayListInfo` is a large data structure that scales with the size of the display list. Serializing it onto the Compositor's IPC channel can cause deadlocks. This change serializes it with bincode and sends it alongside the rest of the serialized display list information on the IPC `bytes_channel`. This should prevent deadlocks when the compositor API is unified. Testing: This is covered by existing WPT tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* `compositing`: Combine `webrender_traits` and `compositing_traits` (#36372)Martin Robinson2025-04-061-1/+0
| | | | | | | | | | | | | | | These two traits both exposed different parts of the compositing API, but now that the compositor doesn't depend directly on `script` any longer and the `script_traits` crate has been split into the `constellation_traits` crate, this can be finally be cleaned up without causing circular dependencies. In addition, some unit tests for the `IOPCompositor`'s scroll node tree are also moved into `compositing_traits` as well. Testing: This just combines two crates, so no new tests are necessary. Fixes: #35984. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Create a `constellation_traits` crate (#36088)Martin Robinson2025-03-221-0/+1
| | | | | | | | | | | | | | This change creates a `constellation_traits` crate. Previously messages to the `Constellation` were in the `compositing_traits` crate, which came about organically. This change moves these to a new crate which also contains data types that are used in both compositing/libservo and script (ie types that cross the process boundary). The idea is similar to `embedding_traits`, but this is meant for types not exposed to the API. This change allows deduplicating `UntrustedNodeAddress`, which previously had two versions to avoid circular dependencies. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Cleanup Stylo dependencies (#36046)Oriol Brufau2025-03-191-1/+1
| | | | | | | | | Now that Stylo considers `servo` as the default feature, Servo doesn't need to specify `features = ["servo"]`. Also use the same crate names as Stylo, rather than renaming them with `package`. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* libservo: Move size handling to `RenderContext` from `WindowMethods` (#35621)Martin Robinson2025-02-251-0/+1
| | | | | | | | | | | | | | | | | | | | | This is the first step toward removing `WindowMethods`, which will gradually be integrated into the `WebView` and `WebViewDelegate`. Sizing of the `WebView` is now handled by the a size associated with a `RenderingContext`. `WebView`s will eventually just paint the entire size of their `RenderingContext`. Notes: - This is transitionary step so now there is a `WebView::resize` and a `WebView::move_resize`. The first is the future which will resize the `WebView` and its associated `RenderingContext`. The second is a function that the virtual `WebView`s that will soon be replaced by a the one-`WebView` per `WebView` model. - We do not need to call `WebView::move_resize` at as much any longer because the default size of the `WebView` is to take up the whole `RenderingContext`. - `SurfmanRenderingContext` is no longer exposed in the API, as a surfman context doesn't naturally have a size unless a surface is bound to it. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* compositing: Move image output and shutdown management out of the compositor ↵Martin Robinson2025-02-201-1/+0
| | | | | | | | | | | | | | | | | | | | | | | (#35538) This is a step toward the renderer-per-WebView goal. It moves various details out of `IOCompositor`. - Image output: This is moved to servoshell as now applications can access the image contents of a `WebView` via `RenderingContext::read_to_image`. Most options for this are moved to `ServoShellPreferences` apart from `wait_for_stable_image` as this requires a specific kind of coordination in the `ScriptThread` that is also very expensive. Instead, paint is now simply delayed until a stable image is reached and `WebView::paint()` returns a boolean. Maybe this can be revisited in the future. - Shutdown: Shutdown is now managed by libservo itself. Shutdown state is shared between the compositor and `Servo` instance. In the future, this sharing might be unecessary. - `CompositeTarget` has been removed entirely. This no longer needs to be passed when creating a Servo instance. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Ngo Iok Ui (Wu Yu Wei) <yuweiwu@pm.me>
* libservo: Rework and clarify the rendering model of the `WebView` (#35522)Martin Robinson2025-02-191-0/+1
| | | | | | | | | | | | | | | | | Make the rendering model of the `WebView` clearer: 1. `WebViewDelegate::notify_new_frame_ready()` indicates that the WebView has become dirty and needs to be repainted. 2. `WebView::paint()` asks Servo to paint the contents of the `WebView` into the `RenderingContext`. 3. `RenderingContext::present()` does a buffer swap if the `RenderingContext` is actually double-buffered. This is documented and all in-tree embedders are updated to work with this new model. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Ngo Iok Ui (Wu Yu Wei) <yuweiwu@pm.me> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* libservo: Expose `SoftwareRenderingContext` and `WindowRenderingContext` ↵Martin Robinson2025-02-181-1/+0
| | | | | | | | | | | | | | (#35501) Expose two easy-to-use wrappers around `SurfmanRenderingContext` that make the API simpler to use: - `WindowRenderingContext`: This `RenderingContext` is a newtype around `SurfmanRenderingContext` takes a `raw-window-handle` display and window and creates a full window rendering context. - `SoftwareRenderingContext`: is wraps `SurfmanRenderingContext` and adds a swap chain in order to expose a software GL rendering context. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* libservo: Expose an `OffscreenRenderingContext` and use it for servoshell ↵Martin Robinson2025-02-171-0/+1
| | | | | | | | | | | | | | | | | | (#35465) Create a new `RenderingContext` which is used to render to a `SurfmanRenderingContext`-related offscreen buffer. This allows having a temporary place to render Servo and then blitting the results to a subsection of the parent `RenderingContext`. The goal with this change is to remove the details of how servoshell renders from the `Compositor` and prepare for the compositor-per-WebView world. Co-authred-by: Ngo Iok Ui (Wu Yu Wei) <yuweiwu@pm.me> Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* deps: Remove some unused `Cargo.toml` (#35466)Martin Robinson2025-02-141-2/+0
| | | | | These were discovered with cargo-machete. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Finish the integration of `webxr` into the Cargo workspace (#35229)Martin Robinson2025-01-311-1/+1
| | | | | | | | | - 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>
* Remove some unused dependencies (#34355)Jonathan Schwender2024-11-251-5/+0
| | | | | | | | | | | | | | | * Remove unused deps This doesn't seem to remove any deps from the workspace. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * ohos: Remove gaol dependency Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> --------- Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* feat: `webxr` feature flag (#34241)Ngo Iok Ui (Wu Yu Wei)2024-11-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Use `ROUTER::add_typed_route` instead of `ROUTER::add_route` everywhere (#33866)Simon Wülker2024-10-181-1/+1
| | | | | | | | | | | | | * Use ROUTER::add_typed_route where possible Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update webxr, media and ipc-channel Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Gate all use of `tracing` behind Cargo feature (#33845)Delan Azabani2024-10-161-1/+2
| | | Signed-off-by: Delan Azabani <dazabani@igalia.com>
* Add `rust-version` to all `Cargo.toml` files (#33483)Martin Robinson2024-09-171-0/+1
| | | | | | | This is another step preparing for building Servo without `mach`. Fixes #33430. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Stop using `time@0.1` in Servo (#33394)Martin Robinson2024-09-111-1/+0
| | | | | | | | This removes the last few uses of `time@0.1` in Servo. There are still dependencies from `style` and `webrender`, but they will be removed soon as well. The uses of this version of `time` are replaced with `std::time` types and `time@0.3` when negative `Duration` is necessary. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Add tracing events (#33189)atbrakhi2024-09-051-0/+1
| | | Signed-off-by: atbrakhi <atbrakhi@igalia.com>
* compositor: Do not parse the Cargo.lock file while building (#33222)Martin Robinson2024-08-281-4/+0
| | | | | | | | | | | | | | | The compositor's `build.rs` script was parsing the `Cargo.lock` file in order to tag WebRender captures with the WebRender version. The embedder already knows what version of Servo we are using, which should be enough to infer the WebRender revision. This changes does that and generally does a bit of cleaning up of how captures are done. - The name of the capture directory is now `webrender-captures` - There is console output now when captures are done. Before it was hard to know if it succeeded. - Simplify the Compositor constructor a little to avoid passing arguments so much. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* make protocol handlers registrable (#33104)webbeef2024-08-221-0/+1
| | | Signed-off-by: webbeef <me@webbeef.org>
* Fix save to image on Windows (#32914)Cristian Brinza2024-08-031-0/+3
| | | | | | | | | | | | | | | | | | | | | * Read pixels in same format (gl::RGBA) as the texture Signed-off-by: crbrz <cristianb@gmail.com> * Add read pixels test Signed-off-by: crbrz <cristianb@gmail.com> * Use patched surfman Signed-off-by: crbrz <cristianb@gmail.com> * Update surfman to 0.9.5 Signed-off-by: crbrz <cristianb@gmail.com> --------- Signed-off-by: crbrz <cristianb@gmail.com>
* Rename `gfx` to `fonts` (#32556)Martin Robinson2024-06-191-2/+2
| | | | | | | | | This crate only takes care of fonts now as graphics related things are split into other crates. In addition, this exposes data structures at the top of the crate, hiding the implementation details and making it simpler to import them. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Use workspace definitions for all crates and update to the 2021 edition (#32544)Martin Robinson2024-06-181-5/+5
|
* compositor: Move WebRender-ish messages and types to `webrender_traits` (#32315)Mukilan Thiyagarajan2024-05-201-0/+1
| | | | | | | | | | | | | | | | | | | | * Move WebRender related types to `webrender_traits` This refactor moves several WebRender related types from `compositing_traits`, `script_traits` and `net_traits` crates to the `webrender_traits` crate. This change also moves the `Image` type and associated function out of `net_traits` and into the `pixels` crate. Co-authored-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * Move `script_traits::WebrenderIpcSender` to `webrender_traits::WebRenderScriptApi` --------- Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Move non-gfx things out of `gfx_traits` and create a `base` crate (#32296)Martin Robinson2024-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | For a long time, `gfx_traits` has held a lot of things unrelated to graphics and also unrelated to the `gfx` crate (which is mostly about fonts). This is a cleanup which does a few things: 1. Move non `gfx` crate things out of `gfx_traits`. This is important in order to prevent dependency cycles with a different integration between layout, script, and fonts. 2. Rename the `msg` crate to `base`. It didn't really contain anything to do with messages and instead mostly holds ids, which are used across many different crates in Servo. This new crate will hold the *rare* data types that are widely used. Details: - All BackgroundHangMonitor-related things from base to a new `background_hang_monitor_api` crate. - Moved `TraversalDirection` to `script_traits` - Moved `Epoch`-related things from `gfx_traits` to `base`. - Moved `PrintTree` to base. This should be widely useful in Servo. - Moved `WebrenderApi` from `base` to `webrender_traits` and renamed it to `WebRenderFontApi`.
* Update gstreamer crates to 0.22 (#31465)Samson2024-03-011-1/+1
|
* gfx: Rename `WebrenderSurfman` to `RenderingContext` and move to `gfx` (#31184)Martin Robinson2024-01-271-1/+1
| | | | | | | | | | | This is a small cleanup that moves and renames this class. The rename is simply because we are exposing a lot about the details of Servo's rendering in the API and it makes sense to start thinking about abstracting that away a bit. This also moves the struct to `gfx`, which does have an effect on Servo's dependency graph. This adds a new dependency on gfx to `compositing`, but `compositing` had a transitive dependency on gfx before through `canvas`.
* deps: Remove unused crate dependencies (#31185)Martin Robinson2024-01-261-2/+0
| | | These were identified with `cargo-marchete`.
* Add initial support for offscreen rendering (#30767)Delan Azabani2023-12-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Offscreen rendering * shared memory case never actually rendered to backbuffer * fix compile errors (in theory) when gl crate feature disabled * update doc comments * remove dark CentralPanel border covering edges of viewport * clear to transparent, to avoid pink artifacts * fix mouse input for browser being consumed by egui * avoid destroying OpenGL resources unless resizing window * clean up compositing::gl * fix flickering around edges after resizing window * unset invalidate_last_render_target after invalidating * fix incorrect DRAW_FRAMEBUFFER name when blitting * bind the widget surface fbo before painting egui * make composite_specific_target take CompositeTarget, not Option * compositing: remove cargo feature “gl” * capitalise FBO in bind log message Co-authored-by: Martin Robinson <mrobinson@igalia.com> * capitalise FBO in drop log message Co-authored-by: Martin Robinson <mrobinson@igalia.com> * rename RenderTargetInfo fields and use OnceCell for next field * rename RenderTargetInfo.read to read_back_from_gpu * document servo_framebuffer_id in Minibrowser::update * rename needs_fbo to use_offscreen_framebuffer * capitalise FBO in unbind log message * clarify the purpose of Minibrowser::on_event * fix unused_must_use warning * reduce nesting in Minibrowser::update * use implicit format argument in panic * store Minibrowser.widget_surface_fbo as glow type * explain why servo_framebuffer_id is None in first call site * rename output_framebuffer_id to offscreen_framebuffer_id --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Add multiview feature flag in compositing and constellation (#30840)Delan Azabani2023-12-121-0/+1
|
* Move `*_traits` and other shared types to `shared`Martin Robinson2023-11-031-8/+8
| | | | | | | | | | | | This is the start of the organization of types that are in their own crates in order to break dependency cycles between other crates. The idea here is that putting these packages into their own directory is the first step toward cleaning them up. They have grown organically and it is difficult to explain to new folks where to put new shared types. Many of these crates contain more than traits or don't contain traits at all. Notably, `script_traits` isn't touched because it is vendored from Gecko. Eventually this will move to `third_party`.
* Add shell.background-color.rgba to prefs (#30488)Ngo Iok Ui (Wu Yu Wei)2023-10-041-0/+1
| | | | | | | * Add shell.transparent-background.enabled to prefs * Rename config to background_color * Rename to background-color and.rgba add PrefValue::Array variant
* [NFC] compositing: extract types into new compositing_traits crate (#30125)Delan Azabani2023-08-181-0/+1
| | | | | | | | | | | * [NFC] compositing: extract types into new compositing_traits crate * [NFC] compositing: move InitialCompositorState back to compositing * [NFC] compositing: rename Msg to CompositorMsg * [NFC] compositing: revert changes to Cargo.toml features section * [NFC] compositing: merge imports
* Vendor the current version of WebRenderMartin Robinson2023-07-031-2/+2
| | | | | | | | This is a step toward upgrading WebRender, which will be upgraded and patched in the `third_party` directory. This change vendors the current private branch of WebRender that we use and adds a `patches` directory which tracks the changes on top of the upstream WebRender commit described by third_party/webrender/patches/head.
* Add a compositor-side scroll treeMartin Robinson2023-05-191-0/+1
| | | | | | This will allow the compositor to properly chain scrolling requests up when a node has reached the extent of the scroll area. This fixes scrolling on servo.org.
* Start the transition to workspace dependenciesMartin Robinson2023-05-171-10/+10
| | | | | | | This will ultimately make it simpler to update crate dependencies and reduce duplicate when specifying requirements. Generally, this change does not touch dependencies that are only used by a single crate. We could consider moving them to workspace dependencies in the future.
* Bump euclid to 0.22Martin Robinson2023-01-261-1/+1
| | | | | | | | | | | | | - Also updates raqote to latest with an upgrade of font-kit to 0.11 applied on as a patch - Update lyon_geom to the latest version Major change: - All matrices are now stored in row major order. This means that parameters to rotation functions no longer should be negated. - `post_...()` functions are now named `then()`. `pre_transform()` is removed, so `then()` is used and the order of operations changed.
* Update image/png.Josh Matthews2022-04-011-1/+1
|
* Update keyboard-types.Josh Matthews2022-04-011-1/+1
|
* Bump `time` to latest `v0.1.x` version.teymour-aldridge2021-06-251-1/+1
|
* Update webrender.Josh Matthews2020-08-101-1/+1
|
* Revert "Update webrender."Josh Matthews2020-08-041-1/+1
| | | | This reverts commit 2ca1b06e77f28cebeb886f50a6c21c438d4b2f46.
* Update webrender.Josh Matthews2020-07-311-1/+1
|
* update keyboard-types cratePaul Rouget2020-06-291-1/+1
|
* Update webrender.Josh Matthews2020-06-111-1/+0
|
* Proxy all WR interactions for layout/font/script/canvas threads to the ↵Josh Matthews2020-06-091-0/+1
| | | | | | | compositor thread. There is now a single RenderApi that is used, and all transactions are serialized through the compositor.
* Some Cargo.toml cleanupsatouchet2020-05-131-17/+17
|
* Update webrender.Josh Matthews2020-05-111-1/+1
|