New issue
Advanced search Search tips

Issue 833846 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature

Blocked on:
issue 835824

Blocking:
issue 430155



Sign in to add a comment

Animation Worklet - Worklet Animation should support all Animation behavior

Project Member Reported by majidvp@chromium.org, Apr 17 2018

Issue description

Current implementation only supports basic playback play(), cancel(), pause() but we should support all of the abilities that animation
provides.

Our long-term plan here is to actually make WorkletAnimation a proper subclass of animation. In the meantime we may want to add key cirtical
functionalities that are missing.

 
Note that, right now WorkletAnimation does not respond to changes in its 
keyframe effects. So changing timing options of keyframes of its effect does not actually do anything. We should fix these as well.

Comment 2 by surma@chromium.org, Apr 17 2018

Supporting `updateTiming()` should definitely be supported before OT. Authors need to be able to update the `delay` properties in response to a window resize. As a consequence, we should probably support all properties that `updateTiming()` accepts. I’d find it odd if we supported updating `delay` but not for example `easing`.
Cc: flackr@chromium.org smcgruer@chromium.org
Just to document this somewhere:


Regular animations support timing updates by basically destroying and recreating
the compositor side animation every time there is a timing changes. That is all
fine for stateless animations but we probably want to avoid this for stateful
worklet animation since it will lead to the animator instance being torn down
and recreated and lose its state. 

The cc animation supports replacing the keyframes but this is not currently used
by blink. Perhaps we can use that functionality in this case.




Components: Blink>Animation
Blockedon: 799061
I doubt this is blocked by 799061, since the only missing functionality (afaik) is CSS Transition (TransitionKeyframe) support. setKeyframes() should work fine for StringKeyframe, which AnimationWorklet should be using.
I suspect we may be blocked by 799061 for |animation.effect.setKeyframes()| usecase but not the timing updates.

AFAICT, animation or effect does not get any notification when keyframes are set. I think is not a problem for running animation because the next update 
uses the new keyframes but that is not true for composited animations (and worklet animation) as they need to get notified and update/recreate the composited animation accordingly. 

I created a simple test case here: http://jsbin.com/pagujijali/edit?html,console,output

See also: https://codesearch.chromium.org/chromium/src/third_party/blink/renderer/core/animation/keyframe_effect_model.cc?type=cs&l=61

Blockedon: -799061 835824
Ah, good catch! I opened  issue 835824  for that, and moved this issue to be blocked on the new bug.
Project Member

Comment 9 by bugdroid1@chromium.org, Apr 30 2018

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

commit 8eb8112e20c16abe20adb58073583c7b7fd7906c
Author: Majid Valipour <majidvp@chromium.org>
Date: Mon Apr 30 16:19:41 2018

[animation-worklet] worklet animation updates cc when timing changes

Introduce WorkletAnimation::UpdateCompositingState which is resposible
to update cc side when necessary (e.g., during start or when there is
a change while running).

WorkletAnimation now notifies its controller that it has been invalidated
once its timing has changed. This ensures it gets a change to update its
compositing state on the next commit cycle.

While animation is running, the state update is done by canceling and
starting the keyframe effect on compositor side. This ensures the
animation instance continues to live (with the same id) and thus
keep any associated state while also updating its keyframes and timings.

Other minor changes:
- Use GetEffect() to access the main effect for the animation.
- Refactor start logic.

Tests:
- virtual/threaded/fast/animationworklet/worklet-animation-set-timing.html test timing
   updates are reflected in cc.
- virtual/threaded/fast/animationworklet/worklet-animation-set-keyframes.html test keyframe
   updates are reflected in cc.

