diff options
author | ymalik <ymalik@chromium.org> | 2016-02-29 23:32:07 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-01 07:33:37 +0000 |
commit | 6581bb3e791018e48d078a910ddfdce19a1c10bb (patch) | |
tree | 4ecb54dae2af25a8af24515c9914ef6098c8cf2b /cc/animation/animation.h | |
parent | 1b2d1c9f119d12e861e202f39353cc5fb33f982a (diff) | |
download | chromium_src-6581bb3e791018e48d078a910ddfdce19a1c10bb.zip chromium_src-6581bb3e791018e48d078a910ddfdce19a1c10bb.tar.gz chromium_src-6581bb3e791018e48d078a910ddfdce19a1c10bb.tar.bz2 |
Share animations from compositor to main thread.
This CL introduces a new state that a compositor animation can be in, namely,
ABORT_BUT_NEEDS_COMPLETION. When a main thread scrolling reason is added,
the current scroll offset animation is put into this state. The layer animation
controller looks for impl-only animations in this state and passes a TAKEOVER
animation event to the main thread with the animation_curve. The main thread
then completes the animation.
Notes:
- This CL is for impl only animations, i.e, the jidder bug won't be fixed for an
animation running on cc that was initiated by the main thread (keyboard scroll).
Future CL will add the takeover logic for MT-initiated animations.
- This CL doesn't support the takeover notification from the old animation path.
The old path is where we don't use CompositorAnimationPlayer and its better
to not add the plumbing for something that will be removed soon anyway.
Design-doc
https://docs.google.com/a/google.com/document/d/1JUYvp5gilux7bca8vfmE4Rr5BUjSthizmz7g4BnOnBA/edit?usp=sharing
Test page:
http://philipwalton.github.io/polyfill/demos/position-sticky/
BUG=581875
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1734063003
Cr-Commit-Position: refs/heads/master@{#378411}
Diffstat (limited to 'cc/animation/animation.h')
-rw-r--r-- | cc/animation/animation.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cc/animation/animation.h b/cc/animation/animation.h index 645b71f..c146322 100644 --- a/cc/animation/animation.h +++ b/cc/animation/animation.h @@ -27,7 +27,10 @@ class CC_EXPORT Animation { // the STARTING state, and then into the RUNNING state. RUNNING animations may // toggle between RUNNING and PAUSED, and may be stopped by moving into either // the ABORTED or FINISHED states. A FINISHED animation was allowed to run to - // completion, but an ABORTED animation was not. + // completion, but an ABORTED animation was not. An animation in the state + // ABORTED_BUT_NEEDS_COMPLETION is an animation that was aborted for + // some reason, but needs to be finished. Currently this is for impl-only + // scroll offset animations that need to be completed on the main thread. enum RunState { WAITING_FOR_TARGET_AVAILABILITY = 0, WAITING_FOR_DELETION, @@ -36,8 +39,9 @@ class CC_EXPORT Animation { PAUSED, FINISHED, ABORTED, + ABORTED_BUT_NEEDS_COMPLETION, // This sentinel must be last. - LAST_RUN_STATE = ABORTED + LAST_RUN_STATE = ABORTED_BUT_NEEDS_COMPLETION }; enum Direction { |