mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
145bc92aff
Normally animation players get times from their timeline which is based on the refresh driver for their associated document. However, for animations that we time from when their first frame has been rendered, we want to record the actual time when painting finished as their start time. If we wait until the next refresh driver tick then the delay between playing an animation and its actual start will be too great. In this patch, we introduce a mechanism for fast-forwarding a timeline to a time between the current refresh driver time and the next refresh driver tick. By adjusting the timeline rather than the player we maintain a consistent state (in fact, if we just naively set the animation player start time to the timestamp value we recorded when painting finished it will appear to start in the future and the animation will temporarily jump from playing, to waiting to start, then back to playing again on the next refresh driver tick). To be completely consistent, however, when we fast-forward the timeline we should tell all animation players listening to the timeline to mark their target element as needing a style flush. Otherwise we may be able to observe an inconsistency between some animation players' current time and the computed style of their targets. We don't, however, currently know which players are observing a given timeline. We will likely introduce that in the near future (in order to implement AnimationTimeline.getAnimationPlayers) and fix the inconsistency in timing then. A test later in the patch series verifies this inconsistency so it is easy to fix in future. An alternative approach would be to simply record the time when animation should start, send that time to the compositor but don't actually update the animation start time on the main thread until the subsequent refresh driver tick. Such an approach is complex as it introduces an additional state--"finished pending but not yet started". We will attempt to switch to that approach in bug 1112480. |
||
---|---|---|
.. | ||
test | ||
Animation.cpp | ||
Animation.h | ||
AnimationEffect.cpp | ||
AnimationEffect.h | ||
AnimationPlayer.cpp | ||
AnimationPlayer.h | ||
AnimationTimeline.cpp | ||
AnimationTimeline.h | ||
AnimationUtils.h | ||
moz.build | ||
PendingPlayerTracker.cpp | ||
PendingPlayerTracker.h |