This change has two parts which depend on each other:
1. An early exit in the layout process, which allows for skipping
display list construction entirely when nothing would change.
2. A simplification and unification of the way that "fake" animation
frames are triggered. Now this happens on an entire ScriptThread at
once and is based on whether or not any Pipeline triggered a display
list update.
Animations are never canceled in the compositor when the Pipeline
isn't updating, instead the fake animation frame is triggered far
enough in the future that an unexpected compositor tick will cancel
it. This could happen, for instance, if some other Pipeline in some
other ScriptThread produced a new display list for a tick. This makes
everything simpler about these ticks.
The goal is that in a future change the ScriptThread-based animation
ticks will be made more generic so that they can throttle the number of
"update the rendering" calls triggered by script.
This should make Servo do a lot less work when moving the cursor over a
page. Before it would constantly produce new display lists.
Fixes: #17029.
Testing: This should not cause any web observable changes. The fact that
all WPT tests keep passing is the test for this change.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This adds a *very* basic implementation of the `RefreshDriver` concept
to the Servo renderer. The initial idea is that controls the frequency
of display during animations. It eliminates the "slowdown" workaround
for WPT tests and now Servo animations don't move faster than 120 FPS
(observed to be slower in practice).
This establishes a base change which will be used to implement
non-display-list-producing layouts in a followup change.
Fixes#3406. (though much more work remains)
Testing: Covered by existing WPT tests.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>