The lifetime of a newly started cc::Animation is roughly the following:
element_id
if one does not already exist. This ElementAnimations instance is shared by all animations with the same target.element_id
is pushed by cc::KeyframeEffect::PushPropertiesTo cc::AnimationHost::RegisterAnimationForElement creates a compositor side cc::ElementAnimations instance. Since animations are pushed after the layer and property trees, the element should already exist on the pending tree. This will result in the animation being added to the ticking animations list.The purpose of AnimationEvents (cc::AnimationEvent, not to confused with blink::AnimationEvent) is to synchronize animation state from cc::Animation to its client. The typical life cycle of the events is:
There is a special type of event called impl_only events. These are generated by Animations that don't have a counterpart on the MAIN thread. These events are not passed to the MAIN thread and skip the dispatch stage. They are delegated to the cc::AnimationDelegate immediately from the IMPL thread.
TODO(flackr): Document finishing / cancel / abort.
TODO(smcgruer): Write this.
The blink/animations README contains comprehensive documentation about how Blink animations work and integrate with CC animations.
The Compositor Property Trees talk slides includes discussion on compositor animations.
The Project Heaviside design document and slides provide history on the Chromium and Blink animation system. The slides in particular include helpful software architecture diagrams.
Smooth scrolling is implemented via animations. See also references to “scroll offset” animations in the cc code base. Smooth Scrolling in Chromium provides an overview of smooth scrolling. There is further class header documentation in Blink's platform/scroll directory.