| 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 27 matching lines...) Expand all Loading... |
| 38 const FloatAnimationCurve* ToFloatAnimationCurve() const; | 38 const FloatAnimationCurve* ToFloatAnimationCurve() const; |
| 39 const TransformAnimationCurve* ToTransformAnimationCurve() const; | 39 const TransformAnimationCurve* ToTransformAnimationCurve() const; |
| 40 const FilterAnimationCurve* ToFilterAnimationCurve() const; | 40 const FilterAnimationCurve* ToFilterAnimationCurve() const; |
| 41 const ScrollOffsetAnimationCurve* ToScrollOffsetAnimationCurve() const; | 41 const ScrollOffsetAnimationCurve* ToScrollOffsetAnimationCurve() const; |
| 42 | 42 |
| 43 ScrollOffsetAnimationCurve* ToScrollOffsetAnimationCurve(); | 43 ScrollOffsetAnimationCurve* ToScrollOffsetAnimationCurve(); |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 class CC_EXPORT ColorAnimationCurve : public AnimationCurve { | 46 class CC_EXPORT ColorAnimationCurve : public AnimationCurve { |
| 47 public: | 47 public: |
| 48 virtual ~ColorAnimationCurve() {} | 48 ~ColorAnimationCurve() override {} |
| 49 | 49 |
| 50 virtual SkColor GetValue(double t) const = 0; | 50 virtual SkColor GetValue(double t) const = 0; |
| 51 | 51 |
| 52 // Partial Animation implementation. | 52 // Partial Animation implementation. |
| 53 virtual CurveType Type() const override; | 53 CurveType Type() const override; |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 class CC_EXPORT FloatAnimationCurve : public AnimationCurve { | 56 class CC_EXPORT FloatAnimationCurve : public AnimationCurve { |
| 57 public: | 57 public: |
| 58 virtual ~FloatAnimationCurve() {} | 58 ~FloatAnimationCurve() override {} |
| 59 | 59 |
| 60 virtual float GetValue(double t) const = 0; | 60 virtual float GetValue(double t) const = 0; |
| 61 | 61 |
| 62 // Partial Animation implementation. | 62 // Partial Animation implementation. |
| 63 virtual CurveType Type() const override; | 63 CurveType Type() const override; |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 class CC_EXPORT TransformAnimationCurve : public AnimationCurve { | 66 class CC_EXPORT TransformAnimationCurve : public AnimationCurve { |
| 67 public: | 67 public: |
| 68 virtual ~TransformAnimationCurve() {} | 68 ~TransformAnimationCurve() override {} |
| 69 | 69 |
| 70 virtual gfx::Transform GetValue(double t) const = 0; | 70 virtual gfx::Transform GetValue(double t) const = 0; |
| 71 | 71 |
| 72 // Sets |bounds| to be the bounding box for the region within which |box| | 72 // Sets |bounds| to be the bounding box for the region within which |box| |
| 73 // will move during this animation. If this region cannot be computed, | 73 // will move during this animation. If this region cannot be computed, |
| 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 at the end of | 84 // Set |max_scale| to the maximum scale along any dimension at the end of |
| 85 // intermediate animation target points (eg keyframe end points). When | 85 // intermediate animation target points (eg keyframe end points). When |
| 86 // |forward_direction| is true, the animation curve assumes it plays from | 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 | 87 // the first keyframe to the last, otherwise it assumes the opposite. Returns |
| 88 // false if the maximum scale cannot be computed. | 88 // false if the maximum scale cannot be computed. |
| 89 virtual bool MaximumTargetScale(bool forward_direction, | 89 virtual bool MaximumTargetScale(bool forward_direction, |
| 90 float* max_scale) const = 0; | 90 float* max_scale) const = 0; |
| 91 | 91 |
| 92 // Partial Animation implementation. | 92 // Partial Animation implementation. |
| 93 virtual CurveType Type() const override; | 93 CurveType Type() const override; |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 class CC_EXPORT FilterAnimationCurve : public AnimationCurve { | 96 class CC_EXPORT FilterAnimationCurve : public AnimationCurve { |
| 97 public: | 97 public: |
| 98 virtual ~FilterAnimationCurve() {} | 98 ~FilterAnimationCurve() override {} |
| 99 | 99 |
| 100 virtual FilterOperations GetValue(double t) const = 0; | 100 virtual FilterOperations GetValue(double t) const = 0; |
| 101 virtual bool HasFilterThatMovesPixels() const = 0; | 101 virtual bool HasFilterThatMovesPixels() const = 0; |
| 102 | 102 |
| 103 // Partial Animation implementation. | 103 // Partial Animation implementation. |
| 104 virtual CurveType Type() const override; | 104 CurveType Type() const override; |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 } // namespace cc | 107 } // namespace cc |
| 108 | 108 |
| 109 #endif // CC_ANIMATION_ANIMATION_CURVE_H_ | 109 #endif // CC_ANIMATION_ANIMATION_CURVE_H_ |
| OLD | NEW |