New issue
Advanced search Search tips

Issue 724090 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Feature


Participants' hotlists:
Hotlist-AnimationWorklet


Sign in to add a comment

AnimationWorklet - Add cc::WorkletAnimationPlayer and blink::CompositorWorkletAnimationPlayer

Project Member Reported by majidvp@chromium.org, May 18 2017

Issue description

cc::WorkletAnimationPlayer will be the compositor side equivalent of a blink::WorkletAnimation.

The cc::WorkletAnimationPlayer should extend cc:AnimationPlayer but instead of using the timeline provided time, it will use a "local time" value that eventually comes from the corresponding animator that is running in the worklet scope. 

During an update cycle cc::WorkletAnimationPlayer takes its "local time" to updates its effects.

Note that unlike a regular web animation, a worklet animation owns multiple effect which means that a single blink::WorkletAnimation has a 1:N relationship with cc::WorkletAnimationPlayer. To faciliate this we may need to introduce a new blink side concept e.g., blink::CompositorWorkletAnimationPlayer.

For more info refer to AnimationWorklet design document [1]

[1] https://docs.google.com/a/chromium.org/document/d/1MdpvGtnK_A2kTzLeTd07NUevMON2WBRn5wirxWEFd2w/edit?usp=sharing
 
Project Member

Comment 1 by bugdroid1@chromium.org, Aug 17 2017

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

commit cff32e47470ed0cb7a49281057c9718b0e8a4ca7
Author: Majid Valipour <majidvp@chromium.org>
Date: Thu Aug 17 22:27:20 2017

LayerTreeMutator is now owned by AnimationHost

AnimationWorklet is no longer accesses layer tree directly but instead
it will receive state updates for each WorkletAnimation and sends new local
time values back. Naturally, it makes sense for LayerTreeMutator to move from
LTHI to MutatorHost where it is mutated alongside other accelerated animations. 

Here is the summary of changes:
 - AnimationHost now owns LayerTreeMutator (LTM) and it acts as its client
 - LTM::Mutate is called on AnimationHost::TickAnimations
 - Introduce a new AnimationHost::TickScrollAnimations to maintain same
   behavior as before where we call mutate on scroll update changes
 
This CL enables these follow up work:
 - Plumbing "current state" for worklet animations and passing them to
   LayerTreeMutator::Mutate.
 - Changing AnimationWorklet mutations to be sent to AnimationHost (impl side)
   which then updates worklet animation local times. These updates will then
   synced back to main thread as with other animations.


Bug:  724090 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I96939392582df7cd2ae3c711ef11f218680b5578
Reviewed-on: https://chromium-review.googlesource.com/616003
Commit-Queue: Majid Valipour <majidvp@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Reviewed-by: Robert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#495353}
[modify] https://crrev.com/cff32e47470ed0cb7a49281057c9718b0e8a4ca7/cc/animation/animation_host.cc
[modify] https://crrev.com/cff32e47470ed0cb7a49281057c9718b0e8a4ca7/cc/animation/animation_host.h
[modify] https://crrev.com/cff32e47470ed0cb7a49281057c9718b0e8a4ca7/cc/trees/layer_tree_host_impl.cc
[modify] https://crrev.com/cff32e47470ed0cb7a49281057c9718b0e8a4ca7/cc/trees/layer_tree_host_impl.h
[modify] https://crrev.com/cff32e47470ed0cb7a49281057c9718b0e8a4ca7/cc/trees/layer_tree_mutator.h
[modify] https://crrev.com/cff32e47470ed0cb7a49281057c9718b0e8a4ca7/cc/trees/mutator_host.h
[modify] https://crrev.com/cff32e47470ed0cb7a49281057c9718b0e8a4ca7/third_party/WebKit/Source/platform/graphics/CompositorMutatorClient.cpp
[modify] https://crrev.com/cff32e47470ed0cb7a49281057c9718b0e8a4ca7/third_party/WebKit/Source/platform/graphics/CompositorMutatorClient.h

Project Member

Comment 2 by bugdroid1@chromium.org, Oct 27 2017

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

commit 5f43611b81d52c48a9942a8600ea242ba03915bb
Author: Majid Valipour <majidvp@chromium.org>
Date: Fri Oct 27 03:36:19 2017

[animation-worklet] WorkletAnimation now starts animation on compositor

Upon starting a worklet animation it starts a corresponding animation player
on compositor.

Here is a summary of changes:
- Refactor CompositorAnimations to not assume that animation have a compositor
  animation player but instead take one as input argument. This is mainly because
  at the moment, WorkletAnimation is not a subclass of animation but has a
  player.
- Introduce a new constructor for CompositorAnimationPlayer that constructs a
  worklet player.
- Ensure WorkletAnimationController properly schedules frames when animations
  are attached so that we correctly push state to compositor.
- Update WorkletAnimation to construct its own worklet player and also correctly
  attach composited layers when it is started.
- Add a layout test to ensure starting a worklet animation does actually create
  a compositor animation that updates the visuals.


Bug:  724090 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I55c868b51eb1d7a0c72c3d4a7932f0f9a911db56
Reviewed-on: https://chromium-review.googlesource.com/690856
Commit-Queue: Majid Valipour <majidvp@chromium.org>
Reviewed-by: dstockwell <dstockwell@chromium.org>
Reviewed-by: Robert Flack <flackr@chromium.org>
Reviewed-by: Stephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512080}
[modify] https://crrev.com/5f43611b81d52c48a9942a8600ea242ba03915bb/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2
[add] https://crrev.com/5f43611b81d52c48a9942a8600ea242ba03915bb/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/animation-worklet-animator-animate-expected.txt
[add] https://crrev.com/5f43611b81d52c48a9942a8600ea242ba03915bb/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/animation-worklet-animator-animate.html
[modify] https://crrev.com/5f43611b81d52c48a9942a8600ea242ba03915bb/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/animation-worklet-animator-registration.html
[add] https://crrev.com/5f43611b81d52c48a9942a8600ea242ba03915bb/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/animation-worklet-visual-update-expected.html
[add] https://crrev.com/5f43611b81d52c48a9942a8600ea242ba03915bb/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/animation-worklet-visual-update.html
[modify] https://crrev.com/5f43611b81d52c48a9942a8600ea242ba03915bb/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/resources/animation-worklet-tests.js
[modify] https://crrev.com/5f43611b81d52c48a9942a8600ea242ba03915bb/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/resources/visual-update.js
[delete] https://crrev.com/c9050cfb6744e110b997ac8d7097dfc9598c3ed0/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/visual-update-expected.html
[modify] https://crrev.com/5f43611b81d52c48a9942a8600ea242ba03915bb/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp
[modify] https://crrev.com/5f43611b81d52c48a9942a8600ea242ba03915bb/third_party/WebKit/Source/core/animation/CompositorAnimations.h
[modify] https://crrev.com/5f43611b81d52c48a9942a8600ea242ba03915bb/third_party/WebKit/Source/core/animation/KeyframeEffectReadOnly.cpp
[modify] https://crrev.com/5f43611b81d52c48a9942a8600ea242ba03915bb/third_party/WebKit/Source/core/animation/KeyframeEffectReadOnly.h
[modify] https://crrev.com/5f43611b81d52c48a9942a8600ea242ba03915bb/third_party/WebKit/Source/core/animation/WorkletAnimationBase.h
[modify] https://crrev.com/5f43611b81d52c48a9942a8600ea242ba03915bb/third_party/WebKit/Source/core/animation/WorkletAnimationController.cpp
[modify] https://crrev.com/5f43611b81d52c48a9942a8600ea242ba03915bb/third_party/WebKit/Source/modules/compositorworker/WorkletAnimation.cpp
[modify] https://crrev.com/5f43611b81d52c48a9942a8600ea242ba03915bb/third_party/WebKit/Source/modules/compositorworker/WorkletAnimation.h
[modify] https://crrev.com/5f43611b81d52c48a9942a8600ea242ba03915bb/third_party/WebKit/Source/platform/animation/CompositorAnimationPlayer.cpp
[modify] https://crrev.com/5f43611b81d52c48a9942a8600ea242ba03915bb/third_party/WebKit/Source/platform/animation/CompositorAnimationPlayer.h

Comment 3 by yigu@chromium.org, Feb 7 2018

Cc: -majidvp@chromium.org yigu@chromium.org
Owner: majidvp@chromium.org
Hi Majid. This feature has been driven by you since its existence.
Transferring ownership...
Done.
Status: Fixed (was: Assigned)
We now have cc::WorkletAnimation which controls the animation worklet on cc side and manages its related time.

The remaining work relates to enabling GroupEffect support in blink and compositor. I have create a new  issue 843238  that tracks that work. 

Sign in to add a comment