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.
This commit is contained in:
Glenn Watson 2015-09-24 10:29:58 +10:00
parent eca448363d
commit f6cb6c3b86
3 changed files with 32 additions and 23 deletions

View file

@ -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(),