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

Side by Side Diff: Source/core/animation/StringKeyframe.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
« no previous file with comments | « Source/core/animation/StringKeyframe.h ('k') | Source/core/animation/css/CSSAnimations.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/StringKeyframe.h"
7
8 #include "core/animation/Interpolation.h"
9
10 namespace WebCore {
11
12 StringKeyframe::StringKeyframe(const StringKeyframe& 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);
17 }
18
19 PropertySet StringKeyframe::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> StringKeyframe::clone() const
30 {
31 return adoptRefWillBeNoop(new StringKeyframe(*this));
32 }
33 PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> StringKeyframe::creat ePropertySpecificKeyframe(CSSPropertyID property) const
34 {
35 return adoptPtrWillBeNoop(new PropertySpecificKeyframe(offset(), easing(), p ropertyValue(property), composite()));
36 }
37
38 void StringKeyframe::trace(Visitor* visitor)
39 {
40 Keyframe::trace(visitor);
41 }
42
43 StringKeyframe::PropertySpecificKeyframe::PropertySpecificKeyframe(double offset , PassRefPtr<TimingFunction> easing, const String& value, AnimationEffect::Compo siteOperation op)
44 : Keyframe::PropertySpecificKeyframe(offset, easing, op)
45 , m_value(value)
46 { }
47
48 StringKeyframe::PropertySpecificKeyframe::PropertySpecificKeyframe(double offset , PassRefPtr<TimingFunction> easing, const String& value)
49 : Keyframe::PropertySpecificKeyframe(offset, easing, AnimationEffect::Compos iteReplace)
50 , m_value(value)
51 {
52 ASSERT(!isNull(m_offset));
53 }
54
55 PassRefPtrWillBeRawPtr<Interpolation> StringKeyframe::PropertySpecificKeyframe:: createInterpolation(CSSPropertyID property, Keyframe::PropertySpecificKeyframe* end) const
56 {
57 ASSERT_UNUSED(end, end);
58 // FIXME: Convert string keyframe value pairs to interpolations.
59 return nullptr;
60 }
61
62 PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> StringKeyframe::Prope rtySpecificKeyframe::neutralKeyframe(double offset, PassRefPtr<TimingFunction> e asing) const
63 {
64 return adoptPtrWillBeNoop(new StringKeyframe::PropertySpecificKeyframe(offse t, easing, emptyString(), AnimationEffect::CompositeAdd));
65 }
66
67 PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> StringKeyframe::Prope rtySpecificKeyframe::cloneWithOffset(double offset) const
68 {
69 Keyframe::PropertySpecificKeyframe *theClone = new PropertySpecificKeyframe( offset, m_easing, m_value);
70 return adoptPtrWillBeNoop(theClone);
71 }
72
73 void StringKeyframe::PropertySpecificKeyframe::trace(Visitor* visitor)
74 {
75 }
76
77 }
OLDNEW
« no previous file with comments | « Source/core/animation/StringKeyframe.h ('k') | Source/core/animation/css/CSSAnimations.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698