mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #8300 - pcwalton:avoid-animation-state-flooding, r=glennw
layout: Avoid flooding the compositor with animation state changes if there are no animations running and no new animations were added. Avoids compositor jank during scroll. r? @glennw <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8300) <!-- Reviewable:end -->
This commit is contained in:
commit
27fb2ed26d
1 changed files with 6 additions and 0 deletions
|
@ -58,6 +58,12 @@ pub fn update_animation_state(rw_data: &mut LayoutTaskData, pipeline_id: Pipelin
|
||||||
|
|
||||||
let mut running_animations_hash = (*rw_data.running_animations).clone();
|
let mut running_animations_hash = (*rw_data.running_animations).clone();
|
||||||
|
|
||||||
|
if running_animations_hash.is_empty() && new_running_animations.is_empty() {
|
||||||
|
// Nothing to do. Return early so we don't flood the compositor with
|
||||||
|
// `ChangeRunningAnimationsState` messages.
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Expire old running animations.
|
// Expire old running animations.
|
||||||
let now = clock_ticks::precise_time_s();
|
let now = clock_ticks::precise_time_s();
|
||||||
let mut keys_to_remove = Vec::new();
|
let mut keys_to_remove = Vec::new();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue