New issue
Advanced search Search tips

Issue 756539 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 18
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Feature

Blocked on:
issue 776017
issue 881868

Blocking:
issue 430155
issue 814851


Participants' hotlists:
Hotlist-AnimationWorklet

Show other hotlists

Other hotlists containing this issue:
Hotlist-1


Sign in to add a comment

AnimationWorklet - Plumb local time values from worklet to compositor & main thread

Project Member Reported by majidvp@chromium.org, Aug 17 2017

Issue description

Animators running in AnimationWorklet global scope update local times of their keyframes. 
These values should be send back to compositor and main thread so the effect are appropriately updated.
Here is a sketch of how this may be done.

Plumbing from Worklet -> CC:
 - Wait until |AnimationWorkletrProxyClientImpl::Mutate| is complete
 - Collect local time values for all active animators
 - Create a plumbing to apply mutation from: AnimationWorkletrProxyClientImpl->CompositorMutator->[CompositorMutatorClient/LayerTreeMutator]->AnimationHost
 - Pass the collected state via above plumbing to  AnimationHost (impl side)
 - AnimationHost updates corresponding animation players in cc


Plumbing from CC -> Main:
I think this can be part of the existing SetEvents process that allows syncing impl to main sides of AnimationHost
 - Create an UPDATE_TIME Event for each local time update in previous work
 - When applying these event on main thread, simply update the animation player local time
 - This in turn needs to update various delegates which will eventually reach the blink::Animation and blink::KeyframeEffect


Once this is done we can remove the followings:

 * LayerTreeMutator::TakeMutations
 * CompositorMutationsTarget
 * CustomCompositorAnimationManager
 
Labels: -Type-Bug Type-Feature
Owner: majidvp@chromium.org
Status: Started (was: Available)
Blockedon: 776017
Project Member

Comment 4 by bugdroid1@chromium.org, Oct 20 2017

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

commit e9855f7a88df8eca0976faa6b37c59a0a229e10d
Author: Majid Valipour <majidvp@chromium.org>
Date: Fri Oct 20 02:08:58 2017

[animation-worklet] Send state from cc to worklet and back.

The patch introduces the followings:
 - cc::WorkletAnimationPlayer: A type of animation player that has a
   local time and a name. This class overrides Tick method to use
   its own local time to tick its animations.
 - Add appropriate hook in AnimationTicker to allow external party to
   control the time used for ticking an animation.
 - cc::Mutator{Input,Output}State: structs that are used to shuttle data
   to/from cc to animation worklet.
 - Update LayerTreeMutator::Mutate to accept input state
   add LayerTreeMutatorClient::SetMutationUpdate that takes output state.
 - Collect input state in AnimationHost when sending mutate signal to
   AnimationWorklet and then apply output state once we receive the
   result back.
 - Update AnimationWorkletGlobalScope to take input state and update its
   animators accordingly.
-  compositorworker/EffectProxy.idl: A placeholder object that can be
   used in animator animate callback to set a local time. These are then
   plumbed back to the corresponding worklet player in cc.



Bug:  756539 ,  737576 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ifd7f3e80220ccef5d21892648f6dbd9527b58725
Reviewed-on: https://chromium-review.googlesource.com/613860
Commit-Queue: Majid Valipour <majidvp@chromium.org>
Reviewed-by: Ian Vollick <vollick@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Robert Flack <flackr@chromium.org>
Reviewed-by: Stephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510298}
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/cc/BUILD.gn
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/cc/animation/BUILD.gn
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/cc/animation/animation.cc
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/cc/animation/animation.h
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/cc/animation/animation_host.cc
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/cc/animation/animation_host.h
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/cc/animation/animation_player.cc
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/cc/animation/animation_player.h
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/cc/animation/animation_ticker.cc
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/cc/animation/animation_ticker.h
[add] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/cc/animation/worklet_animation_player.cc
[add] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/cc/animation/worklet_animation_player.h
[add] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/cc/animation/worklet_animation_player_unittest.cc
[add] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/cc/test/mock_layer_tree_mutator.cc
[add] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/cc/test/mock_layer_tree_mutator.h
[add] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/cc/trees/layer_tree_mutator.cc
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/cc/trees/layer_tree_mutator.h
[delete] https://crrev.com/6e0c02cb31234406e18df2c9fed341af1e4c47a2/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/animation-worklet-animator-animate-expected.txt
[delete] https://crrev.com/6e0c02cb31234406e18df2c9fed341af1e4c47a2/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/animation-worklet-animator-animate.html
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/animation-worklet-animator-registration-expected.txt
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/third_party/WebKit/Source/core/animation/CompositorAnimator.h
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/third_party/WebKit/Source/core/animation/CompositorMutatorImpl.cpp
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/third_party/WebKit/Source/core/animation/CompositorMutatorImpl.h
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletGlobalScope.cpp
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletGlobalScope.h
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletGlobalScopeTest.cpp
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletProxyClientImpl.cpp
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletProxyClientImpl.h
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/third_party/WebKit/Source/modules/compositorworker/Animator.cpp
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/third_party/WebKit/Source/modules/compositorworker/Animator.h
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/third_party/WebKit/Source/modules/compositorworker/BUILD.gn
[add] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/third_party/WebKit/Source/modules/compositorworker/EffectProxy.h
[add] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/third_party/WebKit/Source/modules/compositorworker/EffectProxy.idl
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/third_party/WebKit/Source/modules/modules_idl_files.gni
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/third_party/WebKit/Source/platform/BUILD.gn
[add] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/third_party/WebKit/Source/platform/graphics/CompositorAnimatorsState.h
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/third_party/WebKit/Source/platform/graphics/CompositorMutator.h
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/third_party/WebKit/Source/platform/graphics/CompositorMutatorClient.cpp
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/third_party/WebKit/Source/platform/graphics/CompositorMutatorClient.h
[modify] https://crrev.com/e9855f7a88df8eca0976faa6b37c59a0a229e10d/third_party/WebKit/Source/platform/wtf/Time.h

The above patch takes care of pumbing cc<->worklet. I will still keep the bug open to track the main thread work.

petermayo@ has taken care of removing compositor worker specific plumbing too, i.e,
 * LayerTreeMutator::TakeMutations
 * CompositorMutationsTarget
 * CustomCompositorAnimationManager

Blocking: 430155
Blocking: 814851
Blockedon: 881868
Shall we close this bug?
Yes. Thanks
Status: Fixed (was: Started)

Sign in to add a comment