aboutsummaryrefslogtreecommitdiffstats
path: root/components/fonts
Commit message (Collapse)AuthorAgeFilesLines
* layout: Report memory usage for fragment and box trees. (#36553)Josh Matthews9 days1-1/+2
| | | | | | | | | | | | Add memory reporter integration for the fragment and box trees that are persisted in the layout thread. Testing: Looked at the numbers for https://servo.org and https://html.spec.whatwg.org/. The former was very small, but the latter was 700mb. --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Update FetchTaskTarget to propagate CSP violations. (#36409)Tim van der Lippe14 days1-3/+3
| | | | | | | | | | | | | | | | | | It also updates the FetchResponseListener to process CSP violations to ensure that iframe elements (amongst others) properly generate the CSP events. These iframe elements are used in the Trusted Types tests themselves and weren't propagating the violations before. However, the tests themselves are still not passing since they also use Websockets, which currently aren't using the fetch machinery itself. That is fixed as part of [1]. [1]: https://github.com/servo/servo/issues/35028 --------- Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com> Signed-off-by: Josh Matthews <josh@joshmatthews.net> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
* `compositing`: Combine `webrender_traits` and `compositing_traits` (#36372)Martin Robinson2025-04-064-4/+4
| | | | | | | | | | | | | | | 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>
* Organize component Cargo.toml dependencies (#36224)Alex Touchet2025-03-301-5/+5
| | | Signed-off-by: Alex Touchet <26315797+atouchet@users.noreply.github.com>
* Upgrade to Stylo e941241 (#36120)Nico Burns2025-03-251-16/+3
| | | | | | | | | | | | | * Upgrade to Stylo e941241 Signed-off-by: Nico Burns <nico@nicoburns.com> * Make test less fragile Signed-off-by: Nico Burns <nico@nicoburns.com> --------- Signed-off-by: Nico Burns <nico@nicoburns.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>
* Migrate to the 2024 edition (#35755)Simon Wülker2025-03-135-9/+8
| | | | | | | | | | | | | | | | | | | | | | * Migrate to 2024 edition Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Allow unsafe_op_in_unsafe_fn lint This lint warns by default in the 2024 edition, but is *way* too noisy for servo. We might enable it in the future, but not now. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Compile using the 2024 edition Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Use new stylo crate renames (#35898)Nico Burns2025-03-122-2/+2
| | | Signed-off-by: Nico Burns <nico@nicoburns.com>
* Upgrade Stylo to 2025-03-01 (#35782)Oriol Brufau2025-03-042-3/+0
| | | | | | | | | | | | | | | | | * Upgrade Stylo to 2025-03-01 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://phabricator.services.mozilla.com/D236733 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Update test expectations Signed-off-by: Oriol Brufau <obrufau@igalia.com> --------- Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Update rustfmt to the 2024 style edition (#35764)Simon Wülker2025-03-0317-57/+55
| | | | | | | | | | | | | * Use 2024 style edition Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Reformat all code Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* fonts: Remove the per-FontGroup cached fallback font (#35705)Martin Robinson2025-02-282-13/+10
| | | | | | | | | | | | | | | | | | | Instead of keeping a per-FontGroup cache of the previously used fallback font, cache this value in the caller of `FontGroup::find_by_codepoint`. The problem with caching this value in the `FontGroup` is that it can make one layout different from the next. Still, it is important to cache the value somewhere so that, for instance, Chinese character don't have to continuously walk through the entire fallback list when laying out. The heuristic here is to try to last used font first if the `Script`s match. At the very least this should make one layout consistent with the next. Fixes #35704. Fixes #35697. Fixes #35689. Fixes #35679. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* clippy: Fix a couple clippy warnings on macOS (#35703)Martin Robinson2025-02-271-1/+1
| | | | | | The new version of rust has more checks trying to prevent mistakes around order of operations and shifts. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Update to rust 1.85 (#35628)Simon Wülker2025-02-241-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * Update to rust 1.85 This is needed for cargo-deny Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Upgrade crown Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Clippy fixes Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Re-upgrade cargo-deny to 0.18 Keeping it locked to 0.18 just in case they update their required rustc version again Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* script: add skeleton implementation of `FontFace` API (#35262)Mukilan Thiyagarajan2025-02-194-180/+339
| | | | | | | | | | | | | | | | This patch implements the `FontFace` interface, but with some caveats 1. The interface is only exposed on `Window`. Support for Workers will be handled in the future. 2. The concept of `css-connected` `FontFace` is not implemented, so `@font-face` rules in stylesheets will not be represented in the DOM. 3. The constructor only supports using `url()` strings as source and `ArrayBuffer` and `ArrayBufferView` are not supported yet. A skeleton implementation of the `load` method of `FontFaceSet` is also implemented in this patch. The intention is to support some web pages that don't load without this method. Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Don't remove used fonts in collect_unused_webrender_resources (#35506)Simon Wülker2025-02-171-1/+1
| | | | | The check on whether or not a font should be retained was inverted. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* deps: Remove some unused `Cargo.toml` (#35466)Martin Robinson2025-02-141-1/+0
| | | | | These were discovered with cargo-machete. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Include `WebViewId` into EmbedderMsg variants where possible (#35211)Delan Azabani2025-01-301-2/+11
| | | | | | | | | | | | | | | | | `EmbedderMsg` was previously paired with an implicit `Option<WebViewId>`, even though almost all variants were either always `Some` or always `None`, depending on whether there was a `WebView involved. This patch adds the `WebViewId` to as many `EmbedderMsg` variants as possible, so we can call their associated `WebView` delegate methods without needing to check and unwrap the `Option`. In many cases, this required more changes to plumb through the `WebViewId`. Notably, all `Request`s now explicitly need a `WebView` or not, in order to ensure that it is passed when appropriate. Signed-off-by: Delan Azabani <dazabani@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Fix some clippy issues on the Android build (#35147)Martin Robinson2025-01-232-32/+17
| | | | | This fixes a variety of clippy issues that show up on the Android build. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Fix building libservo with `cargo build -p libservo` (#35116)Delan Azabani2025-01-231-7/+2
| | | | | | | | | | | | | | | | | | | * Fix building libservo with `cargo build -p libservo` Signed-off-by: Delan Azabani <dazabani@igalia.com> * Test the libservo build in CI Signed-off-by: Delan Azabani <dazabani@igalia.com> * Work around build issue on macOS (#34517) Signed-off-by: Delan Azabani <dazabani@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com> --------- Signed-off-by: Delan Azabani <dazabani@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* fonts: Remove synchronous web font loading functionality (#35000)Martin Robinson2025-01-151-21/+0
| | | | | | | | Synchronous web font loading is not specification compliant and was added in #8341 to work around issues that do not exist any longer. This change removes the functionality and ensures that WPT tests are run with the spec compliant loader. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* api: Flatten and simplify Servo preferences (#34966)Martin Robinson2025-01-141-4/+4
| | | | | | | | | | | | | | | | | | | 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>
* net: Use `RequestId` to cancel fetches instead of creating an IPC channel ↵Martin Robinson2025-01-111-1/+0
| | | | | | | | | | | | | | | | | | (#34883) Instead of creating an IPC channel for every fetch, allow cancelling fetches based on the `RequestId` of the original request. This requires that `RequestId`s be UUIDs so that they are unique between processes that might communicating with the resource process. In addition, the resource process loop now keeps a `HashMap` or `Weak` handles to cancellers and cleans them up. This allows for creating mutiple `FetchCanceller`s in `script` for a single fetch request, allowing integration of the media and video elements to integrate with the `Document` canceller list -- meaning these fetches also get cancelled when the `Document` unloads. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* script: Move navigation fetching to the `ScriptThread` (#34919)Martin Robinson2025-01-101-0/+1
| | | | | | | | | | | | | | | | | | | | This allows reusing the asynchrnous fetch mechanism that we use for page resources and is likely a step toward removing the `FetchThread`. Benefits: - Reduces IPC traffic during navigation. Now instead of bouncing between the constellation and the `ScriptThread` responses are sent directly to the `ScriptThread`. - Allows cancelling loads after redirects, which was not possible before. There is the question of what to do when a redirect is cross-origin (#23037). This currently isn't handled properly as the `Constellation` sends data to the same `Pipeline` that initiated the load. This change doesn't fix this issue, but does make it more possible for the `ScriptThread` to shut down the pipeline and ask the `Constellation` to replace it with a new one. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Upgrade rustc to 1.83 (#34793)Nico Burns2025-01-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Upgrade rustc to 1.83 Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix crown (change copied from linked clippy function) Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix named lifetime lint Signed-off-by: Nico Burns <nico@nicoburns.com> * Bump shell.nix Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix non-local impl warnings Signed-off-by: Nico Burns <nico@nicoburns.com> * Format with 1.83 formatting changes Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix manual non-local impl Signed-off-by: Nico Burns <nico@nicoburns.com> * More fixes for crown Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix tidy Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix needless_return lints Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix doc comment lint Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix missing wait lint Signed-off-by: Nico Burns <nico@nicoburns.com> * Allow needless_lifetimes lint Signed-off-by: Nico Burns <nico@nicoburns.com> * more doc comments Signed-off-by: Nico Burns <nico@nicoburns.com> * More needless_returns Signed-off-by: Nico Burns <nico@nicoburns.com> * is_empty lint Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix needless_lifetime lints Signed-off-by: Nico Burns <nico@nicoburns.com> * fix div_ceil lint Signed-off-by: Nico Burns <nico@nicoburns.com> * Allow non-minimal bool Signed-off-by: Nico Burns <nico@nicoburns.com> * Non-local impl in constellation Signed-off-by: Nico Burns <nico@nicoburns.com> * Missing wait in constellation Signed-off-by: Nico Burns <nico@nicoburns.com> * fmt Signed-off-by: Nico Burns <nico@nicoburns.com> * remove useless lints table Signed-off-by: Nico Burns <nico@nicoburns.com> * Fixup comments Signed-off-by: Nico Burns <nico@nicoburns.com> * Allow non-local definition in sandboxing code to simplify feature flagging Signed-off-by: Nico Burns <nico@nicoburns.com> * Remove wait calls and allow zombie_processes lint Signed-off-by: Nico Burns <nico@nicoburns.com> --------- Signed-off-by: Nico Burns <nico@nicoburns.com>
* Don't trace SystemFontService loop (#34508)Jonathan Schwender2024-12-061-4/+0
| | | | | | Most of the time here is spent blocking on the channel, and after we received the message we already have a new span. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* ohos: fonts: Fix HalfwidthandFullwidthForms font fallback (#34410)Jonathan Schwender2024-11-281-0/+8
| | | | | | | | | | This codeblock contains chinese, japanese and korean characters, so we add the simplified chinese and the CJK fallback fonts. Additionally, we add the new CJK fallback font for the koren and japanese unicode blocks, since the KR and JP fallback fonts don't seem to be present on the latest OH versions anymore. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Additional tracing for flex layout, inline layout, and fonts (#34392)Delan Azabani2024-11-271-0/+9
| | | Signed-off-by: Delan Azabani <dazabani@igalia.com>
* Remove some unused dependencies (#34355)Jonathan Schwender2024-11-251-4/+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>
* fonts: fix broken caching of font template matches (#34325)Mukilan Thiyagarajan2024-11-212-2/+19
| | | | | | | | After a cache miss, `find_matching_font_template` never updates the cache entry with the response from the `SystemFontService` leading to several unnecessary IPC calls during layout. Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Fix various clippy warnings on OpenHarmony (#34281)Jonathan Schwender2024-11-191-19/+16
| | | | | | | | | | | | | | | | | | * ohos: Fix more clippy warnings Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Remove unnecessary `macro_use` We can use `use` instead. Removes a warning about unused macro_use on OpenHarmony. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> --------- Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Set all tracing spans to trace level for now (#34256)Delan Azabani2024-11-192-14/+9
| | | | | | | | | | | | | * Clean up tracing instrumentation Signed-off-by: Delan Azabani <dazabani@igalia.com> * Set all tracing spans to trace level for now Signed-off-by: Delan Azabani <dazabani@igalia.com> --------- Signed-off-by: Delan Azabani <dazabani@igalia.com>
* ohos/android: Fix some compiler warnings (#34178)Jonathan Schwender2024-11-072-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | | * ohos: Remove unnecessary library links `ohos-sys` now correctly links all required libraries, so we don't need to specify them here again. We still specify `ace_napi.z`, since we use napi via `napi-ohos`, which currently does not add the required link. Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Disable some unused functions on ohos/android - get_default_url() - parse_url_or_filename() - add_noto_fallback_families Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * ohos: Remove unneeded import Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> --------- Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* andrdoid: Fix some compiler warnings (#34070)Martin Robinson2024-10-304-19/+10
| | | | | | | This removes unused code in order to reduce the number of compiler warnings on the Android build. Some of this code might be used in the future and it can be restored from git commit history. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* clippy: Fix warning in `fonts/platform/macos/font_list.rs` (#33971)Martin Robinson2024-10-231-1/+1
| | | Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* clippy: Fix a variety of clippy warnings in `fonts`, `layout_2020` and the ↵chickenleaf2024-10-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DOM code (#33894) * fixed some clippy warnings Signed-off-by: L Ashwin B <lashwinib@gmail.com> * Delete extra file Signed-off-by: chickenleaf <lashwinib@gmail.com> * preserved newline in compositionevent.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: chickenleaf <lashwinib@gmail.com> * removed the newline in PrototypeList Signed-off-by: L Ashwin B <lashwinib@gmail.com> * removed the trailing whitespace Signed-off-by: L Ashwin B <lashwinib@gmail.com> --------- Signed-off-by: L Ashwin B <lashwinib@gmail.com> Signed-off-by: chickenleaf <lashwinib@gmail.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* net: Start reducing number of IPCs channels used for fetch with a ↵Martin Robinson2024-10-161-19/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `FetchThread` (#33863) Instead of creating a `ROUTER` for each fetch, create a fetch thread which handles all incoming and outcoming fetch requests. Now messages involving fetches carry a "request id" which indicates which fetch is being addressed by the message. This greatly reduces the number of file descriptors used by fetch. In addition, the interface for kicking off fetches is simplified when using the `Listener` with `Document`s and the `GlobalScope`. This does not fix all leaked file descriptors / mach ports, but greatly eliminates the number used. Now tests can be run without limiting procesess on modern macOS systems. Followup work: 1. There are more instances where fetch is done using the old method. Some of these require more changes in order to be converted to the `FetchThread` approach. 2. Eliminate usage of IPC channels when doing redirects. 3. Also eliminate the IPC channel used for cancel handling. 4. This change opens up the possiblity of controlling the priority of fetch requests. Fixes #29834. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Gate all use of `tracing` behind Cargo feature (#33845)Delan Azabani2024-10-163-12/+36
| | | Signed-off-by: Delan Azabani <dazabani@igalia.com>
* clippy: Add safety documentation and clean up unsafe methods (#33748)Martin Robinson2024-10-162-29/+31
| | | | | | | | | | | This change: 1. Adds safety documentation where it was missing. 2. Limits the scope of unsafe code in some cases to where it is actually unsafe. 3. Converts some free functions to associated functions and methods, thereby making them more likely to be called safely. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* clippy: Fix issues in `components/fonts` and `ports/servoshell` (#33809)Mercy Bassey2024-10-112-2/+2
| | | | | | | | | | | | | | | | * fix linting issues Signed-off-by: mercybassey <udohmercy911@gmail.com> adding '-s' * Remove a pair of unecessary parenethesis Signed-off-by: Martin Robinson <mrobinson@igalia.com> --------- Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* fonts: Instantiate system fonts using system font loaders (#33747)Martin Robinson2024-10-1020-798/+758
| | | | | | | | | | | | | | | | | | | | | System fonts used to be instantiated using the system font loader and this change restores that behavior. In addition, on macOS and FreeType platforms font data for system fonts is loaded using memory mapping. The benefit is that system font loaders typically are able to cache fonts in system memory (using memory mapping, for instance) and we'd like to load them in a the way most compatible with other applications. On my Linux system, this manages to get the overhead of loading a very large font down from 10ms to approximately 1ms. Subsequent runs show even less overhead. We've measured similar gains on macOS systems. Currently, system font data must be loaded into memory manually for canvas and this is unlikely to change even with a switch to `vello`. The use of explicit memmory mapping should help in this case -- though it probably won't be possible to use this properly on macOS and Windows if we ever want to load fonts from TTCs properly. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Remove most usage of ReentrantMutex in font code (#33746)Josh Matthews2024-10-103-9/+8
| | | | | | | | | | | | | * Remove unnecessary ReentrantMutex usage for senders. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Remove double lock for freetype face. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Improve `Au(0)` constructions (#33709)birdbrained2024-10-104-10/+13
| | | | | This replaces `Au(0)` with `Au::zero()` and other utility functions when possible. Signed-off-by: hackerbirds <120066692+hackerbirds@users.noreply.github.com>
* compositor: Create a single cross-process compositor API (#33619) (#33660)Martin Robinson2024-10-093-32/+26
| | | | | | | | | | | | | | | | | | | | | | 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>
* Cleanup FontContext privacy (#33745)Josh Matthews2024-10-091-55/+54
| | | | | | | | | | | | | * Remove unnecessary FontContext argument in FontContext method. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Make more parts of FontContext private. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Fix clamp-like pattern warning in font.rs (#33705)chickenleaf2024-10-081-1/+1
| | | Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* tools: Improve instrumentation and add it for some layout (#33647)Martin Robinson2024-10-051-7/+7
| | | | | | | Improves the instrumentation to skip all function arguments and also add spans for some layout modes. This is preparation for improving the performance of flexbox. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* fonts: Eliminate overhead of first font instance creation (#33638)Martin Robinson2024-10-041-4/+13
| | | | | | | | | | | | | | The first font instance creation in the `SystemFontService` was triggering fetching font keys, which added an approximately 1ms lag to this operation. Doing this as soon as the `SystemFontService` thread is spawned eliminates this lag. In addition increase the size of the font key and font instance key batch in order to avoid having to fetch new keys so frequently. This change also adds profiling spans to the `SystemFontService` so it is easier to see where it is spending its time when using perfetto. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Revert "compositor: Create a single cross-process compositor API (#33619)" ↵Martin Robinson2024-10-043-26/+32
| | | | | | | | | (#33645) This reverts commit f2f5614ad64927aa82aa8937ae14a6086df49d2b. This is causing intermittent crashes: https://github.com/servo/servo/actions/runs/11167043809/job/31044255019 Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* clippy: Fix let binding in components/fonts/font_context.rs (#33643)Adavize Promise2024-10-041-3/+2
| | | | | | | | | | | | | * clippy: Fix let binding in components/fonts/font_context.rs Signed-off-by: PS Adavize <siyakapromise@gmail.com> * clippy: Fix needless borrow in components\script\dom\gpucanvascontext.rs Signed-off-by: PS Adavize <siyakapromise@gmail.com> --------- Signed-off-by: PS Adavize <siyakapromise@gmail.com>
* compositor: Create a single cross-process compositor API (#33619)Martin Robinson2024-10-033-32/+26
| | | | | | | | | | | | | | | | | | | | | | 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>