diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-03 03:51:39 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-03 03:51:39 +0000 |
commit | d2544cd5b4360b61eca1da74e71a5a1fc0925ef2 (patch) | |
tree | ec38d88ed6b80e5b82664ad1b599ba48a031d386 /app/animation.h | |
parent | 1c5fe5c35c2c6b49ca8af0434eb9447747968f7d (diff) | |
download | chromium_src-d2544cd5b4360b61eca1da74e71a5a1fc0925ef2.zip chromium_src-d2544cd5b4360b61eca1da74e71a5a1fc0925ef2.tar.gz chromium_src-d2544cd5b4360b61eca1da74e71a5a1fc0925ef2.tar.bz2 |
Animations: animate to current time, rather than a set number of frames.
This will cut down on the number of total frames shown for slow animations; should have no effect on fast animations.
This makes the following animations much snappier (as seen on Linux):
- download shelf opening
- bookmark bar opening at large browser width
- new tab animation
BUG=all animation jank bugs
TEST=if you put a Sleep(1000) in an AnimationProgressed callback, you will actually get called back fewer times.
TEST=looked at all the animations I could think of to make sure they still work right.
Review URL: http://codereview.chromium.org/257038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27935 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/animation.h')
-rw-r--r-- | app/animation.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/app/animation.h b/app/animation.h index 811c038..e6877b6 100644 --- a/app/animation.h +++ b/app/animation.h @@ -6,6 +6,7 @@ #ifndef APP_ANIMATION_H_ #define APP_ANIMATION_H_ +#include "base/time.h" #include "base/timer.h" class Animation; @@ -99,20 +100,20 @@ class Animation { virtual void Step(); // Calculates the timer interval from the constructor list. - int CalculateInterval(int frame_rate); + base::TimeDelta CalculateInterval(int frame_rate); // Whether or not we are currently animating. bool animating_; int frame_rate_; - int timer_interval_; - int duration_; + base::TimeDelta timer_interval_; + base::TimeDelta duration_; - // For determining state. - int iteration_count_; - int current_iteration_; + // Current state, on a scale from 0.0 to 1.0. double state_; + base::Time start_time_; + AnimationDelegate* delegate_; base::RepeatingTimer<Animation> timer_; |