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

Side by Side Diff: webkit/compositor_bindings/web_transform_animation_curve_impl.cc

Issue 11644004: Only create instances of WebTransformOperations using cc::TransformOperations::Create (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase, and fix WebTransformAnimationCurveImpl Created 8 years 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "web_transform_animation_curve_impl.h" 5 #include "web_transform_animation_curve_impl.h"
6 6
7 #include "cc/keyframed_animation_curve.h" 7 #include "cc/keyframed_animation_curve.h"
8 #include "cc/timing_function.h" 8 #include "cc/timing_function.h"
9 #include "web_animation_curve_common.h" 9 #include "web_animation_curve_common.h"
10 10
(...skipping 13 matching lines...) Expand all
24 return WebAnimationCurve::AnimationCurveTypeTransform; 24 return WebAnimationCurve::AnimationCurveTypeTransform;
25 } 25 }
26 26
27 void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe) 27 void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe)
28 { 28 {
29 add(keyframe, TimingFunctionTypeEase); 29 add(keyframe, TimingFunctionTypeEase);
30 } 30 }
31 31
32 void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe, T imingFunctionType type) 32 void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe, T imingFunctionType type)
33 { 33 {
34 #ifdef WEBKIT_WEB_TRANSFORM_OPERATIONS_USE_CREATE
35 m_curve->addKeyframe(cc::TransformKeyframe::create(keyframe.time(), keyframe .value(), createTimingFunction(type)));
ajuma 2012/12/20 16:48:11 WebTransformKeyframe will no longer be able to dir
36 #else
34 m_curve->addKeyframe(cc::TransformKeyframe::create(keyframe.time, keyframe.v alue, createTimingFunction(type))); 37 m_curve->addKeyframe(cc::TransformKeyframe::create(keyframe.time, keyframe.v alue, createTimingFunction(type)));
38 #endif
35 } 39 }
36 40
37 void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe, d ouble x1, double y1, double x2, double y2) 41 void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe, d ouble x1, double y1, double x2, double y2)
38 { 42 {
43 #ifdef WEBKIT_WEB_TRANSFORM_OPERATIONS_USE_CREATE
44 m_curve->addKeyframe(cc::TransformKeyframe::create(keyframe.time(), keyframe .value(), cc::CubicBezierTimingFunction::create(x1, y1, x2, y2).PassAs<cc::Timin gFunction>()));
45 #else
39 m_curve->addKeyframe(cc::TransformKeyframe::create(keyframe.time, keyframe.v alue, cc::CubicBezierTimingFunction::create(x1, y1, x2, y2).PassAs<cc::TimingFun ction>())); 46 m_curve->addKeyframe(cc::TransformKeyframe::create(keyframe.time, keyframe.v alue, cc::CubicBezierTimingFunction::create(x1, y1, x2, y2).PassAs<cc::TimingFun ction>()));
47 #endif
40 } 48 }
41 49
42 WebTransformationMatrix WebTransformAnimationCurveImpl::getValue(double time) co nst 50 WebTransformationMatrix WebTransformAnimationCurveImpl::getValue(double time) co nst
43 { 51 {
44 return m_curve->getValue(time); 52 return m_curve->getValue(time);
45 } 53 }
46 54
47 scoped_ptr<cc::AnimationCurve> WebTransformAnimationCurveImpl::cloneToAnimationC urve() const 55 scoped_ptr<cc::AnimationCurve> WebTransformAnimationCurveImpl::cloneToAnimationC urve() const
48 { 56 {
49 return m_curve->clone(); 57 return m_curve->clone();
50 } 58 }
51 59
52 } // namespace WebKit 60 } // namespace WebKit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698