aboutsummaryrefslogtreecommitdiffstats
path: root/components/net/image_cache.rs
Commit message (Collapse)AuthorAgeFilesLines
* net: Start reducing number of IPCs channels used for fetch with a ↵Martin Robinson2024-10-161-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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>
* compositor: Create a single cross-process compositor API (#33619) (#33660)Martin Robinson2024-10-091-16/+17
| | | | | | | | | | | | | | | | | | | | | | 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>
* Revert "compositor: Create a single cross-process compositor API (#33619)" ↵Martin Robinson2024-10-041-17/+16
| | | | | | | | | (#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>
* compositor: Create a single cross-process compositor API (#33619)Martin Robinson2024-10-031-16/+17
| | | | | | | | | | | | | | | | | | | | | | 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>
* compositor: Move WebRender-ish messages and types to `webrender_traits` (#32315)Mukilan Thiyagarajan2024-05-201-11/+9
| | | | | | | | | | | | | | | | | | | | * 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>
* fix: unused mem import (#31608)eri2024-03-101-1/+1
|
* clippy: fix warnings in components/net (#31564)eri2024-03-101-25/+19
| | | | | | | * clippy: fix some warnings in components/net * fix: review comments * fix: tidy
* Make image decoding thread pool the size of the system's CPUs (#31585)eri2024-03-081-2/+9
|
* Use thread pool to decode image (#31517)eri2024-03-071-2/+8
| | | | | | | | | | | * feat: do not spawn dedicated thread to decode image * fix: change comment to docstring Co-authored-by: Taym Haddadi <haddadi.taym@gmail.com> --------- Co-authored-by: Taym Haddadi <haddadi.taym@gmail.com>
* script: Do not run layout in a thread (#31346)Martin Robinson2024-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * script: Do not run layout in a thread Instead of spawning a thread for layout that almost always runs synchronously with script, simply run layout in the script thread. This is a resurrection of #28708, taking just the bits that remove the layout thread. It's a complex change and thus is just a first step toward cleaning up the interface between script and layout. Messages are still passed from script to layout via a `process()` method and script proxies some messages to layout from other threads as well. Big changes: 1. Layout is created in the script thread on Document load, thus every live document is guaranteed to have a layout. This isn't completely hidden in the interface, but we can safely `unwrap()` on a Document's layout. 2. Layout configuration is abstracted away into a LayoutConfig struct and the LayoutFactory is a struct passed around by the Constellation. This is to avoid having to monomorphize the entire script thread for each layout. 3. Instead of having the Constellation block on the layout thread to figure out the current epoch and whether there are pending web fonts loading, updates are sent synchronously to the Constellation when rendering to a screenshot. This practically only used by the WPT. A couple tests start to fail, which is probably inevitable since removing the layout thread has introduced timing changes in "exit after load" and screenshot behavior. Co-authored-by: Josh Matthews <josh@joshmatthews.net> * Update test expectations * Fix some issues found during review * Clarify some comments * Address review comments --------- Co-authored-by: Josh Matthews <josh@joshmatthews.net>
* rustdoc: Fix many rustdoc errors (#31147)Martin Robinson2024-01-221-1/+1
| | | | This fixes many rustdoc errors that occur due to raw URLs in rustdoc comments as well as unescaped Rust code that should be in backticks.
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-11/+9
| | | | | * strict imports formatting * Reformat all imports
* remove `extern crate` (#30311)Samson2023-09-081-0/+1
| | | | | | | | | | | * remove extern crate * Update components/script_plugins/lib.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Replace `immeta` dependency with `imsz` (#30294)Martin Robinson2023-09-061-12/+11
| | | | `immeta` is no longer maintained and `imsz` seems to have support for more image formats as well as having no dependencies itself.
* Try to `use` WebRender types moreMartin Robinson2023-07-101-5/+6
| | | | | The newer versions of WebRender move types around between `webrender` and `webrender_api` and this will reduce the churn during the upgrade.
* Fix intermittency when loading poster imagesMartin Robinson2023-01-111-0/+2
| | | | | | | | | | | | | | | | | Wait until a poster image is cached to in order to unblock document load. If not, the document may continue loading before the image is ready to use, leading to intermittency in test output. Now load is unblocked when getting the ImageResponse from the cache, which allows the code to properly unblock the load when the entire load fails or succeeds. This reveals several false passes in the `object-view-box` test suite which were very flaky. Fixes #29204. Fixes #29188. Fixes #29179. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* components/net: Fix a double-lock in image_cacheBurtonQin2022-10-101-15/+27
|
* Convert all uses of UpdateResources api to use webrender transactions.Josh Matthews2020-05-111-3/+1
|
* Don't send a load event when a loaded image is actually the placeholderBastien Orivel2020-05-081-6/+14
| | | | | | | | | | | | The image cache returns an `ImageCacheResult::ImageAvailable `the second time you try getting the placeholder. This means that in some cases, the loading of an image would fail, then the same image would get fetched from the cache, the placeholder would be loaded from that but would be seen as a normal image, firing a load event. This made the tests in `fetch/cross-origin-resource-policy/image-loads.html` fail depending on their order.
* Properly set the url on the Response object when the response is an ↵Bastien Orivel2020-05-061-1/+1
| | | | opaqueredirect
* Use a restyle for animation ticksMartin Robinson2020-05-051-16/+4
| | | | | | | | | | | | | | This change corrects synchronization issues with animations, by reworking the animation processing model to do a quick restyle and incremental layout when ticking animations. While this change adds overhead to animation ticks, the idea is that this will be the fallback when synchronous behavior is required to fulfill specification requirements. In the optimistic case, many animations could be updated and applied off-the-main-thread and then resynchronized when style information is queried by script. Fixes #13865.
* Don't continually re-request completed requests that had load errors.Josh Matthews2020-04-171-12/+21
|
* Refactor ImageCache::find_image_or_metadata API.Julien Tregoat2020-04-171-30/+75
|
* Remove syn 0.15 from our crate graph (fixes #24421)Anthony Ramine2020-03-051-2/+4
| | | | | | | | | | This required bumps of: * gleam * image * rust-webvr * webrender * webxr
* Use non-IPC webrender API over explicit IPC channels.Josh Matthews2019-11-271-5/+7
|
* Add useful debug output for HTTP response and image cache.Josh Matthews2019-10-041-0/+1
|
* Support CORS attributes for image elements.Josh Matthews2019-10-041-15/+47
|
* Double key image cache by requesting origin, and store CORS status with ↵Josh Matthews2019-10-041-47/+86
| | | | cached images.
* WebRender units are no longer reexported.Patrick Walton2019-07-091-1/+2
|
* Remove unused code from net and net_traits cratesest312019-06-021-5/+0
|
* Update webrenderManish Goregaokar2018-11-271-1/+1
|
* Auto merge of #22225 - servo:webgl, r=emiliobors-servo2018-11-211-2/+3
|\ | | | | | | | | | | | | | | Send an IpcSharedMemory in tex_image_2d and tex_sub_image_2d <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22225) <!-- Reviewable:end -->
| * Call rgba8_byte_swap_colors_inplace on the WebGL threadAnthony Ramine2018-11-201-1/+1
| |
| * Move PixelFormat to the pixels crateAnthony Ramine2018-11-201-1/+2
| |
* | refactored performance timing to align with updated specddh2018-11-201-2/+2
|/ | | | | | | | | | | | refactoring with ResourceFetchMetadata implemented deprecated window.timing functionality created ResourceTimingListener trait fixed w3c links in navigation timing updated include.ini to run resource timing tests on ci
* Update MPL license to https (part 4)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* Optimise memory allocation in set_webrender_image_keyAnthony Ramine2018-11-161-0/+1
|
* Prefix some pixels functions with rgba8_Anthony Ramine2018-11-161-1/+1
|
* Remove useless `use crate_name;` imports.Simon Sapin2018-11-081-2/+0
| | | | A `crate_name::foo` path always works in 2018
* Reorder importsPyfisch2018-11-061-3/+3
|
* Rustfmt net cratePyfisch2018-11-031-75/+78
|
* Merge some byte swap/premultiply functions in their own crateAnthony Ramine2018-10-061-25/+2
|
* Update WR (transaction API change)Glenn Watson2018-06-201-5/+4
|
* delegate resource reading to embedderPaul Rouget2018-04-271-13/+7
|
* Update WR (accelerated webgl fix on mac, line decoration optimizations).Glenn Watson2018-03-231-0/+1
|
* Update WR (removal of RGB8, which isn't supported on some hardware).Glenn Watson2018-01-081-39/+30
| | | | | Instead, we convert any source RGB8 images into RGBx (with an opaque alpha channel).
* Remove usage of unstable feature iterator_step_bySimon Sapin2017-10-111-1/+4
|
* Update WR.Glenn Watson2017-08-091-1/+3
| | | | | | | * CPU text run optimizations. * Linux subpixel positioning / rasterization. * Update debug flags API. * Update to resource transactions API.
* Upgrade to the latest version of WebRenderMartin Robinson2017-07-131-17/+17
|
* UntrySimon Sapin2017-06-181-2/+2
|