| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CompositorFloatAnimationCurve_h | 5 #ifndef CompositorFloatAnimationCurve_h |
| 6 #define CompositorFloatAnimationCurve_h | 6 #define CompositorFloatAnimationCurve_h |
| 7 | 7 |
| 8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
| 9 #include "platform/animation/CompositorAnimationCurve.h" | 9 #include "platform/animation/CompositorAnimationCurve.h" |
| 10 #include "platform/animation/CompositorFloatKeyframe.h" | 10 #include "platform/animation/CompositorFloatKeyframe.h" |
| 11 #include "platform/animation/TimingFunction.h" | 11 #include "platform/animation/TimingFunction.h" |
| 12 #include "wtf/Noncopyable.h" | 12 #include "wtf/Noncopyable.h" |
| 13 #include "wtf/Vector.h" | 13 #include "wtf/Vector.h" |
| 14 #include <memory> |
| 14 | 15 |
| 15 namespace cc { | 16 namespace cc { |
| 16 class KeyframedFloatAnimationCurve; | 17 class KeyframedFloatAnimationCurve; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace blink { | 20 namespace blink { |
| 20 struct CompositorFloatKeyframe; | 21 struct CompositorFloatKeyframe; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace blink { | 24 namespace blink { |
| 24 | 25 |
| 25 // A keyframed float animation curve. | 26 // A keyframed float animation curve. |
| 26 class PLATFORM_EXPORT CompositorFloatAnimationCurve : public CompositorAnimation
Curve { | 27 class PLATFORM_EXPORT CompositorFloatAnimationCurve : public CompositorAnimation
Curve { |
| 27 WTF_MAKE_NONCOPYABLE(CompositorFloatAnimationCurve); | 28 WTF_MAKE_NONCOPYABLE(CompositorFloatAnimationCurve); |
| 28 public: | 29 public: |
| 29 CompositorFloatAnimationCurve(); | 30 CompositorFloatAnimationCurve(); |
| 30 ~CompositorFloatAnimationCurve() override; | 31 ~CompositorFloatAnimationCurve() override; |
| 31 | 32 |
| 32 static PassOwnPtr<CompositorFloatAnimationCurve> CreateForTesting(std::uniqu
e_ptr<cc::KeyframedFloatAnimationCurve>); | 33 static std::unique_ptr<CompositorFloatAnimationCurve> CreateForTesting(std::
unique_ptr<cc::KeyframedFloatAnimationCurve>); |
| 33 Vector<CompositorFloatKeyframe> keyframesForTesting() const; | 34 Vector<CompositorFloatKeyframe> keyframesForTesting() const; |
| 34 | 35 |
| 35 // TODO(loyso): Erase these methods once blink/cc timing functions unified. | 36 // TODO(loyso): Erase these methods once blink/cc timing functions unified. |
| 36 CubicBezierTimingFunction::EaseType getCurveEaseTypeForTesting() const; | 37 CubicBezierTimingFunction::EaseType getCurveEaseTypeForTesting() const; |
| 37 bool curveHasLinearTimingFunctionForTesting() const; | 38 bool curveHasLinearTimingFunctionForTesting() const; |
| 38 CubicBezierTimingFunction::EaseType getKeyframeEaseTypeForTesting(unsigned l
ong index) const; | 39 CubicBezierTimingFunction::EaseType getKeyframeEaseTypeForTesting(unsigned l
ong index) const; |
| 39 bool keyframeHasLinearTimingFunctionForTesting(unsigned long index) const; | 40 bool keyframeHasLinearTimingFunctionForTesting(unsigned long index) const; |
| 40 | 41 |
| 41 void addLinearKeyframe(const CompositorFloatKeyframe&); | 42 void addLinearKeyframe(const CompositorFloatKeyframe&); |
| 42 void addCubicBezierKeyframe(const CompositorFloatKeyframe&, CubicBezierTimin
gFunction::EaseType); | 43 void addCubicBezierKeyframe(const CompositorFloatKeyframe&, CubicBezierTimin
gFunction::EaseType); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 57 | 58 |
| 58 private: | 59 private: |
| 59 CompositorFloatAnimationCurve(std::unique_ptr<cc::KeyframedFloatAnimationCur
ve>); | 60 CompositorFloatAnimationCurve(std::unique_ptr<cc::KeyframedFloatAnimationCur
ve>); |
| 60 | 61 |
| 61 std::unique_ptr<cc::KeyframedFloatAnimationCurve> m_curve; | 62 std::unique_ptr<cc::KeyframedFloatAnimationCurve> m_curve; |
| 62 }; | 63 }; |
| 63 | 64 |
| 64 } // namespace blink | 65 } // namespace blink |
| 65 | 66 |
| 66 #endif // CompositorFloatAnimationCurve_h | 67 #endif // CompositorFloatAnimationCurve_h |
| OLD | NEW |