ohos: Present on vsync signals (#33117)

Rely on callbacks from the vertical synchronization driver,
to drive presentation.
Future commits will base animation updates and touchless
gestures like fling off these vsync events.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
Jonathan Schwender 2024-08-30 21:25:50 +08:00 committed by GitHub
parent a58d816319
commit 8a0c7487e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 83 additions and 9 deletions

View file

@ -39,7 +39,13 @@ pub trait HostTrait {
/// Page animation state has changed. If animating, it's recommended
/// that the embedder doesn't wait for the wake function to be called
/// to call perform_updates. Usually, it means doing:
/// while true { servo.perform_updates() }. This will end up calling flush
/// ```rust
/// while true {
/// servo.perform_updates();
/// servo.present_if_needed();
/// }
/// ```
/// . This will end up calling flush
/// which will call swap_buffer which will be blocking long enough to limit
/// drawing at 60 FPS.
/// If not animating, call perform_updates only when needed (when the embedder