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

Side by Side Diff: webkit/compositor_bindings/WebTransformAnimationCurveImpl.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 "WebTransformAnimationCurveImpl.h"
8
9 #include "WebAnimationCurveCommon.h"
10 #include "cc/keyframed_animation_curve.h"
11 #include "cc/timing_function.h"
12
13 namespace WebKit {
14
15 WebTransformAnimationCurve* WebTransformAnimationCurve::create()
16 {
17 return new WebTransformAnimationCurveImpl();
18 }
19
20 WebTransformAnimationCurveImpl::WebTransformAnimationCurveImpl()
21 : m_curve(cc::CCKeyframedTransformAnimationCurve::create())
22 {
23 }
24
25 WebTransformAnimationCurveImpl::~WebTransformAnimationCurveImpl()
26 {
27 }
28
29 WebAnimationCurve::AnimationCurveType WebTransformAnimationCurveImpl::type() con st
30 {
31 return WebAnimationCurve::AnimationCurveTypeTransform;
32 }
33
34 void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe)
35 {
36 add(keyframe, TimingFunctionTypeEase);
37 }
38
39 void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe, T imingFunctionType type)
40 {
41 m_curve->addKeyframe(cc::CCTransformKeyframe::create(keyframe.time, keyframe .value, createTimingFunction(type)));
42 }
43
44 void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe, d ouble x1, double y1, double x2, double y2)
45 {
46 m_curve->addKeyframe(cc::CCTransformKeyframe::create(keyframe.time, keyframe .value, cc::CCCubicBezierTimingFunction::create(x1, y1, x2, y2).PassAs<cc::CCTim ingFunction>()));
47 }
48
49 WebTransformationMatrix WebTransformAnimationCurveImpl::getValue(double time) co nst
50 {
51 return m_curve->getValue(time);
52 }
53
54 scoped_ptr<cc::CCAnimationCurve> WebTransformAnimationCurveImpl::cloneToCCAnimat ionCurve() const
55 {
56 return m_curve->clone();
57 }
58
59 } // namespace WebKit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698