1 // Copyright 2012 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.
5 #ifndef CC_TIMING_FUNCTION_H_
6 #define CC_TIMING_FUNCTION_H_
8 #include "cc/animation_curve.h"
9 #include "cc/cc_export.h"
10 #include "third_party/skia/include/core/SkScalar.h"
14 // See http://www.w3.org/TR/css3-transitions/.
15 class CC_EXPORT TimingFunction
: public FloatAnimationCurve
{
17 virtual ~TimingFunction();
19 // Partial implementation of FloatAnimationCurve.
20 virtual double duration() const OVERRIDE
;
26 class CC_EXPORT CubicBezierTimingFunction
: public TimingFunction
{
28 static scoped_ptr
<CubicBezierTimingFunction
> create(double x1
, double y1
,
29 double x2
, double y2
);
30 virtual ~CubicBezierTimingFunction();
32 // Partial implementation of FloatAnimationCurve.
33 virtual float getValue(double time
) const OVERRIDE
;
34 virtual scoped_ptr
<AnimationCurve
> clone() const OVERRIDE
;
37 CubicBezierTimingFunction(double x1
, double y1
, double x2
, double y2
);
45 class CC_EXPORT EaseTimingFunction
{
47 static scoped_ptr
<TimingFunction
> create();
50 class CC_EXPORT EaseInTimingFunction
{
52 static scoped_ptr
<TimingFunction
> create();
55 class CC_EXPORT EaseOutTimingFunction
{
57 static scoped_ptr
<TimingFunction
> create();
60 class CC_EXPORT EaseInOutTimingFunction
{
62 static scoped_ptr
<TimingFunction
> create();
67 #endif // CC_TIMING_FUNCTION_H_