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

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

Issue 863863004: Implemented additive animations for length (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: More comprehensive non-negative length layout tests Created 5 years, 10 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 } 133 }
134 134
135 void KeyframeEffectModelBase::ensureInterpolationEffect(Element* element) const 135 void KeyframeEffectModelBase::ensureInterpolationEffect(Element* element) const
136 { 136 {
137 if (m_interpolationEffect) 137 if (m_interpolationEffect)
138 return; 138 return;
139 m_interpolationEffect = InterpolationEffect::create(); 139 m_interpolationEffect = InterpolationEffect::create();
140 140
141 for (const auto& entry : *m_keyframeGroups) { 141 for (const auto& entry : *m_keyframeGroups) {
142 const PropertySpecificKeyframeVector& keyframes = entry.value->keyframes (); 142 const PropertySpecificKeyframeVector& keyframes = entry.value->keyframes ();
143 ASSERT(keyframes[0]->composite() == AnimationEffect::CompositeReplace);
144 for (size_t i = 0; i < keyframes.size() - 1; i++) { 143 for (size_t i = 0; i < keyframes.size() - 1; i++) {
145 ASSERT(keyframes[i + 1]->composite() == AnimationEffect::CompositeRe place);
146 double applyFrom = i ? keyframes[i]->offset() : (-std::numeric_limit s<double>::infinity()); 144 double applyFrom = i ? keyframes[i]->offset() : (-std::numeric_limit s<double>::infinity());
147 double applyTo = i == keyframes.size() - 2 ? std::numeric_limits<dou ble>::infinity() : keyframes[i + 1]->offset(); 145 double applyTo = i == keyframes.size() - 2 ? std::numeric_limits<dou ble>::infinity() : keyframes[i + 1]->offset();
148 if (applyTo == 1) 146 if (applyTo == 1)
149 applyTo = std::numeric_limits<double>::infinity(); 147 applyTo = std::numeric_limits<double>::infinity();
150 148
151 m_interpolationEffect->addInterpolationsFromKeyframes(entry.key, ele ment, *keyframes[i], *keyframes[i + 1], applyFrom, applyTo); 149 m_interpolationEffect->addInterpolationsFromKeyframes(entry.key, ele ment, *keyframes[i], *keyframes[i + 1], applyFrom, applyTo);
152 } 150 }
153 } 151 }
154 } 152 }
155 153
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 } 224 }
227 225
228 void KeyframeEffectModelBase::PropertySpecificKeyframeGroup::trace(Visitor* visi tor) 226 void KeyframeEffectModelBase::PropertySpecificKeyframeGroup::trace(Visitor* visi tor)
229 { 227 {
230 #if ENABLE(OILPAN) 228 #if ENABLE(OILPAN)
231 visitor->trace(m_keyframes); 229 visitor->trace(m_keyframes);
232 #endif 230 #endif
233 } 231 }
234 232
235 } // namespace 233 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698