New issue
Advanced search Search tips

Issue 780151 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 430155


Participants' hotlists:
Hostlist-AnimationWorklet-OT


Sign in to add a comment

Animation Worklet - WorkletAnimationPlayer::CurrentTime should be an offset against the animation start time

Project Member Reported by smcgruer@chromium.org, Oct 31 2017

Issue description

The web animations spec says:

"""
The current time is calculated from the first matching condition from below:
...

    current time = (timeline time - start time) × playback rate
"""

This is not currently what we do in WorkletAnimationPlayer::CurrentTime - we simply return the timeline time. We need to move the start time from cc::Animation up to cc::AnimationPlayer or cc::AnimationTicker, and use it as an offset here.

It is an unanswered question as to what we will do for ScrollTimelines, where this equation doesn't seem to make much sense.
 
Blocking: 430155
Labels: Hotlist-Experimental
Summary: Animation Worklet - WorkletAnimationPlayer::CurrentTime should be an offset against the animation start time (was: WorkletAnimationPlayer::CurrentTime should be an offset against the animation start time)

Comment 4 Deleted

Comment 5 Deleted

Cc: surma@chromium.org
(Whoops, completely wrong bug for the above two comments. Sigh. Fixed)
Cc: smcgruer@chromium.org
Owner: ----
Status: Available (was: Assigned)
surma@ I think we should try to fix this before AW OT. Otherwise the currentTime will not be useful for time-based animations.

I am not totally sure if we should consistently do this for all timelines (scroll and time) or just for time based ones.

We have filed a bug on web animation to see if ScrollTimeline should behave differently: https://github.com/w3c/csswg-drafts/issues/2075



Perhaps in the mean time we can do the following: 
 - For document timeline, current time gets offset from start offset.
 - For scroll timeline, current time is the absolute time and not offset.





 
 Issue 783333  has been merged into this issue.
Cc: -majidvp@chromium.org
Owner: majidvp@chromium.org
Status: Started (was: Available)
Project Member

Comment 11 by bugdroid1@chromium.org, May 28 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/52400b1104587b805ed4943b5ced445b65a0ce6a

commit 52400b1104587b805ed4943b5ced445b65a0ce6a
Author: Majid Valipour <majidvp@chromium.org>
Date: Mon May 28 19:03:30 2018

[animation-worklet] current time should be offset by start time

The current time send to animation worklet for each worklet animation
should be offset by its start time.

We consider the start time to be the time of the first frame where the
worklet is animated. This means that the first currentTime received
by the |animate()| callback will always be 0.

The patch moved the logic for collecting worklet animation state into
cc::WorkletAnimation. The new function generates the necessary state
and also records the start time on its first invocation.

Other changes:
 - CurrentTime is now a private method
 - record last_current_time_ inside GetState() which is more logical
 - Add test covering NeedsUpdate logic

TEST: WorkletAnimationTest.CurrentTimeFromTimeTimelineIsOffsetByStartTime, virtual/threaded/fast/animationworklet/worklet-animation-currentTime.html


Bug:  780151 
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I35562077d5332b53d893ff242e5c3df4cdc14a38
Reviewed-on: https://chromium-review.googlesource.com/1072501
Commit-Queue: Majid Valipour <majidvp@chromium.org>
Reviewed-by: Stephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#562294}
[modify] https://crrev.com/52400b1104587b805ed4943b5ced445b65a0ce6a/cc/animation/animation_host.cc
[modify] https://crrev.com/52400b1104587b805ed4943b5ced445b65a0ce6a/cc/animation/animation_host.h
[modify] https://crrev.com/52400b1104587b805ed4943b5ced445b65a0ce6a/cc/animation/worklet_animation.cc
[modify] https://crrev.com/52400b1104587b805ed4943b5ced445b65a0ce6a/cc/animation/worklet_animation.h
[modify] https://crrev.com/52400b1104587b805ed4943b5ced445b65a0ce6a/cc/animation/worklet_animation_unittest.cc
[add] https://crrev.com/52400b1104587b805ed4943b5ced445b65a0ce6a/third_party/WebKit/LayoutTests/virtual/threaded/fast/animationworklet/worklet-animation-currentTime-expected.txt
[add] https://crrev.com/52400b1104587b805ed4943b5ced445b65a0ce6a/third_party/WebKit/LayoutTests/virtual/threaded/fast/animationworklet/worklet-animation-currentTime.html

Status: Fixed (was: Started)
I will create a separate ticket for playback rate

Sign in to add a comment