| OLD | NEW |
| 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "web_animation_impl.h" | 7 #include "web_animation_impl.h" |
| 8 | 8 |
| 9 #include "cc/active_animation.h" | 9 #include "cc/active_animation.h" |
| 10 #include "cc/animation_curve.h" | 10 #include "cc/animation_curve.h" |
| 11 #include "third_party/WebKit/Source/Platform/chromium/public/WebAnimationCurve.h
" | 11 #include "third_party/WebKit/Source/Platform/chromium/public/WebAnimationCurve.h
" |
| 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebAnimation.h" | 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebAnimation.h" |
| 13 #include "web_float_animation_curve_impl.h" | 13 #include "web_float_animation_curve_impl.h" |
| 14 #include "web_transform_animation_curve_impl.h" | 14 #include "web_transform_animation_curve_impl.h" |
| 15 | 15 |
| 16 using cc::ActiveAnimation; | 16 using cc::ActiveAnimation; |
| 17 | 17 |
| 18 namespace WebKit { | 18 namespace WebKit { |
| 19 | 19 |
| 20 WebAnimation* WebAnimation::create(const WebAnimationCurve& curve, TargetPropert
y targetProperty, int animationId) | |
| 21 { | |
| 22 return new WebAnimationImpl(curve, targetProperty, animationId, 0); | |
| 23 } | |
| 24 | |
| 25 WebAnimationImpl::WebAnimationImpl(const WebAnimationCurve& webCurve, TargetProp
erty targetProperty, int animationId, int groupId) | 20 WebAnimationImpl::WebAnimationImpl(const WebAnimationCurve& webCurve, TargetProp
erty targetProperty, int animationId, int groupId) |
| 26 { | 21 { |
| 27 static int nextAnimationId = 1; | 22 static int nextAnimationId = 1; |
| 28 static int nextGroupId = 1; | 23 static int nextGroupId = 1; |
| 29 if (!animationId) | 24 if (!animationId) |
| 30 animationId = nextAnimationId++; | 25 animationId = nextAnimationId++; |
| 31 if (!groupId) | 26 if (!groupId) |
| 32 groupId = nextGroupId++; | 27 groupId = nextGroupId++; |
| 33 | 28 |
| 34 WebAnimationCurve::AnimationCurveType curveType = webCurve.type(); | 29 WebAnimationCurve::AnimationCurveType curveType = webCurve.type(); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 } | 98 } |
| 104 | 99 |
| 105 scoped_ptr<cc::ActiveAnimation> WebAnimationImpl::cloneToAnimation() | 100 scoped_ptr<cc::ActiveAnimation> WebAnimationImpl::cloneToAnimation() |
| 106 { | 101 { |
| 107 scoped_ptr<cc::ActiveAnimation> toReturn(m_animation->clone(cc::ActiveAnimat
ion::NonControllingInstance)); | 102 scoped_ptr<cc::ActiveAnimation> toReturn(m_animation->clone(cc::ActiveAnimat
ion::NonControllingInstance)); |
| 108 toReturn->setNeedsSynchronizedStartTime(true); | 103 toReturn->setNeedsSynchronizedStartTime(true); |
| 109 return toReturn.Pass(); | 104 return toReturn.Pass(); |
| 110 } | 105 } |
| 111 | 106 |
| 112 } // namespace WebKit | 107 } // namespace WebKit |
| OLD | NEW |