app_list: Update separator color.
[chromium-blink-merge.git] / cc / CCKeyframedAnimationCurve.h
blob01d0c9b95a0d9073364d894952a6f845fad93d55
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 CCKeyframedAnimationCurve_h
6 #define CCKeyframedAnimationCurve_h
8 #include "CCAnimationCurve.h"
9 #include "CCTimingFunction.h"
10 #include <public/WebTransformOperations.h>
11 #include <wtf/OwnPtr.h>
12 #include <wtf/PassOwnPtr.h>
13 #include <wtf/Vector.h>
15 namespace WebCore {
17 class CCKeyframe {
18 public:
19 double time() const;
20 const CCTimingFunction* timingFunction() const;
22 protected:
23 CCKeyframe(double time, PassOwnPtr<CCTimingFunction>);
24 virtual ~CCKeyframe();
26 private:
27 double m_time;
28 OwnPtr<CCTimingFunction> m_timingFunction;
31 class CCFloatKeyframe : public CCKeyframe {
32 public:
33 static PassOwnPtr<CCFloatKeyframe> create(double time, float value, PassOwnPtr<CCTimingFunction>);
34 virtual ~CCFloatKeyframe();
36 float value() const;
38 PassOwnPtr<CCFloatKeyframe> clone() const;
40 private:
41 CCFloatKeyframe(double time, float value, PassOwnPtr<CCTimingFunction>);
43 float m_value;
46 class CCTransformKeyframe : public CCKeyframe {
47 public:
48 static PassOwnPtr<CCTransformKeyframe> create(double time, const WebKit::WebTransformOperations& value, PassOwnPtr<CCTimingFunction>);
49 virtual ~CCTransformKeyframe();
51 const WebKit::WebTransformOperations& value() const;
53 PassOwnPtr<CCTransformKeyframe> clone() const;
55 private:
56 CCTransformKeyframe(double time, const WebKit::WebTransformOperations& value, PassOwnPtr<CCTimingFunction>);
58 WebKit::WebTransformOperations m_value;
61 class CCKeyframedFloatAnimationCurve : public CCFloatAnimationCurve {
62 public:
63 // It is required that the keyframes be sorted by time.
64 static PassOwnPtr<CCKeyframedFloatAnimationCurve> create();
66 virtual ~CCKeyframedFloatAnimationCurve();
68 void addKeyframe(PassOwnPtr<CCFloatKeyframe>);
70 // CCAnimationCurve implementation
71 virtual double duration() const OVERRIDE;
72 virtual PassOwnPtr<CCAnimationCurve> clone() const OVERRIDE;
74 // CCFloatAnimationCurve implementation
75 virtual float getValue(double t) const OVERRIDE;
77 private:
78 CCKeyframedFloatAnimationCurve();
80 // Always sorted in order of increasing time. No two keyframes have the
81 // same time.
82 Vector<OwnPtr<CCFloatKeyframe> > m_keyframes;
85 class CCKeyframedTransformAnimationCurve : public CCTransformAnimationCurve {
86 public:
87 // It is required that the keyframes be sorted by time.
88 static PassOwnPtr<CCKeyframedTransformAnimationCurve> create();
90 virtual ~CCKeyframedTransformAnimationCurve();
92 void addKeyframe(PassOwnPtr<CCTransformKeyframe>);
94 // CCAnimationCurve implementation
95 virtual double duration() const OVERRIDE;
96 virtual PassOwnPtr<CCAnimationCurve> clone() const OVERRIDE;
98 // CCTransformAnimationCurve implementation
99 virtual WebKit::WebTransformationMatrix getValue(double t) const OVERRIDE;
101 private:
102 CCKeyframedTransformAnimationCurve();
104 // Always sorted in order of increasing time. No two keyframes have the
105 // same time.
106 Vector<OwnPtr<CCTransformKeyframe> > m_keyframes;
109 } // namespace WebCore
111 #endif // CCKeyframedAnimationCurve_h