Index: ui/gfx/animation/linear_animation.cc |
diff --git a/ui/gfx/animation/linear_animation.cc b/ui/gfx/animation/linear_animation.cc |
index 7c7327958b2ce2abe61dd5f429667904214b475b..28c338d670ee3890ec2e859439859e5fabdae5f5 100644 |
--- a/ui/gfx/animation/linear_animation.cc |
+++ b/ui/gfx/animation/linear_animation.cc |
@@ -17,6 +17,9 @@ using base::TimeDelta; |
namespace gfx { |
+// How many frames per second to target. |
+static const int kDefaultFrameRateHz = 60; |
+ |
static TimeDelta CalculateInterval(int frame_rate) { |
int timer_interval = 1000000 / frame_rate; |
if (timer_interval < 10000) |
@@ -24,19 +27,16 @@ static TimeDelta CalculateInterval(int frame_rate) { |
return TimeDelta::FromMicroseconds(timer_interval); |
} |
-LinearAnimation::LinearAnimation(int frame_rate, |
- AnimationDelegate* delegate) |
- : Animation(CalculateInterval(frame_rate)), |
- state_(0.0), |
- in_end_(false) { |
- set_delegate(delegate); |
-} |
+LinearAnimation::LinearAnimation(int frame_rate, AnimationDelegate* delegate) |
+ : LinearAnimation(0, frame_rate, delegate) {} |
+ |
+LinearAnimation::LinearAnimation(AnimationDelegate* delegate) |
+ : LinearAnimation(kDefaultFrameRateHz, delegate) {} |
LinearAnimation::LinearAnimation(int duration, |
int frame_rate, |
AnimationDelegate* delegate) |
: Animation(CalculateInterval(frame_rate)), |
- duration_(TimeDelta::FromMilliseconds(duration)), |
state_(0.0), |
in_end_(false) { |
set_delegate(delegate); |