New issue
Advanced search Search tips

Issue 843255 link

Starred by 2 users

Issue metadata

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

Blocking:
issue 430155



Sign in to add a comment

Animation Worklet - Add ability to mutate a subset of worklet animations

Project Member Reported by majidvp@chromium.org, May 15 2018

Issue description

Currently the sync mechanism between cc and worklet is
stateless meaning that it sends a new copy of the world every sync cycle.
This has the benefit of keeping things very simple initially but it is not necessarily very efficient.

For example it has the following concrete drawbacks:
1. Serializable options argument is only used during construction. So we need to send that input once.
2. It is not possible to ask for only a subset of animations to mutate and produce update (e.g., only those whose time value has changed)


One solution is to introduce different input types:
 - add => create an animator (and perhaps call `animate` on it) for a set of animations
 - update/run => call `animate` for a set of animations
 - remove => remove an animator.


The above change should help address both issues. 
 
I think key pieces that need to be changed are
 a) cc::MutatorInputState to enable different input types
 b) Update cc::AnimationHost::CollectAnimatorsState() to produce a different input type based on the worklet animation "current state"
 c) introduce "current state" in WorkletAnimation to track its state.
 d) Update blink::AnimationWorkletGlobalScope::Mutate to behave differently for different input types 


For (c) we basically need to track transitions going from starting -> running -> finished. This has some overlap with existing KeyframeModel::run_state_ so we should check to see if we can actually use the child effect's effect model state instead.
Project Member

Comment 2 by bugdroid1@chromium.org, Jun 14 2018

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

commit 9bbcad05d6ff6634ee0caaa1e57add914b1adda5
Author: Yi Gu <yigu@chromium.org>
Date: Thu Jun 14 19:44:06 2018

Make worklet animation stateful

Currently the sync mechanism between cc and worklet is stateless meaning
that it sends a new copy of the world every sync cycle. This has the
benefit of keeping things very simple initially but it is not
necessarily very efficient.

This patch makes worklet animation stateful and adds the ability to
mutate only a subset of animations.

Bug:  843255 
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I18e5d64d0145394fad739a70fa7d0e91bb0e4588
Reviewed-on: https://chromium-review.googlesource.com/1092413
Commit-Queue: Yi Gu <yigu@chromium.org>
Reviewed-by: Majid Valipour <majidvp@chromium.org>
Reviewed-by: Stephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567367}
[modify] https://crrev.com/9bbcad05d6ff6634ee0caaa1e57add914b1adda5/cc/animation/animation.cc
[modify] https://crrev.com/9bbcad05d6ff6634ee0caaa1e57add914b1adda5/cc/animation/animation.h
[modify] https://crrev.com/9bbcad05d6ff6634ee0caaa1e57add914b1adda5/cc/animation/animation_host.cc
[modify] https://crrev.com/9bbcad05d6ff6634ee0caaa1e57add914b1adda5/cc/animation/keyframe_effect.h
[modify] https://crrev.com/9bbcad05d6ff6634ee0caaa1e57add914b1adda5/cc/animation/single_keyframe_effect_animation.h
[modify] https://crrev.com/9bbcad05d6ff6634ee0caaa1e57add914b1adda5/cc/animation/worklet_animation.cc
[modify] https://crrev.com/9bbcad05d6ff6634ee0caaa1e57add914b1adda5/cc/animation/worklet_animation.h
[modify] https://crrev.com/9bbcad05d6ff6634ee0caaa1e57add914b1adda5/cc/animation/worklet_animation_unittest.cc
[modify] https://crrev.com/9bbcad05d6ff6634ee0caaa1e57add914b1adda5/cc/trees/layer_tree_mutator.cc
[modify] https://crrev.com/9bbcad05d6ff6634ee0caaa1e57add914b1adda5/cc/trees/layer_tree_mutator.h
[modify] https://crrev.com/9bbcad05d6ff6634ee0caaa1e57add914b1adda5/third_party/blink/renderer/modules/animationworklet/animation_worklet_global_scope.cc
[modify] https://crrev.com/9bbcad05d6ff6634ee0caaa1e57add914b1adda5/third_party/blink/renderer/modules/animationworklet/animation_worklet_global_scope.h
[modify] https://crrev.com/9bbcad05d6ff6634ee0caaa1e57add914b1adda5/third_party/blink/renderer/modules/animationworklet/animation_worklet_global_scope_test.cc
[modify] https://crrev.com/9bbcad05d6ff6634ee0caaa1e57add914b1adda5/third_party/blink/renderer/modules/animationworklet/animator.cc
[modify] https://crrev.com/9bbcad05d6ff6634ee0caaa1e57add914b1adda5/third_party/blink/renderer/modules/animationworklet/animator.h

Comment 3 by yigu@chromium.org, Jun 14 2018

Cc: -yigu@chromium.org
Owner: yigu@chromium.org
Status: Fixed (was: Available)

Sign in to add a comment