mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Use a restyle for animation ticks
This change corrects synchronization issues with animations, by reworking the animation processing model to do a quick restyle and incremental layout when ticking animations. While this change adds overhead to animation ticks, the idea is that this will be the fallback when synchronous behavior is required to fulfill specification requirements. In the optimistic case, many animations could be updated and applied off-the-main-thread and then resynchronized when style information is queried by script. Fixes #13865.
This commit is contained in:
parent
5e44327325
commit
b585ce5b1f
39 changed files with 1285 additions and 1662 deletions
|
@ -47,15 +47,6 @@ pub enum Msg {
|
|||
/// Get an RPC interface.
|
||||
GetRPC(Sender<Box<dyn LayoutRPC + Send>>),
|
||||
|
||||
/// Requests that the layout thread render the next frame of all animations.
|
||||
TickAnimations(ImmutableOrigin),
|
||||
|
||||
/// Updates layout's timer for animation testing from script.
|
||||
///
|
||||
/// The inner field is the number of *milliseconds* to advance, and the bool
|
||||
/// field is whether animations should be force-ticked.
|
||||
AdvanceClockMs(i32, bool, ImmutableOrigin),
|
||||
|
||||
/// Requests that the layout thread measure its memory usage. The resulting reports are sent back
|
||||
/// via the supplied channel.
|
||||
CollectReports(ReportsChan),
|
||||
|
@ -216,6 +207,8 @@ pub struct ScriptReflow {
|
|||
pub origin: ImmutableOrigin,
|
||||
/// Restyle snapshot map.
|
||||
pub pending_restyles: Vec<(TrustedNodeAddress, PendingRestyle)>,
|
||||
/// How much to advance the clock when testing.
|
||||
pub advance_clock_delta: Option<i32>,
|
||||
}
|
||||
|
||||
pub struct LayoutThreadInit {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue