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

Side by Side Diff: Source/core/animation/AnimatableValueKeyframe.cpp

Issue 223443002: [Reland] Web Animations: Introduce String based KeyframeEffectModel (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@anotherKEMApproach
Patch Set: Created 6 years, 8 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 "config.h"
6 #include "core/animation/AnimatableValueKeyframe.h"
7
8 #include "core/animation/Interpolation.h"
9
10 namespace WebCore {
11
12 AnimatableValueKeyframe::AnimatableValueKeyframe(const AnimatableValueKeyframe& copyFrom)
13 : Keyframe(copyFrom.m_offset, copyFrom.m_composite, copyFrom.m_easing)
14 {
15 for (PropertyValueMap::const_iterator iter = copyFrom.m_propertyValues.begin (); iter != copyFrom.m_propertyValues.end(); ++iter)
16 setPropertyValue(iter->key, iter->value.get());
17 }
18
19 PropertySet AnimatableValueKeyframe::properties() const
20 {
21 // This is not used in time-critical code, so we probably don't need to
22 // worry about caching this result.
23 PropertySet properties;
24 for (PropertyValueMap::const_iterator iter = m_propertyValues.begin(); iter != m_propertyValues.end(); ++iter)
25 properties.add(*iter.keys());
26 return properties;
27 }
28
29 PassRefPtrWillBeRawPtr<Keyframe> AnimatableValueKeyframe::clone() const
30 {
31 return adoptRefWillBeNoop(new AnimatableValueKeyframe(*this));
32 }
33
34 PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> AnimatableValueKeyfra me::createPropertySpecificKeyframe(CSSPropertyID property) const
35 {
36 return adoptPtrWillBeNoop(new PropertySpecificKeyframe(offset(), easing(), p ropertyValue(property), composite()));
37 }
38
39 void AnimatableValueKeyframe::trace(Visitor* visitor)
40 {
41 visitor->trace(m_propertyValues);
42 Keyframe::trace(visitor);
43 }
44
45 AnimatableValueKeyframe::PropertySpecificKeyframe::PropertySpecificKeyframe(doub le offset, PassRefPtr<TimingFunction> easing, const AnimatableValue* value, Anim ationEffect::CompositeOperation op)
46 : Keyframe::PropertySpecificKeyframe(offset, easing, op)
47 , m_value(const_cast<AnimatableValue*>(value))
48 { }
49
50 AnimatableValueKeyframe::PropertySpecificKeyframe::PropertySpecificKeyframe(doub le offset, PassRefPtr<TimingFunction> easing, PassRefPtrWillBeRawPtr<AnimatableV alue> value)
51 : Keyframe::PropertySpecificKeyframe(offset, easing, AnimationEffect::Compos iteReplace)
52 , m_value(value)
53 {
54 ASSERT(!isNull(m_offset));
55 }
56
57 PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> AnimatableValueKeyfra me::PropertySpecificKeyframe::cloneWithOffset(double offset) const
58 {
59 Keyframe::PropertySpecificKeyframe* theClone = new PropertySpecificKeyframe( offset, m_easing, m_value);
60 return adoptPtrWillBeNoop(theClone);
61 }
62
63 PassRefPtrWillBeRawPtr<Interpolation> AnimatableValueKeyframe::PropertySpecificK eyframe::createInterpolation(CSSPropertyID property, Keyframe::PropertySpecificK eyframe* end) const
64 {
65 AnimatableValuePropertySpecificKeyframe* to = toAnimatableValuePropertySpeci ficKeyframe(end);
66 return LegacyStyleInterpolation::create(value(), to->value(), property);
67 }
68
69 PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> AnimatableValueKeyfra me::PropertySpecificKeyframe::neutralKeyframe(double offset, PassRefPtr<TimingFu nction> easing) const
70 {
71 return adoptPtrWillBeNoop(new AnimatableValueKeyframe::PropertySpecificKeyfr ame(offset, easing, AnimatableValue::neutralValue(), AnimationEffect::CompositeA dd));
72 }
73
74 void AnimatableValueKeyframe::PropertySpecificKeyframe::trace(Visitor* visitor)
75 {
76 visitor->trace(m_value);
77 }
78
79 }
OLDNEW
« no previous file with comments | « Source/core/animation/AnimatableValueKeyframe.h ('k') | Source/core/animation/AnimationStackTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698