OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CompositorTransformAnimationCurve_h |
| 6 #define CompositorTransformAnimationCurve_h |
| 7 |
| 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "platform/PlatformExport.h" |
| 10 #include "platform/animation/CompositorAnimationCurve.h" |
| 11 #include "platform/animation/CompositorTransformKeyframe.h" |
| 12 #include "wtf/Noncopyable.h" |
| 13 |
| 14 namespace cc { |
| 15 class AnimationCurve; |
| 16 class KeyframedTransformAnimationCurve; |
| 17 } |
| 18 |
| 19 namespace blink { |
| 20 class CompositorTransformKeyframe; |
| 21 } |
| 22 |
| 23 namespace blink { |
| 24 |
| 25 // A keyframed transform animation curve. |
| 26 class PLATFORM_EXPORT CompositorTransformAnimationCurve : public CompositorAnima
tionCurve { |
| 27 WTF_MAKE_NONCOPYABLE(CompositorTransformAnimationCurve); |
| 28 public: |
| 29 CompositorTransformAnimationCurve(); |
| 30 ~CompositorTransformAnimationCurve() override; |
| 31 |
| 32 // Adds the keyframe with the default timing function (ease). |
| 33 virtual void add(const CompositorTransformKeyframe&); |
| 34 virtual void add(const CompositorTransformKeyframe&, TimingFunctionType); |
| 35 // Adds the keyframe with a custom, bezier timing function. Note, it is |
| 36 // assumed that x0 = y0, and x3 = y3 = 1. |
| 37 virtual void add(const CompositorTransformKeyframe&, double x1, double y1, d
ouble x2, double y2); |
| 38 // Adds the keyframe with a steps timing function. |
| 39 virtual void add(const CompositorTransformKeyframe&, int steps, float stepsS
tartOffset); |
| 40 |
| 41 virtual void setLinearTimingFunction(); |
| 42 virtual void setCubicBezierTimingFunction(TimingFunctionType); |
| 43 virtual void setCubicBezierTimingFunction(double x1, double y1, double x2, d
ouble y2); |
| 44 virtual void setStepsTimingFunction(int numberOfSteps, float stepsStartOffse
t); |
| 45 |
| 46 // CompositorAnimationCurve implementation. |
| 47 AnimationCurveType type() const override; |
| 48 |
| 49 scoped_ptr<cc::AnimationCurve> cloneToAnimationCurve() const; |
| 50 |
| 51 private: |
| 52 scoped_ptr<cc::KeyframedTransformAnimationCurve> m_curve; |
| 53 }; |
| 54 |
| 55 } // namespace blink |
| 56 |
| 57 #endif // CompositorTransformAnimationCurve_h |
OLD | NEW |