diff options
author | Jonathan Schwender <55576758+jschwe@users.noreply.github.com> | 2024-11-10 11:15:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-10 10:15:42 +0000 |
commit | 72971bd2716a7e574a4c6c3395c7a710652427b4 (patch) | |
tree | cf2fd6e624bd3ece6fa2f58d15a90a7634193d1c /components/compositing/windowing.rs | |
parent | dcb9058fe367390c3043d2d261f53eff485a52d2 (diff) | |
download | servo-72971bd2716a7e574a4c6c3395c7a710652427b4.tar.gz servo-72971bd2716a7e574a4c6c3395c7a710652427b4.zip |
Add simple fling implementation (#33219)
* Add simple fling implementation
Add a simple fling implementation, which depends on a refresh tick from the
embedder.
Currently this refresh tick is only implemented for OpenHarmony
(using the vsync signal).
The fling implementation is very simple, without any fancy things like acceleration.
This can be improved in the future.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* Multiply initial velocity with 2
This makes the experience much more snappy.
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* address review comments
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Rename constants and add todo
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* fmt
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Add a few periods to make comments consistent
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'components/compositing/windowing.rs')
-rw-r--r-- | components/compositing/windowing.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/components/compositing/windowing.rs b/components/compositing/windowing.rs index 31c4380f8ba..7f56d29dc62 100644 --- a/components/compositing/windowing.rs +++ b/components/compositing/windowing.rs @@ -128,6 +128,8 @@ pub enum EmbedderEvent { ReplaceNativeSurface(*mut c_void, DeviceIntSize), /// Sent when new Gamepad information is available. Gamepad(GamepadEvent), + /// Vertical Synchronization tick + Vsync, } impl Debug for EmbedderEvent { @@ -187,6 +189,7 @@ impl Debug for EmbedderEvent { EmbedderEvent::InvalidateNativeSurface => write!(f, "InvalidateNativeSurface"), EmbedderEvent::ReplaceNativeSurface(..) => write!(f, "ReplaceNativeSurface"), EmbedderEvent::Gamepad(..) => write!(f, "Gamepad"), + EmbedderEvent::Vsync => write!(f, "Vsync"), } } } |