mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Auto merge of #7724 - glennw:expire-anims, r=pcwalton
Ensure that animations expire correctly and stop compositing occurring after they finish. There were two problems here: (1) The animation state update function was only called when nodes were dirty or there were new animations. (2) When all animations for a node expired, the entry from the hash table was not removed. The result was that once an animation began, the compositor would be running as fast as it can forever. Fixes #7721. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7724) <!-- Reviewable:end -->
This commit is contained in:
commit
b4b3cedc10
3 changed files with 32 additions and 23 deletions
|
@ -1183,9 +1183,6 @@ impl LayoutTask {
|
|||
|
||||
// Retrieve the (possibly rebuilt) root flow.
|
||||
rw_data.root_flow = self.try_get_layout_root((*node).clone());
|
||||
|
||||
// Kick off animations if any were triggered.
|
||||
animation::process_new_animations(&mut *rw_data, self.id);
|
||||
}
|
||||
|
||||
// Send new canvas renderers to the paint task
|
||||
|
@ -1327,6 +1324,9 @@ impl LayoutTask {
|
|||
rw_data: &mut LayoutTaskData,
|
||||
layout_context: &mut SharedLayoutContext) {
|
||||
if let Some(mut root_flow) = rw_data.layout_root() {
|
||||
// Kick off animations if any were triggered, expire completed ones.
|
||||
animation::update_animation_state(&mut *rw_data, self.id);
|
||||
|
||||
profile(time::ProfilerCategory::LayoutRestyleDamagePropagation,
|
||||
self.profiler_metadata(),
|
||||
self.time_profiler_chan.clone(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue