Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Side by Side Diff: webkit/compositor/WebFloatAnimationCurveImpl.cpp

Issue 10920056: Make cc_unittests and webkit_compositor_unittests executable always (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename to webkit_compositor_bindings Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #include "config.h"
6
7 #include "WebFloatAnimationCurveImpl.h"
8
9 #include "CCAnimationCurve.h"
10 #include "CCKeyframedAnimationCurve.h"
11 #include "CCTimingFunction.h"
12 #include "WebAnimationCurveCommon.h"
13 #include <wtf/OwnPtr.h>
14 #include <wtf/PassOwnPtr.h>
15
16 namespace WebKit {
17
18 WebFloatAnimationCurve* WebFloatAnimationCurve::create()
19 {
20 return new WebFloatAnimationCurveImpl();
21 }
22
23 WebFloatAnimationCurveImpl::WebFloatAnimationCurveImpl()
24 : m_curve(WebCore::CCKeyframedFloatAnimationCurve::create())
25 {
26 }
27
28 WebFloatAnimationCurveImpl::~WebFloatAnimationCurveImpl()
29 {
30 }
31
32 WebAnimationCurve::AnimationCurveType WebFloatAnimationCurveImpl::type() const
33 {
34 return WebAnimationCurve::AnimationCurveTypeFloat;
35 }
36
37 void WebFloatAnimationCurveImpl::add(const WebFloatKeyframe& keyframe)
38 {
39 add(keyframe, TimingFunctionTypeEase);
40 }
41
42 void WebFloatAnimationCurveImpl::add(const WebFloatKeyframe& keyframe, TimingFun ctionType type)
43 {
44 m_curve->addKeyframe(WebCore::CCFloatKeyframe::create(keyframe.time, keyfram e.value, createTimingFunction(type)));
45 }
46
47 void WebFloatAnimationCurveImpl::add(const WebFloatKeyframe& keyframe, double x1 , double y1, double x2, double y2)
48 {
49 m_curve->addKeyframe(WebCore::CCFloatKeyframe::create(keyframe.time, keyfram e.value, WebCore::CCCubicBezierTimingFunction::create(x1, y1, x2, y2)));
50 }
51
52 float WebFloatAnimationCurveImpl::getValue(double time) const
53 {
54 return m_curve->getValue(time);
55 }
56
57 PassOwnPtr<WebCore::CCAnimationCurve> WebFloatAnimationCurveImpl::cloneToCCAnima tionCurve() const
58 {
59 return m_curve->clone();
60 }
61
62 } // namespace WebKit
OLDNEW
« no previous file with comments | « webkit/compositor/WebFloatAnimationCurveImpl.h ('k') | webkit/compositor/WebFloatAnimationCurveTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698