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_COMPOSITOR_TRANSFORM_ANIMATION_CURVE_ADAPTER_H_ | 5 #ifndef UI_COMPOSITOR_TRANSFORM_ANIMATION_CURVE_ADAPTER_H_ |
6 #define UI_COMPOSITOR_TRANSFORM_ANIMATION_CURVE_ADAPTER_H_ | 6 #define UI_COMPOSITOR_TRANSFORM_ANIMATION_CURVE_ADAPTER_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 "base/time/time.h" | 11 #include "base/time/time.h" |
11 #include "cc/animation/animation_curve.h" | 12 #include "cc/animation/animation_curve.h" |
12 #include "ui/compositor/compositor_export.h" | 13 #include "ui/compositor/compositor_export.h" |
13 #include "ui/gfx/animation/tween.h" | 14 #include "ui/gfx/animation/tween.h" |
14 #include "ui/gfx/transform.h" | 15 #include "ui/gfx/transform.h" |
15 #include "ui/gfx/transform_util.h" | 16 #include "ui/gfx/transform_util.h" |
16 | 17 |
17 namespace ui { | 18 namespace ui { |
18 | 19 |
19 class COMPOSITOR_EXPORT TransformAnimationCurveAdapter | 20 class COMPOSITOR_EXPORT TransformAnimationCurveAdapter |
20 : public cc::TransformAnimationCurve { | 21 : public cc::TransformAnimationCurve { |
21 public: | 22 public: |
22 TransformAnimationCurveAdapter(gfx::Tween::Type tween_type, | 23 TransformAnimationCurveAdapter(gfx::Tween::Type tween_type, |
23 gfx::Transform intial_value, | 24 gfx::Transform intial_value, |
24 gfx::Transform target_value, | 25 gfx::Transform target_value, |
25 base::TimeDelta duration); | 26 base::TimeDelta duration); |
26 | 27 |
27 TransformAnimationCurveAdapter(const TransformAnimationCurveAdapter& other); | 28 TransformAnimationCurveAdapter(const TransformAnimationCurveAdapter& other); |
28 | 29 |
29 ~TransformAnimationCurveAdapter() override; | 30 ~TransformAnimationCurveAdapter() override; |
30 | 31 |
31 // TransformAnimationCurve implementation. | 32 // TransformAnimationCurve implementation. |
32 base::TimeDelta Duration() const override; | 33 base::TimeDelta Duration() const override; |
33 scoped_ptr<AnimationCurve> Clone() const override; | 34 std::unique_ptr<AnimationCurve> Clone() const override; |
34 gfx::Transform GetValue(base::TimeDelta t) const override; | 35 gfx::Transform GetValue(base::TimeDelta t) const override; |
35 bool AnimatedBoundsForBox(const gfx::BoxF& box, | 36 bool AnimatedBoundsForBox(const gfx::BoxF& box, |
36 gfx::BoxF* bounds) const override; | 37 gfx::BoxF* bounds) const override; |
37 bool AffectsScale() const override; | 38 bool AffectsScale() const override; |
38 bool IsTranslation() const override; | 39 bool IsTranslation() const override; |
39 bool PreservesAxisAlignment() const override; | 40 bool PreservesAxisAlignment() const override; |
40 bool AnimationStartScale(bool forward_direction, | 41 bool AnimationStartScale(bool forward_direction, |
41 float* start_scale) const override; | 42 float* start_scale) const override; |
42 bool MaximumTargetScale(bool forward_direction, | 43 bool MaximumTargetScale(bool forward_direction, |
43 float* max_scale) const override; | 44 float* max_scale) const override; |
(...skipping 12 matching lines...) Expand all Loading... |
56 class COMPOSITOR_EXPORT InverseTransformCurveAdapter | 57 class COMPOSITOR_EXPORT InverseTransformCurveAdapter |
57 : public cc::TransformAnimationCurve { | 58 : public cc::TransformAnimationCurve { |
58 public: | 59 public: |
59 InverseTransformCurveAdapter(TransformAnimationCurveAdapter base_curve, | 60 InverseTransformCurveAdapter(TransformAnimationCurveAdapter base_curve, |
60 gfx::Transform initial_value, | 61 gfx::Transform initial_value, |
61 base::TimeDelta duration); | 62 base::TimeDelta duration); |
62 | 63 |
63 ~InverseTransformCurveAdapter() override; | 64 ~InverseTransformCurveAdapter() override; |
64 | 65 |
65 base::TimeDelta Duration() const override; | 66 base::TimeDelta Duration() const override; |
66 scoped_ptr<AnimationCurve> Clone() const override; | 67 std::unique_ptr<AnimationCurve> Clone() const override; |
67 gfx::Transform GetValue(base::TimeDelta t) const override; | 68 gfx::Transform GetValue(base::TimeDelta t) const override; |
68 bool AnimatedBoundsForBox(const gfx::BoxF& box, | 69 bool AnimatedBoundsForBox(const gfx::BoxF& box, |
69 gfx::BoxF* bounds) const override; | 70 gfx::BoxF* bounds) const override; |
70 bool AffectsScale() const override; | 71 bool AffectsScale() const override; |
71 bool IsTranslation() const override; | 72 bool IsTranslation() const override; |
72 bool PreservesAxisAlignment() const override; | 73 bool PreservesAxisAlignment() const override; |
73 bool AnimationStartScale(bool forward_direction, | 74 bool AnimationStartScale(bool forward_direction, |
74 float* start_scale) const override; | 75 float* start_scale) const override; |
75 bool MaximumTargetScale(bool forward_direction, | 76 bool MaximumTargetScale(bool forward_direction, |
76 float* max_scale) const override; | 77 float* max_scale) const override; |
77 | 78 |
78 private: | 79 private: |
79 TransformAnimationCurveAdapter base_curve_; | 80 TransformAnimationCurveAdapter base_curve_; |
80 gfx::Transform initial_value_; | 81 gfx::Transform initial_value_; |
81 gfx::Transform effective_initial_value_; | 82 gfx::Transform effective_initial_value_; |
82 base::TimeDelta duration_; | 83 base::TimeDelta duration_; |
83 | 84 |
84 DISALLOW_ASSIGN(InverseTransformCurveAdapter); | 85 DISALLOW_ASSIGN(InverseTransformCurveAdapter); |
85 }; | 86 }; |
86 | 87 |
87 } // namespace ui | 88 } // namespace ui |
88 | 89 |
89 #endif // UI_COMPOSITOR_TRANSFORM_ANIMATION_CURVE_ADAPTER_H_ | 90 #endif // UI_COMPOSITOR_TRANSFORM_ANIMATION_CURVE_ADAPTER_H_ |
90 | 91 |
OLD | NEW |