Bug: 833846
Change-Id: Icab984331a0584d9bd1eb38d24aef2f657070970
Reviewed-on: https://chromium-review.googlesource.com/1020239
Commit-Queue: Majid Valipour <majidvp@chromium.org>
Reviewed-by: Majid Valipour <majidvp@chromium.org>
Reviewed-by: Stephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554776}
[add] https://crrev.com/8eb8112e20c16abe20adb58073583c7b7fd7906c/third_party/WebKit/LayoutTests/virtual/threaded/fast/animationworklet/worklet-animation-set-keyframes-expected.html
[add] https://crrev.com/8eb8112e20c16abe20adb58073583c7b7fd7906c/third_party/WebKit/LayoutTests/virtual/threaded/fast/animationworklet/worklet-animation-set-keyframes.html
[add] https://crrev.com/8eb8112e20c16abe20adb58073583c7b7fd7906c/third_party/WebKit/LayoutTests/virtual/threaded/fast/animationworklet/worklet-animation-set-timing-expected.html
[add] https://crrev.com/8eb8112e20c16abe20adb58073583c7b7fd7906c/third_party/WebKit/LayoutTests/virtual/threaded/fast/animationworklet/worklet-animation-set-timing.html
[modify] https://crrev.com/8eb8112e20c16abe20adb58073583c7b7fd7906c/third_party/blink/renderer/core/animation/worklet_animation_base.h
[modify] https://crrev.com/8eb8112e20c16abe20adb58073583c7b7fd7906c/third_party/blink/renderer/core/animation/worklet_animation_controller.cc
[modify] https://crrev.com/8eb8112e20c16abe20adb58073583c7b7fd7906c/third_party/blink/renderer/core/animation/worklet_animation_controller.h
[modify] https://crrev.com/8eb8112e20c16abe20adb58073583c7b7fd7906c/third_party/blink/renderer/modules/animationworklet/worklet_animation.cc
[modify] https://crrev.com/8eb8112e20c16abe20adb58073583c7b7fd7906c/third_party/blink/renderer/modules/animationworklet/worklet_animation.h

Cc: surma@chromium.org
Status: Started (was: Available)
The above patch with other changes that smcgruer@ has been landing enables basic support for updating timing and keyframes for worklet animations. 

There are still other bugs but for a running worklet animations things should work as expected. See the tests above to get a sense of what is possible.


I am keeping this issue open since there are more behavior that we need to
support.
Labels: -Type-Bug Type-Feature
Status: Available (was: Started)
Labels: Pri-3
Project Member

Comment 14 by bugdroid1@chromium.org, Jan 14

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

commit d289cc3d18133b214343813578bd71bc48837305
Author: Majid Valipour <majidvp@chromium.org>
Date: Mon Jan 14 18:19:09 2019

[animation worklet] Implement WorkletAnimation.currentTime

Allow currentTime for WorkletAnimation to be read (but not set).

The tests are inspired by web-animation tests for current time
except that we currently do not support playbackRate or worklet
animations without timeline.

TESTS: external/wpt/animation-worklet/current-time.https.html

Bug: 833846
Change-Id: I004ccd003d9471b34eb239941124f9a31973e753
Reviewed-on: https://chromium-review.googlesource.com/c/1397846
Commit-Queue: Majid Valipour <majidvp@chromium.org>
Reviewed-by: Stephen McGruer <smcgruer@chromium.org>
Reviewed-by: Majid Valipour <majidvp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622514}
[modify] https://crrev.com/d289cc3d18133b214343813578bd71bc48837305/third_party/blink/renderer/modules/animationworklet/worklet_animation.cc
[modify] https://crrev.com/d289cc3d18133b214343813578bd71bc48837305/third_party/blink/renderer/modules/animationworklet/worklet_animation.h
[modify] https://crrev.com/d289cc3d18133b214343813578bd71bc48837305/third_party/blink/renderer/modules/animationworklet/worklet_animation.idl
[add] https://crrev.com/d289cc3d18133b214343813578bd71bc48837305/third_party/blink/web_tests/external/wpt/animation-worklet/current-time.https.html
[modify] https://crrev.com/d289cc3d18133b214343813578bd71bc48837305/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt

Sign in to add a comment