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

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

Issue 196413030: Web animations: Supply CSS transition easing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use iteration duration when choosing accuracy during keyframe animation Created 6 years, 9 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
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 result = m_keyframes[0]->properties(); 105 result = m_keyframes[0]->properties();
106 for (size_t i = 1; i < m_keyframes.size(); i++) { 106 for (size_t i = 1; i < m_keyframes.size(); i++) {
107 PropertySet extras = m_keyframes[i]->properties(); 107 PropertySet extras = m_keyframes[i]->properties();
108 for (PropertySet::const_iterator it = extras.begin(); it != extras.end() ; ++it) { 108 for (PropertySet::const_iterator it = extras.begin(); it != extras.end() ; ++it) {
109 result.add(*it); 109 result.add(*it);
110 } 110 }
111 } 111 }
112 return result; 112 return result;
113 } 113 }
114 114
115 PassOwnPtr<Vector<RefPtr<Interpolation> > > KeyframeEffectModel::sample(int iter ation, double fraction) const 115 PassOwnPtr<Vector<RefPtr<Interpolation> > > KeyframeEffectModel::sample(int iter ation, double fraction, double iterationDuration) const
116 { 116 {
117 ASSERT(iteration >= 0); 117 ASSERT(iteration >= 0);
118 ASSERT(!isNull(fraction)); 118 ASSERT(!isNull(fraction));
119 ensureKeyframeGroups(); 119 ensureKeyframeGroups();
120 ensureInterpolationEffect(); 120 ensureInterpolationEffect();
121 121
122 return m_interpolationEffect->getActiveInterpolations(fraction); 122 return m_interpolationEffect->getActiveInterpolations(fraction, iterationDur ation);
123 } 123 }
124 124
125 KeyframeEffectModel::KeyframeVector KeyframeEffectModel::normalizedKeyframes(con st KeyframeVector& keyframes) 125 KeyframeEffectModel::KeyframeVector KeyframeEffectModel::normalizedKeyframes(con st KeyframeVector& keyframes)
126 { 126 {
127 // keyframes [beginIndex, endIndex) will remain after removing all keyframes if they are not 127 // keyframes [beginIndex, endIndex) will remain after removing all keyframes if they are not
128 // loosely sorted by offset, and after removing keyframes with positional of fset outide [0, 1]. 128 // loosely sorted by offset, and after removing keyframes with positional of fset outide [0, 1].
129 size_t beginIndex = 0; 129 size_t beginIndex = 0;
130 size_t endIndex = keyframes.size(); 130 size_t endIndex = keyframes.size();
131 131
132 // Becomes the most recent keyframe with an explicit offset. 132 // Becomes the most recent keyframe with an explicit offset.
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 if (m_keyframes.last()->offset() != 1.0) 315 if (m_keyframes.last()->offset() != 1.0)
316 appendKeyframe(adoptPtr(new PropertySpecificKeyframe(1, nullptr, Animata bleValue::neutralValue(), CompositeAdd))); 316 appendKeyframe(adoptPtr(new PropertySpecificKeyframe(1, nullptr, Animata bleValue::neutralValue(), CompositeAdd)));
317 } 317 }
318 318
319 void KeyframeEffectModel::trace(Visitor* visitor) 319 void KeyframeEffectModel::trace(Visitor* visitor)
320 { 320 {
321 visitor->trace(m_keyframes); 321 visitor->trace(m_keyframes);
322 } 322 }
323 323
324 } // namespace 324 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698