Chrome animation Mechanism
Animation first needs to create a container for Time Scheduling. Here is the animation container.
This class uses base: repeatingtimer to set settimer, and then calls back
To run ()
Timer _. Start (min_timer_interval _, this, & animationcontainer: Run );
Run ()
{
Elements elements = elements _;
For (elements: const_iterator I = elements. Begin (); I! = Elements. End (); ++ I)
{
// Make sure that the element is valid.
If (elements _. Find (* I )! = Elements _. End ())
{
(* I)-> step (current_time );
}
}
In run, all elements are cyclically called and their step methods are called,
(* I)-> step (current_time );
These elements are specific animation objects, such as linearanimation and multianimation.
In this example, State _ is set based on the proportion of the consumed time to the total time.
Delegate ()-> animationprogressed (this );
A process is complete.
Instance
First, a class needs to inherit the animate: deletegate to have the ability to accept> animationprogressed.
Then, this class needs to be set to an animationcontainer, new, ready-to-use, or
With the time management class, you also need to create a specific animation behavior, such as slideanimation. This class needs to set the container
Then you can call show-> Start-> container. Start-> timer. settimer of animation.
During container. Start, the animation will be added to elements.
Then, ontimer-> container. Run-> element. Step-> delegate.> animationprogressed
I am still not used to writing C ++ in this way. I need so many features and so many combinations. You set me and I set you and it feels messy.
But this is from Google.CodeIt should be of high standards.
Deletgate contains the container and the specific animation. Then, the container and animation are mutually owned and the execution process is also
A large stack call, the actual operation found that this animation is also occupying Resources