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

Side by Side Diff: sky/engine/core/animation/animatable/AnimatableValueKeyframe.cpp

Issue 1229273004: Remove Animations and Transitions. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 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
OLDNEW
(Empty)
1 // Copyright 2014 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 "sky/engine/core/animation/animatable/AnimatableValueKeyframe.h"
6
7 #include "sky/engine/core/animation/LegacyStyleInterpolation.h"
8
9 namespace blink {
10
11 AnimatableValueKeyframe::AnimatableValueKeyframe(const AnimatableValueKeyframe& copyFrom)
12 : Keyframe(copyFrom.m_offset, copyFrom.m_composite, copyFrom.m_easing)
13 {
14 for (PropertyValueMap::const_iterator iter = copyFrom.m_propertyValues.begin (); iter != copyFrom.m_propertyValues.end(); ++iter)
15 setPropertyValue(iter->key, iter->value.get());
16 }
17
18 PropertySet AnimatableValueKeyframe::properties() const
19 {
20 // This is not used in time-critical code, so we probably don't need to
21 // worry about caching this result.
22 PropertySet properties;
23 for (PropertyValueMap::const_iterator iter = m_propertyValues.begin(); iter != m_propertyValues.end(); ++iter)
24 properties.add(*iter.keys());
25 return properties;
26 }
27
28 PassRefPtr<Keyframe> AnimatableValueKeyframe::clone() const
29 {
30 return adoptRef(new AnimatableValueKeyframe(*this));
31 }
32
33 PassOwnPtr<Keyframe::PropertySpecificKeyframe> AnimatableValueKeyframe::createPr opertySpecificKeyframe(CSSPropertyID property) const
34 {
35 return adoptPtr(new PropertySpecificKeyframe(offset(), &easing(), propertyVa lue(property), composite()));
36 }
37
38 AnimatableValueKeyframe::PropertySpecificKeyframe::PropertySpecificKeyframe(doub le offset, PassRefPtr<TimingFunction> easing, const AnimatableValue* value, Anim ationEffect::CompositeOperation op)
39 : Keyframe::PropertySpecificKeyframe(offset, easing, op)
40 , m_value(const_cast<AnimatableValue*>(value))
41 { }
42
43 AnimatableValueKeyframe::PropertySpecificKeyframe::PropertySpecificKeyframe(doub le offset, PassRefPtr<TimingFunction> easing, PassRefPtr<AnimatableValue> value)
44 : Keyframe::PropertySpecificKeyframe(offset, easing, AnimationEffect::Compos iteReplace)
45 , m_value(value)
46 {
47 ASSERT(!isNull(m_offset));
48 }
49
50 PassOwnPtr<Keyframe::PropertySpecificKeyframe> AnimatableValueKeyframe::Property SpecificKeyframe::cloneWithOffset(double offset) const
51 {
52 Keyframe::PropertySpecificKeyframe* theClone = new PropertySpecificKeyframe( offset, m_easing, m_value);
53 return adoptPtr(theClone);
54 }
55
56 PassRefPtr<Interpolation> AnimatableValueKeyframe::PropertySpecificKeyframe::cre ateInterpolation(CSSPropertyID property, Keyframe::PropertySpecificKeyframe* end , Element*) const
57 {
58 AnimatableValuePropertySpecificKeyframe* to = toAnimatableValuePropertySpeci ficKeyframe(end);
59 return LegacyStyleInterpolation::create(value(), to->value(), property);
60 }
61
62 PassOwnPtr<Keyframe::PropertySpecificKeyframe> AnimatableValueKeyframe::Property SpecificKeyframe::neutralKeyframe(double offset, PassRefPtr<TimingFunction> easi ng) const
63 {
64 return adoptPtr(new AnimatableValueKeyframe::PropertySpecificKeyframe(offset , easing, AnimatableValue::neutralValue(), AnimationEffect::CompositeAdd));
65 }
66
67 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698