mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Raf delivery: run rafs for all pipeline if tick received for any. (#33395)
* update the rendering: run rafs for all pipeline, if tick received for any Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * prioritize only one updating of the rendering per event-loop wake-up Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> --------- Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
This commit is contained in:
parent
9175e598ad
commit
23b0dc603c
3 changed files with 42 additions and 12 deletions
|
@ -3335,10 +3335,17 @@ impl Document {
|
|||
self.pending_animation_ticks.borrow_mut().extend(tick_type);
|
||||
}
|
||||
|
||||
/// Whether this document has received an animation tick for rafs.
|
||||
pub fn has_received_raf_tick(&self) -> bool {
|
||||
self.pending_animation_ticks
|
||||
.borrow()
|
||||
.contains(AnimationTickType::REQUEST_ANIMATION_FRAME)
|
||||
}
|
||||
|
||||
/// As part of a `update_the_rendering` task, tick all pending animations.
|
||||
pub fn tick_all_animations(&self) {
|
||||
pub fn tick_all_animations(&self, should_run_rafs: bool) {
|
||||
let tick_type = mem::take(&mut *self.pending_animation_ticks.borrow_mut());
|
||||
if tick_type.contains(AnimationTickType::REQUEST_ANIMATION_FRAME) {
|
||||
if should_run_rafs {
|
||||
self.run_the_animation_frame_callbacks();
|
||||
}
|
||||
if tick_type.contains(AnimationTickType::CSS_ANIMATIONS_AND_TRANSITIONS) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue