| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "cc/animation/animation_export.h" | 11 #include "cc/animation/animation_export.h" |
| 12 #include "cc/base/filter_operations.h" | 12 #include "cc/base/filter_operations.h" |
| 13 #include "ui/gfx/geometry/size_f.h" | 13 #include "ui/gfx/geometry/size_f.h" |
| 14 #include "ui/gfx/transform.h" | 14 #include "ui/gfx/transform.h" |
| 15 | 15 |
| 16 namespace gfx { | 16 namespace gfx { |
| 17 class BoxF; | 17 class BoxF; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace cc { | 20 namespace cc { |
| 21 | 21 |
| 22 class ColorAnimationCurve; | 22 class ColorAnimationCurve; |
| 23 class FilterAnimationCurve; | 23 class FilterAnimationCurve; |
| 24 class FloatAnimationCurve; | 24 class FloatAnimationCurve; |
| 25 class ScrollOffsetAnimationCurve; | 25 class ScrollOffsetAnimationCurve; |
| 26 class SizeAnimationCurve; | 26 class SizeAnimationCurve; |
| 27 class TransformAnimationCurve; | 27 class TransformAnimationCurve; |
| 28 class TransformOperations; |
| 28 | 29 |
| 29 // An animation curve is a function that returns a value given a time. | 30 // An animation curve is a function that returns a value given a time. |
| 30 class CC_ANIMATION_EXPORT AnimationCurve { | 31 class CC_ANIMATION_EXPORT AnimationCurve { |
| 31 public: | 32 public: |
| 32 enum CurveType { COLOR, FLOAT, TRANSFORM, FILTER, SCROLL_OFFSET, SIZE }; | 33 enum CurveType { COLOR, FLOAT, TRANSFORM, FILTER, SCROLL_OFFSET, SIZE }; |
| 33 | 34 |
| 34 virtual ~AnimationCurve() {} | 35 virtual ~AnimationCurve() {} |
| 35 | 36 |
| 36 virtual base::TimeDelta Duration() const = 0; | 37 virtual base::TimeDelta Duration() const = 0; |
| 37 virtual CurveType Type() const = 0; | 38 virtual CurveType Type() const = 0; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 64 virtual float GetValue(base::TimeDelta t) const = 0; | 65 virtual float GetValue(base::TimeDelta t) const = 0; |
| 65 | 66 |
| 66 // Partial Animation implementation. | 67 // Partial Animation implementation. |
| 67 CurveType Type() const override; | 68 CurveType Type() const override; |
| 68 }; | 69 }; |
| 69 | 70 |
| 70 class CC_ANIMATION_EXPORT TransformAnimationCurve : public AnimationCurve { | 71 class CC_ANIMATION_EXPORT TransformAnimationCurve : public AnimationCurve { |
| 71 public: | 72 public: |
| 72 ~TransformAnimationCurve() override {} | 73 ~TransformAnimationCurve() override {} |
| 73 | 74 |
| 74 virtual gfx::Transform GetValue(base::TimeDelta t) const = 0; | 75 virtual TransformOperations GetValue(base::TimeDelta t) const = 0; |
| 75 | 76 |
| 76 // Sets |bounds| to be the bounding box for the region within which |box| | 77 // Sets |bounds| to be the bounding box for the region within which |box| |
| 77 // will move during this animation. If this region cannot be computed, | 78 // will move during this animation. If this region cannot be computed, |
| 78 // returns false. | 79 // returns false. |
| 79 virtual bool AnimatedBoundsForBox(const gfx::BoxF& box, | 80 virtual bool AnimatedBoundsForBox(const gfx::BoxF& box, |
| 80 gfx::BoxF* bounds) const = 0; | 81 gfx::BoxF* bounds) const = 0; |
| 81 | 82 |
| 82 // Returns true if this animation is a translation. | 83 // Returns true if this animation is a translation. |
| 83 virtual bool IsTranslation() const = 0; | 84 virtual bool IsTranslation() const = 0; |
| 84 | 85 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 119 |
| 119 virtual gfx::SizeF GetValue(base::TimeDelta t) const = 0; | 120 virtual gfx::SizeF GetValue(base::TimeDelta t) const = 0; |
| 120 | 121 |
| 121 // Partial Animation implementation. | 122 // Partial Animation implementation. |
| 122 CurveType Type() const override; | 123 CurveType Type() const override; |
| 123 }; | 124 }; |
| 124 | 125 |
| 125 } // namespace cc | 126 } // namespace cc |
| 126 | 127 |
| 127 #endif // CC_ANIMATION_ANIMATION_CURVE_H_ | 128 #endif // CC_ANIMATION_ANIMATION_CURVE_H_ |
| OLD | NEW |