| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/message_loop.h" | 5 #include "base/message_loop.h" |
| 6 #include "chrome/common/animation.h" | 6 #include "chrome/common/animation.h" |
| 7 | 7 |
| 8 using base::TimeDelta; |
| 9 |
| 8 Animation::Animation(int frame_rate, | 10 Animation::Animation(int frame_rate, |
| 9 AnimationDelegate* delegate) | 11 AnimationDelegate* delegate) |
| 10 : animating_(false), | 12 : animating_(false), |
| 11 frame_rate_(frame_rate), | 13 frame_rate_(frame_rate), |
| 12 timer_interval_(CalculateInterval(frame_rate)), | 14 timer_interval_(CalculateInterval(frame_rate)), |
| 13 duration_(0), | 15 duration_(0), |
| 14 iteration_count_(0), | 16 iteration_count_(0), |
| 15 current_iteration_(0), | 17 current_iteration_(0), |
| 16 state_(0.0), | 18 state_(0.0), |
| 17 delegate_(delegate) { | 19 delegate_(delegate) { |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 Stop(); | 111 Stop(); |
| 110 } | 112 } |
| 111 | 113 |
| 112 int Animation::CalculateInterval(int frame_rate) { | 114 int Animation::CalculateInterval(int frame_rate) { |
| 113 int timer_interval = 1000 / frame_rate; | 115 int timer_interval = 1000 / frame_rate; |
| 114 if (timer_interval < 10) | 116 if (timer_interval < 10) |
| 115 timer_interval = 10; | 117 timer_interval = 10; |
| 116 return timer_interval; | 118 return timer_interval; |
| 117 } | 119 } |
| 118 | 120 |
| OLD | NEW |