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" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 namespace blink { | 22 namespace blink { |
23 | 23 |
24 // A keyframed float animation curve. | 24 // A keyframed float animation curve. |
25 class PLATFORM_EXPORT CompositorFloatAnimationCurve : public CompositorAnimation
Curve { | 25 class PLATFORM_EXPORT CompositorFloatAnimationCurve : public CompositorAnimation
Curve { |
26 WTF_MAKE_NONCOPYABLE(CompositorFloatAnimationCurve); | 26 WTF_MAKE_NONCOPYABLE(CompositorFloatAnimationCurve); |
27 public: | 27 public: |
28 CompositorFloatAnimationCurve(); | 28 CompositorFloatAnimationCurve(); |
29 ~CompositorFloatAnimationCurve() override; | 29 ~CompositorFloatAnimationCurve() override; |
30 | 30 |
31 virtual void addLinearKeyframe(const CompositorFloatKeyframe&); | 31 void addLinearKeyframe(const CompositorFloatKeyframe&); |
32 virtual void addCubicBezierKeyframe(const CompositorFloatKeyframe&, CubicBez
ierTimingFunction::EaseType); | 32 void addCubicBezierKeyframe(const CompositorFloatKeyframe&, CubicBezierTimin
gFunction::EaseType); |
33 // Adds the keyframe with a custom, bezier timing function. Note, it is | 33 // Adds the keyframe with a custom, bezier timing function. Note, it is |
34 // assumed that x0 = y0 , and x3 = y3 = 1. | 34 // assumed that x0 = y0 , and x3 = y3 = 1. |
35 virtual void addCubicBezierKeyframe(const CompositorFloatKeyframe&, double x
1, double y1, double x2, double y2); | 35 void addCubicBezierKeyframe(const CompositorFloatKeyframe&, double x1, doubl
e y1, double x2, double y2); |
36 virtual void addStepsKeyframe(const CompositorFloatKeyframe&, int steps, Ste
psTimingFunction::StepPosition); | 36 void addStepsKeyframe(const CompositorFloatKeyframe&, int steps, StepsTiming
Function::StepPosition); |
37 | 37 |
38 virtual void setLinearTimingFunction(); | 38 void setLinearTimingFunction(); |
39 virtual void setCubicBezierTimingFunction(CubicBezierTimingFunction::EaseTyp
e); | 39 void setCubicBezierTimingFunction(CubicBezierTimingFunction::EaseType); |
40 virtual void setCubicBezierTimingFunction(double x1, double y1, double x2, d
ouble y2); | 40 void setCubicBezierTimingFunction(double x1, double y1, double x2, double y2
); |
41 virtual void setStepsTimingFunction(int numberOfSteps, StepsTimingFunction::
StepPosition); | 41 void setStepsTimingFunction(int numberOfSteps, StepsTimingFunction::StepPosi
tion); |
42 | 42 |
43 virtual float getValue(double time) const; | 43 float getValue(double time) const; |
44 | 44 |
45 // CompositorAnimationCurve implementation. | 45 // CompositorAnimationCurve implementation. |
46 std::unique_ptr<cc::AnimationCurve> cloneToAnimationCurve() const override; | 46 std::unique_ptr<cc::AnimationCurve> cloneToAnimationCurve() const override; |
47 | 47 |
48 private: | 48 private: |
49 std::unique_ptr<cc::KeyframedFloatAnimationCurve> m_curve; | 49 std::unique_ptr<cc::KeyframedFloatAnimationCurve> m_curve; |
50 }; | 50 }; |
51 | 51 |
52 } // namespace blink | 52 } // namespace blink |
53 | 53 |
54 #endif // CompositorFloatAnimationCurve_h | 54 #endif // CompositorFloatAnimationCurve_h |
OLD | NEW |