| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_GFX_INTERPOLATED_TRANSFORM_H_ | 5 #ifndef UI_GFX_INTERPOLATED_TRANSFORM_H_ |
| 6 #define UI_GFX_INTERPOLATED_TRANSFORM_H_ | 6 #define UI_GFX_INTERPOLATED_TRANSFORM_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "ui/gfx/geometry/point.h" | 11 #include "ui/gfx/geometry/point.h" |
| 11 #include "ui/gfx/geometry/point3_f.h" | 12 #include "ui/gfx/geometry/point3_f.h" |
| 12 #include "ui/gfx/geometry/vector3d_f.h" | 13 #include "ui/gfx/geometry/vector3d_f.h" |
| 13 #include "ui/gfx/transform.h" | 14 #include "ui/gfx/transform.h" |
| 14 #include "ui/gfx/transform_util.h" | 15 #include "ui/gfx/transform_util.h" |
| 15 | 16 |
| 16 namespace ui { | 17 namespace ui { |
| 17 | 18 |
| 18 /////////////////////////////////////////////////////////////////////////////// | 19 /////////////////////////////////////////////////////////////////////////////// |
| 19 // class InterpolatedTransform | 20 // class InterpolatedTransform |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 float end_time() const { return end_time_; } | 65 float end_time() const { return end_time_; } |
| 65 | 66 |
| 66 private: | 67 private: |
| 67 const float start_time_; | 68 const float start_time_; |
| 68 const float end_time_; | 69 const float end_time_; |
| 69 | 70 |
| 70 // The child transform. If you consider an interpolated transform as a | 71 // The child transform. If you consider an interpolated transform as a |
| 71 // function of t. If, without a child, we are f(t), and our child is | 72 // function of t. If, without a child, we are f(t), and our child is |
| 72 // g(t), then with a child we become f'(t) = f(t) * g(t). Using a child | 73 // g(t), then with a child we become f'(t) = f(t) * g(t). Using a child |
| 73 // transform, we can chain collections of transforms together. | 74 // transform, we can chain collections of transforms together. |
| 74 scoped_ptr<InterpolatedTransform> child_; | 75 std::unique_ptr<InterpolatedTransform> child_; |
| 75 | 76 |
| 76 bool reversed_; | 77 bool reversed_; |
| 77 | 78 |
| 78 DISALLOW_COPY_AND_ASSIGN(InterpolatedTransform); | 79 DISALLOW_COPY_AND_ASSIGN(InterpolatedTransform); |
| 79 }; | 80 }; |
| 80 | 81 |
| 81 /////////////////////////////////////////////////////////////////////////////// | 82 /////////////////////////////////////////////////////////////////////////////// |
| 82 // class InterpolatedRotation | 83 // class InterpolatedRotation |
| 83 // | 84 // |
| 84 // Represents an animated rotation. | 85 // Represents an animated rotation. |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 float start_time, | 232 float start_time, |
| 232 float end_time); | 233 float end_time); |
| 233 ~InterpolatedTransformAboutPivot() override; | 234 ~InterpolatedTransformAboutPivot() override; |
| 234 | 235 |
| 235 protected: | 236 protected: |
| 236 gfx::Transform InterpolateButDoNotCompose(float t) const override; | 237 gfx::Transform InterpolateButDoNotCompose(float t) const override; |
| 237 | 238 |
| 238 private: | 239 private: |
| 239 void Init(const gfx::Point& pivot, InterpolatedTransform* transform); | 240 void Init(const gfx::Point& pivot, InterpolatedTransform* transform); |
| 240 | 241 |
| 241 scoped_ptr<InterpolatedTransform> transform_; | 242 std::unique_ptr<InterpolatedTransform> transform_; |
| 242 | 243 |
| 243 DISALLOW_COPY_AND_ASSIGN(InterpolatedTransformAboutPivot); | 244 DISALLOW_COPY_AND_ASSIGN(InterpolatedTransformAboutPivot); |
| 244 }; | 245 }; |
| 245 | 246 |
| 246 class GFX_EXPORT InterpolatedMatrixTransform : public InterpolatedTransform { | 247 class GFX_EXPORT InterpolatedMatrixTransform : public InterpolatedTransform { |
| 247 public: | 248 public: |
| 248 InterpolatedMatrixTransform(const gfx::Transform& start_transform, | 249 InterpolatedMatrixTransform(const gfx::Transform& start_transform, |
| 249 const gfx::Transform& end_transform); | 250 const gfx::Transform& end_transform); |
| 250 | 251 |
| 251 InterpolatedMatrixTransform(const gfx::Transform& start_transform, | 252 InterpolatedMatrixTransform(const gfx::Transform& start_transform, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 262 void Init(const gfx::Transform& start_transform, | 263 void Init(const gfx::Transform& start_transform, |
| 263 const gfx::Transform& end_transform); | 264 const gfx::Transform& end_transform); |
| 264 | 265 |
| 265 gfx::DecomposedTransform start_decomp_; | 266 gfx::DecomposedTransform start_decomp_; |
| 266 gfx::DecomposedTransform end_decomp_; | 267 gfx::DecomposedTransform end_decomp_; |
| 267 }; | 268 }; |
| 268 | 269 |
| 269 } // namespace ui | 270 } // namespace ui |
| 270 | 271 |
| 271 #endif // UI_GFX_INTERPOLATED_TRANSFORM_H_ | 272 #endif // UI_GFX_INTERPOLATED_TRANSFORM_H_ |
| OLD | NEW |