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 "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "cc/animation/animation_curve.h" | 9 #include "cc/animation/animation_curve.h" |
10 #include "ui/compositor/compositor_export.h" | 10 #include "ui/compositor/compositor_export.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 virtual ~TransformAnimationCurveAdapter(); | 25 virtual ~TransformAnimationCurveAdapter(); |
26 | 26 |
27 // TransformAnimationCurve implementation. | 27 // TransformAnimationCurve implementation. |
28 virtual double Duration() const override; | 28 virtual double Duration() const override; |
29 virtual scoped_ptr<AnimationCurve> Clone() const override; | 29 virtual scoped_ptr<AnimationCurve> Clone() const override; |
30 virtual gfx::Transform GetValue(double t) const override; | 30 virtual gfx::Transform GetValue(double t) const override; |
31 virtual bool AnimatedBoundsForBox(const gfx::BoxF& box, | 31 virtual bool AnimatedBoundsForBox(const gfx::BoxF& box, |
32 gfx::BoxF* bounds) const override; | 32 gfx::BoxF* bounds) const override; |
33 virtual bool AffectsScale() const override; | 33 virtual bool AffectsScale() const override; |
34 virtual bool IsTranslation() const override; | 34 virtual bool IsTranslation() const override; |
35 virtual bool MaximumScale(float* max_scale) const override; | 35 virtual bool MaximumTargetScale(bool forward_direction, |
| 36 float* max_scale) const override; |
36 | 37 |
37 private: | 38 private: |
38 gfx::Tween::Type tween_type_; | 39 gfx::Tween::Type tween_type_; |
39 gfx::Transform initial_value_; | 40 gfx::Transform initial_value_; |
40 gfx::Transform target_value_; | 41 gfx::Transform target_value_; |
41 gfx::DecomposedTransform decomposed_initial_value_; | 42 gfx::DecomposedTransform decomposed_initial_value_; |
42 gfx::DecomposedTransform decomposed_target_value_; | 43 gfx::DecomposedTransform decomposed_target_value_; |
43 base::TimeDelta duration_; | 44 base::TimeDelta duration_; |
44 | 45 |
45 DISALLOW_ASSIGN(TransformAnimationCurveAdapter); | 46 DISALLOW_ASSIGN(TransformAnimationCurveAdapter); |
46 }; | 47 }; |
47 | 48 |
48 class COMPOSITOR_EXPORT InverseTransformCurveAdapter | 49 class COMPOSITOR_EXPORT InverseTransformCurveAdapter |
49 : public cc::TransformAnimationCurve { | 50 : public cc::TransformAnimationCurve { |
50 public: | 51 public: |
51 InverseTransformCurveAdapter(TransformAnimationCurveAdapter base_curve, | 52 InverseTransformCurveAdapter(TransformAnimationCurveAdapter base_curve, |
52 gfx::Transform initial_value, | 53 gfx::Transform initial_value, |
53 base::TimeDelta duration); | 54 base::TimeDelta duration); |
54 | 55 |
55 virtual ~InverseTransformCurveAdapter(); | 56 virtual ~InverseTransformCurveAdapter(); |
56 | 57 |
57 virtual double Duration() const override; | 58 virtual double Duration() const override; |
58 virtual scoped_ptr<AnimationCurve> Clone() const override; | 59 virtual scoped_ptr<AnimationCurve> Clone() const override; |
59 virtual gfx::Transform GetValue(double t) const override; | 60 virtual gfx::Transform GetValue(double t) const override; |
60 virtual bool AnimatedBoundsForBox(const gfx::BoxF& box, | 61 virtual bool AnimatedBoundsForBox(const gfx::BoxF& box, |
61 gfx::BoxF* bounds) const override; | 62 gfx::BoxF* bounds) const override; |
62 virtual bool AffectsScale() const override; | 63 virtual bool AffectsScale() const override; |
63 virtual bool IsTranslation() const override; | 64 virtual bool IsTranslation() const override; |
64 virtual bool MaximumScale(float* max_scale) const override; | 65 virtual bool MaximumTargetScale(bool forward_direction, |
| 66 float* max_scale) const override; |
65 | 67 |
66 private: | 68 private: |
67 TransformAnimationCurveAdapter base_curve_; | 69 TransformAnimationCurveAdapter base_curve_; |
68 gfx::Transform initial_value_; | 70 gfx::Transform initial_value_; |
69 gfx::Transform effective_initial_value_; | 71 gfx::Transform effective_initial_value_; |
70 base::TimeDelta duration_; | 72 base::TimeDelta duration_; |
71 | 73 |
72 DISALLOW_ASSIGN(InverseTransformCurveAdapter); | 74 DISALLOW_ASSIGN(InverseTransformCurveAdapter); |
73 }; | 75 }; |
74 | 76 |
75 } // namespace ui | 77 } // namespace ui |
76 | 78 |
77 #endif // UI_COMPOSITOR_TRANSFORM_ANIMATION_CURVE_ADAPTER_H_ | 79 #endif // UI_COMPOSITOR_TRANSFORM_ANIMATION_CURVE_ADAPTER_H_ |
78 | 80 |
OLD | NEW |