Chromium Code Reviews| Index: cc/input/page_scale_animation.h |
| diff --git a/cc/input/page_scale_animation.h b/cc/input/page_scale_animation.h |
| index c7856e1d0b256abeafa188811e5451dbf4a2eda8..825a0d09c2dcbe524f46532d008f9730c5fddba8 100644 |
| --- a/cc/input/page_scale_animation.h |
| +++ b/cc/input/page_scale_animation.h |
| @@ -7,10 +7,15 @@ |
| #include "base/basictypes.h" |
| #include "base/memory/scoped_ptr.h" |
| +#include "base/time/time.h" |
| #include "ui/gfx/size.h" |
| #include "ui/gfx/vector2d_f.h" |
| namespace cc { |
| + |
| +using base::TimeTicks; |
| +using base::TimeDelta; |
|
ajuma
2014/05/05 15:13:32
Please do not add 'using' to .h files.
Sikugu_
2014/05/07 14:49:07
Done.
|
| + |
| class TimingFunction; |
| // A small helper class that does the math for zoom animations, primarily for |
| @@ -52,19 +57,19 @@ class PageScaleAnimation { |
| // These should be called before the first frame of animation to initialize |
| // the start time. StartAnimation should only be called once after creation. |
| bool IsAnimationStarted() const; |
| - void StartAnimation(double time); |
| + void StartAnimation(base::TimeTicks time); |
| // Call these functions while the animation is in progress to output the |
| // current state. |
| - gfx::Vector2dF ScrollOffsetAtTime(double time) const; |
| - float PageScaleFactorAtTime(double time) const; |
| - bool IsAnimationCompleteAtTime(double time) const; |
| + gfx::Vector2dF ScrollOffsetAtTime(base::TimeTicks time) const; |
| + float PageScaleFactorAtTime(base::TimeTicks time) const; |
| + bool IsAnimationCompleteAtTime(base::TimeTicks time) const; |
| // The following methods return state which is invariant throughout the |
| // course of the animation. |
| - double start_time() const { return start_time_; } |
| - double duration() const { return duration_; } |
| - double end_time() const { return start_time_ + duration_; } |
| + TimeTicks start_time() const { return start_time_; } |
| + TimeDelta duration() const { return duration_; } |
| + TimeTicks end_time() const { return start_time_ + duration_; } |
| gfx::Vector2dF target_scroll_offset() const { return target_scroll_offset_; } |
| float target_page_scale_factor() const { return target_page_scale_factor_; } |
| @@ -82,7 +87,7 @@ class PageScaleAnimation { |
| gfx::SizeF StartViewportSize() const; |
| gfx::SizeF TargetViewportSize() const; |
| - float InterpAtTime(double time) const; |
| + float InterpAtTime(base::TimeTicks time) const; |
| gfx::SizeF ViewportSizeAt(float interp) const; |
| gfx::Vector2dF ScrollOffsetAt(float interp) const; |
| gfx::Vector2dF AnchorAt(float interp) const; |
| @@ -100,8 +105,8 @@ class PageScaleAnimation { |
| gfx::SizeF viewport_size_; |
| gfx::SizeF root_layer_size_; |
| - double start_time_; |
| - double duration_; |
| + TimeTicks start_time_; |
| + TimeDelta duration_; |
| scoped_ptr<TimingFunction> timing_function_; |