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

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

Issue 11192050: Rename compositor bindings filenames to Chromium style (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 "WebAnimationCurveCommon.h"
10 #include "cc/animation_curve.h"
11 #include "cc/keyframed_animation_curve.h"
12 #include "cc/timing_function.h"
13
14 namespace WebKit {
15
16 WebFloatAnimationCurve* WebFloatAnimationCurve::create()
17 {
18 return new WebFloatAnimationCurveImpl();
19 }
20
21 WebFloatAnimationCurveImpl::WebFloatAnimationCurveImpl()
22 : m_curve(cc::CCKeyframedFloatAnimationCurve::create())
23 {
24 }
25
26 WebFloatAnimationCurveImpl::~WebFloatAnimationCurveImpl()
27 {
28 }
29
30 WebAnimationCurve::AnimationCurveType WebFloatAnimationCurveImpl::type() const
31 {
32 return WebAnimationCurve::AnimationCurveTypeFloat;
33 }
34
35 void WebFloatAnimationCurveImpl::add(const WebFloatKeyframe& keyframe)
36 {
37 add(keyframe, TimingFunctionTypeEase);
38 }
39
40 void WebFloatAnimationCurveImpl::add(const WebFloatKeyframe& keyframe, TimingFun ctionType type)
41 {
42 m_curve->addKeyframe(cc::CCFloatKeyframe::create(keyframe.time, keyframe.val ue, createTimingFunction(type)));
43 }
44
45 void WebFloatAnimationCurveImpl::add(const WebFloatKeyframe& keyframe, double x1 , double y1, double x2, double y2)
46 {
47 m_curve->addKeyframe(cc::CCFloatKeyframe::create(keyframe.time, keyframe.val ue, cc::CCCubicBezierTimingFunction::create(x1, y1, x2, y2).PassAs<cc::CCTimingF unction>()));
48 }
49
50 float WebFloatAnimationCurveImpl::getValue(double time) const
51 {
52 return m_curve->getValue(time);
53 }
54
55 scoped_ptr<cc::CCAnimationCurve> WebFloatAnimationCurveImpl::cloneToCCAnimationC urve() const
56 {
57 return m_curve->clone();
58 }
59
60 } // namespace WebKit
OLDNEW
« no previous file with comments | « webkit/compositor_bindings/WebFloatAnimationCurveImpl.h ('k') | webkit/compositor_bindings/WebFloatAnimationCurveTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698