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 CompositorTransformAnimationCurve_h | 5 #ifndef CompositorTransformAnimationCurve_h |
6 #define CompositorTransformAnimationCurve_h | 6 #define CompositorTransformAnimationCurve_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/CompositorTransformKeyframe.h" | 10 #include "platform/animation/CompositorTransformKeyframe.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 namespace blink { | 22 namespace blink { |
23 | 23 |
24 // A keyframed transform animation curve. | 24 // A keyframed transform animation curve. |
25 class PLATFORM_EXPORT CompositorTransformAnimationCurve : public CompositorAnima
tionCurve { | 25 class PLATFORM_EXPORT CompositorTransformAnimationCurve : public CompositorAnima
tionCurve { |
26 WTF_MAKE_NONCOPYABLE(CompositorTransformAnimationCurve); | 26 WTF_MAKE_NONCOPYABLE(CompositorTransformAnimationCurve); |
27 public: | 27 public: |
28 CompositorTransformAnimationCurve(); | 28 CompositorTransformAnimationCurve(); |
29 ~CompositorTransformAnimationCurve() override; | 29 ~CompositorTransformAnimationCurve() override; |
30 | 30 |
31 virtual void addLinearKeyframe(const CompositorTransformKeyframe&); | 31 void addLinearKeyframe(const CompositorTransformKeyframe&); |
32 virtual void addCubicBezierKeyframe(const CompositorTransformKeyframe&, Cubi
cBezierTimingFunction::EaseType); | 32 void addCubicBezierKeyframe(const CompositorTransformKeyframe&, CubicBezierT
imingFunction::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 CompositorTransformKeyframe&, doub
le x1, double y1, double x2, double y2); | 35 void addCubicBezierKeyframe(const CompositorTransformKeyframe&, double x1, d
ouble y1, double x2, double y2); |
36 virtual void addStepsKeyframe(const CompositorTransformKeyframe&, int steps,
StepsTimingFunction::StepPosition); | 36 void addStepsKeyframe(const CompositorTransformKeyframe&, int steps, StepsTi
mingFunction::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 // CompositorAnimationCurve implementation. | 43 // CompositorAnimationCurve implementation. |
44 std::unique_ptr<cc::AnimationCurve> cloneToAnimationCurve() const override; | 44 std::unique_ptr<cc::AnimationCurve> cloneToAnimationCurve() const override; |
45 | 45 |
46 private: | 46 private: |
47 std::unique_ptr<cc::KeyframedTransformAnimationCurve> m_curve; | 47 std::unique_ptr<cc::KeyframedTransformAnimationCurve> m_curve; |
48 }; | 48 }; |
49 | 49 |
50 } // namespace blink | 50 } // namespace blink |
51 | 51 |
52 #endif // CompositorTransformAnimationCurve_h | 52 #endif // CompositorTransformAnimationCurve_h |
OLD | NEW |