commit | 35c2a0c08dcbf7368d699a91603cd46b42aaef1c | [log] [tgz] |
---|---|---|
author | Majid Valipour <majidvp@chromium.org> | Fri Feb 08 23:53:30 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Fri Feb 08 23:53:30 2019 |
tree | a3cd9dc65ad7b2dcd68d001aebb73f55bc00c228 | |
parent | 545a25e8c0d56ba1d0efa98a648a8549bae3eb28 [diff] |
[animation-worklet] Basic pause implementation (reland) Pausing worklet animation now holds the time. This works as expected for main thread animations. Implementing this for composited worklet animations will be done in a follow up patch. Major changes: - Add and expose pause() method pausing the animation. - Introduce hold_time that is used when animation is paused. - Rework how current time is computed, it is now closer to regular animations i.e., we either compute it based on "start time and timeline.currentTime" or use "hold time". - Instead of setting start time we now set the current time which then works backward to compute either the start time or the hold time based on the animation state. - When transitioning animation play state, we now always set the current time. Previously this was adhoc and inconsistent. - Introduce has_started_ to differentiate when playing an animation for the first time vs playing it from pause. - Update playback_rate related calculation to use new logic. Relanding: Original CL was reverted here [1]. Took the following steps to address this: - Address flakiness in unit test by using more accurate error value matching other tests. - Fix flakiness in layout test (worklet-animation-pause.https.html) by using startTime and waiting for time to actually advance working around pre-existing animation clock issue [2]. Also got rid of an invalid state transition from pause->idle. [1] https://chromium-review.googlesource.com/c/chromium/src/+/1434815 [2] http://crbug.com/785940 TEST: - wpt/animation-worklet/worklet-animation-pause.https.html: js test for basic current time calculations - wpt/animation-worklet/worklet-animation-pause-immediately.https.html: reftest for basic pause - wpt/animation-worklet/worklet-animation-pause-result.https.html: reftest for pause/resume. - WorkletAnimationTest.PausePlay: unit test for basic state transition and time calc Bug: 821910, Change-Id: I11fd2960443081be81055904d6d56a2abc3282f5 Reviewed-on: https://chromium-review.googlesource.com/c/1456640 Reviewed-by: Majid Valipour <majidvp@chromium.org> Reviewed-by: Yi Gu <yigu@chromium.org> Commit-Queue: Majid Valipour <majidvp@chromium.org> Cr-Commit-Position: refs/heads/master@{#630548}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .