| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 #ifndef CC_INPUT_PAGE_SCALE_ANIMATION_H_ | 5 #ifndef CC_INPUT_PAGE_SCALE_ANIMATION_H_ |
| 6 #define CC_INPUT_PAGE_SCALE_ANIMATION_H_ | 6 #define CC_INPUT_PAGE_SCALE_ANIMATION_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "cc/base/cc_export.h" |
| 11 #include "ui/gfx/size.h" | 12 #include "ui/gfx/size.h" |
| 12 #include "ui/gfx/vector2d_f.h" | 13 #include "ui/gfx/vector2d_f.h" |
| 13 | 14 |
| 14 namespace cc { | 15 namespace cc { |
| 15 | 16 |
| 16 class TimingFunction; | 17 class TimingFunction; |
| 17 | 18 |
| 18 // A small helper class that does the math for zoom animations, primarily for | 19 // A small helper class that does the math for zoom animations, primarily for |
| 19 // double-tap zoom. Initialize it with starting and ending scroll/page scale | 20 // double-tap zoom. Initialize it with starting and ending scroll/page scale |
| 20 // positions and an animation length time, then call ...AtTime() at every frame | 21 // positions and an animation length time, then call ...AtTime() at every frame |
| 21 // to obtain the current interpolated position. The supplied timing function | 22 // to obtain the current interpolated position. The supplied timing function |
| 22 // is used to ease the animation. | 23 // is used to ease the animation. |
| 23 // | 24 // |
| 24 // All sizes and vectors in this class's public methods are in the root scroll | 25 // All sizes and vectors in this class's public methods are in the root scroll |
| 25 // layer's coordinate space. | 26 // layer's coordinate space. |
| 26 class PageScaleAnimation { | 27 class CC_EXPORT PageScaleAnimation { |
| 27 public: | 28 public: |
| 28 // Construct with the state at the beginning of the animation. | 29 // Construct with the state at the beginning of the animation. |
| 29 static scoped_ptr<PageScaleAnimation> Create( | 30 static scoped_ptr<PageScaleAnimation> Create( |
| 30 const gfx::Vector2dF& start_scroll_offset, | 31 const gfx::Vector2dF& start_scroll_offset, |
| 31 float start_page_scale_factor, | 32 float start_page_scale_factor, |
| 32 const gfx::SizeF& viewport_size, | 33 const gfx::SizeF& viewport_size, |
| 33 const gfx::SizeF& root_layer_size, | 34 const gfx::SizeF& root_layer_size, |
| 34 scoped_ptr<TimingFunction> timing_function); | 35 scoped_ptr<TimingFunction> timing_function); |
| 35 | 36 |
| 36 ~PageScaleAnimation(); | 37 ~PageScaleAnimation(); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 base::TimeDelta duration_; | 107 base::TimeDelta duration_; |
| 107 | 108 |
| 108 scoped_ptr<TimingFunction> timing_function_; | 109 scoped_ptr<TimingFunction> timing_function_; |
| 109 | 110 |
| 110 DISALLOW_COPY_AND_ASSIGN(PageScaleAnimation); | 111 DISALLOW_COPY_AND_ASSIGN(PageScaleAnimation); |
| 111 }; | 112 }; |
| 112 | 113 |
| 113 } // namespace cc | 114 } // namespace cc |
| 114 | 115 |
| 115 #endif // CC_INPUT_PAGE_SCALE_ANIMATION_H_ | 116 #endif // CC_INPUT_PAGE_SCALE_ANIMATION_H_ |
| OLD | NEW |