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

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

Issue 1345163007: Web Animations: Handle iteration values which overflow int. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/animation/InertEffect.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 ASSERT(animation()); 170 ASSERT(animation());
171 if (!m_target || !m_model) 171 if (!m_target || !m_model)
172 return; 172 return;
173 173
174 if (hasIncompatibleStyle()) 174 if (hasIncompatibleStyle())
175 animation()->cancelAnimationOnCompositor(); 175 animation()->cancelAnimationOnCompositor();
176 176
177 double iteration = currentIteration(); 177 double iteration = currentIteration();
178 ASSERT(iteration >= 0); 178 ASSERT(iteration >= 0);
179 OwnPtr<Vector<RefPtr<Interpolation>>> interpolations = m_sampledEffect ? m_s ampledEffect->mutableInterpolations() : nullptr; 179 OwnPtr<Vector<RefPtr<Interpolation>>> interpolations = m_sampledEffect ? m_s ampledEffect->mutableInterpolations() : nullptr;
180 // FIXME: Handle iteration values which overflow int. 180 bool changed = m_model->sample(clampTo<int>(iteration, 0), timeFraction(), i terationDuration(), interpolations);
181 bool changed = m_model->sample(static_cast<int>(iteration), timeFraction(), iterationDuration(), interpolations);
182 if (m_sampledEffect) { 181 if (m_sampledEffect) {
183 m_sampledEffect->setInterpolations(interpolations.release()); 182 m_sampledEffect->setInterpolations(interpolations.release());
184 } else if (interpolations && !interpolations->isEmpty()) { 183 } else if (interpolations && !interpolations->isEmpty()) {
185 SampledEffect* sampledEffect = SampledEffect::create(this, interpolation s.release()); 184 SampledEffect* sampledEffect = SampledEffect::create(this, interpolation s.release());
186 m_sampledEffect = sampledEffect; 185 m_sampledEffect = sampledEffect;
187 ensureAnimationStack(m_target).add(sampledEffect); 186 ensureAnimationStack(m_target).add(sampledEffect);
188 changed = true; 187 changed = true;
189 } else { 188 } else {
190 return; 189 return;
191 } 190 }
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 367
369 DEFINE_TRACE(KeyframeEffect) 368 DEFINE_TRACE(KeyframeEffect)
370 { 369 {
371 visitor->trace(m_target); 370 visitor->trace(m_target);
372 visitor->trace(m_model); 371 visitor->trace(m_model);
373 visitor->trace(m_sampledEffect); 372 visitor->trace(m_sampledEffect);
374 AnimationEffect::trace(visitor); 373 AnimationEffect::trace(visitor);
375 } 374 }
376 375
377 } // namespace blink 376 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/animation/InertEffect.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698