aboutsummaryrefslogtreecommitdiffstats
path: root/components/compositing/compositor.rs
Commit message (Collapse)AuthorAgeFilesLines
* Rename messages forwarded from the constellation to the compositor (#30496)Martin Robinson2023-10-051-20/+41
| | | | | | The constellation forwards messages from other tasks to the compositor. Mainly, these are passed to WebRender. This change updates the names of these messages so it is clearer where they are coming from and where they are going.
* Only access hit test items for the current epoch in the compositor (#30491)Martin Robinson2023-10-041-1/+15
| | | | | | | | | | | | | | | When display lists update quickly, a hit test result might be returned for a previous display list / list of hit test items. When that happens, ignore the hit test result. This fixes a crash, but there might be situations where we can do something better, such as wait for display list processing to finish before performing the hit test. A future change might do this for events like mouse clicks and touch events that should never be thrown away. Ultimately, the best thing is likely moving hit testing back to layout or script so a valid hit test can always be performed against the current DOM. Fixes #29796.
* Add shell.background-color.rgba to prefs (#30488)Ngo Iok Ui (Wu Yu Wei)2023-10-041-2/+9
| | | | | | | * Add shell.transparent-background.enabled to prefs * Rename config to background_color * Rename to background-color and.rgba add PrefValue::Array variant
* Fix pinch zoom and enable it for TouchpadMagnify events (#30459)Martin Robinson2023-10-031-109/+141
| | | | | | | | | Pinch zoom was broken because pinch zoom events were triggered at -1, -1 in the compositor. This change: 1. Differentiates between magnify and scroll events in the compositor to remove the question of where to trigger them. 2. Converts winit TouchpadMagnify events into pinch zoom events so that this works properly on MacOS.
* Implement pinch zoom with a display list (#30446)Martin Robinson2023-10-021-15/+83
| | | | | In the most recent version of WebRender, the pinch zoom APIs have been removed. We can recreate this functionality by creating a root display list with a transform.
* Fix main frame scrolling in quirks mode after WebRender (#30375)Martin Robinson2023-09-181-1/+1
| | | | | | | Main frame scrolling after the WebRender upgrade was broken because the main frame no longer has content size content bounds and quirks mode leads to a body with zero height. Fixes #30368.
* servoshell: fix lockups while animating (#30322)Delan Azabani2023-09-121-0/+1
| | | | | | | | | | | * servoshell: fix lockups while animating * move comment to external_present declaration * disable needs_recomposite optimisation for now due to breakage * fix compile error that only happens on ci * fix more compile errors
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-13/+15
| | | | | * strict imports formatting * Reformat all imports
* Upgrade WebRender to e491e1ae637b2eed1e7195855d88357e5eb3ddf9 (#30323)Martin Robinson2023-09-101-51/+51
| | | | | | | | | | | | | | | | | | * Upgrade vendored version of WebRender * Patch WebRender: upgrade version of gleam * Restore hit testing implementation * Fix WebRender warnings * Adapt Servo to new WebRender * Update results * Add a workaround for #30313 This slightly expands text boundaries in order to take into account the fact that layout isn't measuring glyph boundaries.
* remove `extern crate` (#30311)Samson2023-09-081-1/+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>
* [NFC] compositing: extract types into new compositing_traits crate (#30125)Delan Azabani2023-08-181-55/+31
| | | | | | | | | | | * [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
* winit: initial minibrowser (#29976)Delan Azabani2023-08-151-6/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * winit: add minibrowser feature that depends on egui{,-winit} * winit: carve out some space at the top of headed windows * winit: minimal toolbar and egui/winit integration (but no painting) * winit: try to paint with egui_glow (doesn’t work yet) * winit: add comment about toolbar size * Add framebuffer object, set it as glow's target * compositing: clear only the viewport, not the whole framebuffer * plumb the actual size of the egui toolbar to webrender * fix formatting * winit: fix crash when fbo is zero * winit: don’t bother binding the framebuffer object * winit: remove unsafe and get toolbar_height * winit: location field should reflect the current top-level url * [NFC] winit: move Minibrowser out of App::run * winit: clean up toolbar height code * winit: make App own the Minibrowser if any * winit: make the go button work * winit:make the location field reflect the current top-level url * winit: allow enabling minibrowser from command line * winit: tell compositor to repaint WR and flush when we repaint * winit: fix bug where location field edits would get overridden * winit: borrow the minibrowser once in App::handle_events * winit: address todo about viewport origin coordinates * winit: fix some minor problems with comments and errors * winit: update location field once per HistoryChanged event * winit: rename Window::set_toolbar_size to set_toolbar_height * winit: take toolbar height into account in hit testing * winit: pass egui only relevant CursorMoved events * winit: scratch that, coalesce minibrowser updates instead * ensure both minibrowser and WR are repainted on every frame * compositing: only skip framebuffer clear in external present mode * winit: destroy egui glow Painter when shutting down * winit: clean up and fix license lint * fix duplicate versions lint by downgrading bytemuck_derive was egui_glow ^0.22.0 (0.22.0) → egui/bytemuck ^0.22.0 (0.22.0) → epaint/bytemuck ^0.22.0 (0.22.0) → bytemuck ^1.7.2 (1.13.1) → bytemuck_derive ^1.4 (1.4.1) → syn ^2.0.1 (2.0.28) now lock has bytemuck_derive 1.4.0 → syn ^1.0.99 (1.0.103) * fix duplicate versions lint by disabling egui-winit/links (we don’t need support for hyperlinks in our use of egui) * squelch duplicate versions lint by excluding clipboard-win * winit: fix compile warnings * winit: make gleam an optional dependency under /minibrowser * winit: remove cargo feature, since it’s not really optional * winit: extract Minibrowser and related code to separate module * winit: remove unnecessary trailing comma * winit: simplify the ServoUrl serialisation optimisation --------- Co-authored-by: atbrakhi <atbrakhi@igalia.com>
* Fix viewport origin of webrender frame (#30088)Ngo Iok Ui (Wu Yu Wei)2023-08-101-1/+1
| | | | | * Fix viewport origin of webrender frame * Update documentations
* Stop using webrender_api::get_scroll_node_state (#30000)Martin Robinson2023-07-171-27/+23
| | | | | | | | | This API has been removed in the latest version of WebRender and we can simply get this information from the compositor-side scroll tree. In addition, this change limits the amount of data sent to the pipeline that actually changed and gives the function in the compositor a better name. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Try to `use` WebRender types moreMartin Robinson2023-07-101-34/+30
| | | | | The newer versions of WebRender move types around between `webrender` and `webrender_api` and this will reduce the churn during the upgrade.
* It was removed from the spec and it's disabled everywhere.Emilio Cobos Álvarez2023-06-301-19/+0
| | | | This also removes the meta viewport support (which was implemented on top), but that also had a single test and is disabled everywhere, so I'm not too concerned, it can be implemented again if / when needed.
* Clean up and document the `send_display_list` interfaceMartin Robinson2023-05-241-18/+19
| | | | | | This moves more members to the CompositorDisplayListInfo struct, which now holds all miscellaneous, non-WebRender data when sending display lists. It also documents what each things sent with a display list does.
* Add a compositor-side scroll treeMartin Robinson2023-05-191-4/+85
| | | | | | 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.
* Fix scrolling on root elementMartin Robinson2023-05-051-1/+5
| | | | | | | | | | | | | eca0acf4598c173c71765b961bd2079c0bb48cd2 uncovered a bug in the way that the scrolling area of `window` was calculated and broke scrolling on the root element. This change does two things in order to fix that: 1. Does a partial revert of eca0acf4598c173c71765b961bd2079c0bb48cd2 in order to get scrolling from script working again on the window object. 2. Has the compositor always generate a frame for scrolls starting from script and waits for them. This is speculative fix for flakiness in root scrolling tests on CI.
* Fix flakiness in hit testingMartin Robinson2023-04-261-0/+12
| | | | We need to make sure that hit testing from script reflects the latest display list we have sent from the compositor.
* Move hit testing information out of WebRenderMartin Robinson2023-03-151-66/+99
| | | | | | | | | Store hit testing information in a data structure that sits alongside the display list in the compositor. This will allow the compositor to store more information per-node. The data structure also takes care of de-duplicating information between successive display list entries. In the future, the data structure can be even more aggressive in producing smaller side hit testing lists, if necessary.
* Use IpcBytesReceiver to send Display list dataWu Yu Wei2022-03-101-18/+21
|
* Add SerializedImageData to use IpcBytesReceiverYu-Wei Wu2022-03-101-5/+18
|
* Create initial browser id for compositor on startup.Josh Matthews2021-10-181-17/+23
|
* Only request synchronous repaint when a resize will actually occur.Josh Matthews2021-03-051-2/+3
|
* Fix warnings introduced in newer Rust NightlySimon Sapin2021-02-251-6/+0
| | | | | | | | | | | | This does not (yet) upgrade ./rust-toolchain The warnings: * dead_code "field is never read" * redundant_semicolons "unnecessary trailing semicolon" * non_fmt_panic "panic message is not a string literal, this is no longer accepted in Rust 2021" * unstable_name_collisions "a method with this name may be added to the standard library in the future" * legacy_derive_helpers "derive helper attribute is used before it is introduced" https://github.com/rust-lang/rust/issues/79202
* Fix mouse button handlingYUAN LYU2020-12-061-1/+1
|
* Fix ordering of mousemove eventUtsav Oza2020-07-301-1/+1
|
* Gstreamer plugin support for streaming from webxrAlan Jeffrey2020-07-161-0/+3
|
* Remove unecessary webrender document from layout.Josh Matthews2020-06-091-7/+5
|
* Proxy all WR interactions for layout/font/script/canvas threads to the ↵Josh Matthews2020-06-091-8/+155
| | | | | | | compositor thread. There is now a single RenderApi that is used, and all transactions are serialized through the compositor.
* Use a restyle for animation ticksMartin Robinson2020-05-051-11/+13
| | | | | | | | | | | | | | 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.
* Update surfman to 0.2 and remove glutinAlan Jeffrey2020-04-171-7/+59
|
* Remove WebVRAlan Jeffrey2020-04-081-18/+1
|
* Auto merge of #25914 - paulrouget:lessRAF, r=jdmbors-servo2020-03-091-3/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stop embedder calls and fake rAF when window not visible This addresses 2 issues: - a rAF loop might still be ongoing when the window is invisible if script decided that the rAF were going too fast (spurious rAF) - a hidden window does not run the rAF loop, but the embedder would still be in animating mode --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
| * Stop embedder calls and fake rAF when window not visiblePaul Rouget2020-03-061-3/+1
| |
* | Remove syn 0.15 from our crate graph (fixes #24421)Anthony Ramine2020-03-051-1/+1
|/ | | | | | | | | | This required bumps of: * gleam * image * rust-webvr * webrender * webxr
* Track outstanding WR frames and delay reftest screenshot when necessary.Josh Matthews2020-02-211-1/+10
|
* move ConstellationMsg to compositingKunal Mohan2020-01-291-3/+2
|
* Avoid recompiling script every time surfman changesAlan Jeffrey2019-11-181-1/+1
|
* Properly set event.buttons value on mousemovePaul Rouget2019-11-111-5/+1
|
* Ensure layout/script always have a correct viewport size when a new pipeline ↵Josh Matthews2019-11-061-5/+0
| | | | is created.
* Centralize definitions of window sizes and DPI in compositor/constellation ↵Josh Matthews2019-11-061-13/+3
| | | | during startup.
* Use surfman for managing GL surfacesPatrick Walton2019-11-011-2/+2
| | | | | | Co-authored-by: Alan Jeffrey <ajeffrey@mozilla.com> Co-authored-by: Zakor Gyula <gyula.zakor@h-lab.eu> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
* Double key image cache by requesting origin, and store CORS status with ↵Josh Matthews2019-10-041-0/+2
| | | | cached images.
* Implement pointerMove webdriver actionGeorge Roman2019-08-221-9/+11
|
* Implement TakeElementScreenshot WebDriver commandGeorge Roman2019-08-201-8/+29
|
* Implement pointerDown and pointerUp webdriver actionsGeorge Roman2019-08-161-0/+17
|
* Update euclid.Emilio Cobos Álvarez2019-07-231-44/+35
| | | | | | | | There are a few canvas2d-related dependencies that haven't updated, but they only use euclid internally so that's not blocking landing the rest of the changes. Given the size of this patch, I think it's useful to get this landed as-is.
* Auto merge of #23770 - matharumanpreet00:update_cursor_on_scroll, r=paulrougetbors-servo2019-07-151-10/+20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | track and update cursor while scrolling <!-- Please describe your changes on the following line: --> This PR follows PR #23313 to fix the issue #12604 by adding a field `cursor_pos: DevicePoint` to `IOCompositor` and adding a `update_cursor()` method. This is based on the improvements suggested by @paulrouget in this [feedback](https://github.com/servo/servo/pull/23313#issuecomment-489017975) comment. This is my first time contributing to open source, i would love any feedback. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #12604 (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because they aren't testable, as discussed in the comments on #12604 <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- 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/23770) <!-- Reviewable:end -->