mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Fix animation smoothness when using requestAnimationFrame.
Previously, the flow for ticking animations was: Compositor -> Constellation -> Layout -> Script However, this means that the compositor <-> layout messages can thrash, meaning layout thread is very rarely idle. This means that the script thread (which joins on the layout thread during reflow) was unable to execute and run rAF callbacks. With this change, the flow is now: Compositor -> Constellation -> Script (when rAF is active). Compositor -> Constellation -> Layout (when transitions / animations are active and no rAF is present). This makes rAF based animation *much* smoother.
This commit is contained in:
parent
46256b33ef
commit
92061132f3
5 changed files with 37 additions and 15 deletions
|
@ -1202,10 +1202,6 @@ impl LayoutThread {
|
|||
fn tick_all_animations<'a, 'b>(&mut self, possibly_locked_rw_data: &mut RwData<'a, 'b>) {
|
||||
let mut rw_data = possibly_locked_rw_data.lock();
|
||||
self.tick_animations(&mut rw_data);
|
||||
|
||||
self.script_chan
|
||||
.send(ConstellationControlMsg::TickAllAnimations(self.id))
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
pub fn tick_animations(&mut self, rw_data: &mut LayoutThreadData) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue