Add support for transitionrun events

These events are triggered as soon as a transition is added to the list
of running transitions. This will allow better test coverage while
reworking the transitions and animations processing model.
This commit is contained in:
Martin Robinson 2020-04-23 17:06:24 +02:00
parent 0540c4a284
commit d386d6d1f1
11 changed files with 105 additions and 93 deletions

View file

@ -1762,13 +1762,18 @@ impl LayoutThread {
.map(|nodes| nodes.lock().unwrap());
let newly_transitioning_nodes =
newly_transitioning_nodes.as_mut().map(|nodes| &mut **nodes);
// Kick off animations if any were triggered, expire completed ones.
animation::update_animation_states::<ServoLayoutElement>(
let mut animation_states = self.animation_states.write();
animation::collect_newly_transitioning_nodes(
&animation_states,
newly_transitioning_nodes,
);
animation::update_animation_states(
&self.constellation_chan,
&self.script_chan,
&mut *self.animation_states.write(),
&mut *animation_states,
invalid_nodes,
newly_transitioning_nodes,
self.id,
&self.timer,
);