OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 CC_ANIMATION_ANIMATION_CURVE_H_ | 5 #ifndef CC_ANIMATION_ANIMATION_CURVE_H_ |
6 #define CC_ANIMATION_ANIMATION_CURVE_H_ | 6 #define CC_ANIMATION_ANIMATION_CURVE_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
10 #include "cc/output/filter_operations.h" | 10 #include "cc/output/filter_operations.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // returns false. | 74 // returns false. |
75 virtual bool AnimatedBoundsForBox(const gfx::BoxF& box, | 75 virtual bool AnimatedBoundsForBox(const gfx::BoxF& box, |
76 gfx::BoxF* bounds) const = 0; | 76 gfx::BoxF* bounds) const = 0; |
77 | 77 |
78 // Returns true if this animation affects scale. | 78 // Returns true if this animation affects scale. |
79 virtual bool AffectsScale() const = 0; | 79 virtual bool AffectsScale() const = 0; |
80 | 80 |
81 // Returns true if this animation is a translation. | 81 // Returns true if this animation is a translation. |
82 virtual bool IsTranslation() const = 0; | 82 virtual bool IsTranslation() const = 0; |
83 | 83 |
84 // Set |max_scale| to the maximum scale along any dimension during this | 84 // Set |max_scale| to the maximum scale along any dimension at the end of |
85 // animation. Returns false if the maximum scale cannot be computed. | 85 // intermediate animation target points (eg keyframe end points). When |
86 virtual bool MaximumScale(float* max_scale) const = 0; | 86 // |forward_direction| is true, the animation curve assumes it plays from |
| 87 // the first keyframe to the last, otherwise it assumes the opposite. Returns |
| 88 // false if the maximum scale cannot be computed. |
| 89 virtual bool MaximumTargetScale(bool forward_direction, |
| 90 float* max_scale) const = 0; |
87 | 91 |
88 // Partial Animation implementation. | 92 // Partial Animation implementation. |
89 virtual CurveType Type() const override; | 93 virtual CurveType Type() const override; |
90 }; | 94 }; |
91 | 95 |
92 class CC_EXPORT FilterAnimationCurve : public AnimationCurve { | 96 class CC_EXPORT FilterAnimationCurve : public AnimationCurve { |
93 public: | 97 public: |
94 virtual ~FilterAnimationCurve() {} | 98 virtual ~FilterAnimationCurve() {} |
95 | 99 |
96 virtual FilterOperations GetValue(double t) const = 0; | 100 virtual FilterOperations GetValue(double t) const = 0; |
97 virtual bool HasFilterThatMovesPixels() const = 0; | 101 virtual bool HasFilterThatMovesPixels() const = 0; |
98 | 102 |
99 // Partial Animation implementation. | 103 // Partial Animation implementation. |
100 virtual CurveType Type() const override; | 104 virtual CurveType Type() const override; |
101 }; | 105 }; |
102 | 106 |
103 } // namespace cc | 107 } // namespace cc |
104 | 108 |
105 #endif // CC_ANIMATION_ANIMATION_CURVE_H_ | 109 #endif // CC_ANIMATION_ANIMATION_CURVE_H_ |
OLD | NEW |