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