Animation and Frame Scheduling
Evaluate server-owned animation against the display clock and schedule work with enough time to reach the output.
Because the server retains scene properties, it can evaluate an animation without receiving a new property value from the client at every refresh. The client describes the transition once, and the composer samples it as part of preparing subsequent frames.
Transition Descriptions
An animatable field accepts either Animatable::Set for an immediate assignment or Animatable::Interpolation for a transition. The latter carries policy such as easing and repeat behavior, which the composer uses when maintaining and sampling the animation's state.
Not every property has the same interpolation behavior. Geometry, transforms, opacity, and optional effects have type-specific rules. Inspect the animation types when adding a new animated field rather than assuming every enum or optional value can be blended continuously.
Animation Sampling and Display Time
Frame preparation receives a predicted presentation instant. Sampling at that instant produces a scene intended for the upcoming output boundary, rather than the earlier moment when CPU encoding starts.
To leave enough time for that scene to reach the display, the scheduler measures CPU frame duration and uses an estimate of the asynchronous GPU tail when one is available. Those measurements determine how far ahead rendering should begin. If the predicted work cannot reach the next refresh boundary, the scheduler can choose a later reachable boundary.
Display Feedback
On a fixed clock, the scheduler aligns plans with the display's refresh phase. Identified page-flip sequences help it tell the difference between skipped refreshes and an actual period change, while checks for stale timestamps, duplicates, and sequence discontinuities protect the estimate from misleading feedback.
Variable-refresh scheduling follows its configured timing constraints and retry policy. Failed render attempts still need pacing so resource pressure does not become a busy loop.
Advisory Client Hints
Clients can use the estimates in FrameScheduled to coordinate their own work, but the hint does not require them to produce a frame. Actual display activation is reported separately through FramePresented. Since both messages concern frame timing, clients still use CommitAccepted to determine when their retained scene baseline changes.
See commit outcomes and building a frame.
Source Reference
The following files in the Hera checkout define the behavior described on this page.
crates/protocol/src/animation.rscrates/composer/src/animation/mod.rscrates/composer/src/scheduler.rscrates/server/src/frame/driver.rs