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

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

Issue 548223002: Web-Animations: Implement idle state for AnimationPlayers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use known current time in finish event Created 6 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
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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 else if (m_sampledEffect) 186 else if (m_sampledEffect)
187 const_cast<Animation*>(this)->clearEffects(); 187 const_cast<Animation*>(this)->clearEffects();
188 } 188 }
189 189
190 double Animation::calculateTimeToEffectChange(bool forwards, double localTime, d ouble timeToNextIteration) const 190 double Animation::calculateTimeToEffectChange(bool forwards, double localTime, d ouble timeToNextIteration) const
191 { 191 {
192 const double start = startTimeInternal() + specifiedTiming().startDelay; 192 const double start = startTimeInternal() + specifiedTiming().startDelay;
193 const double end = start + activeDurationInternal(); 193 const double end = start + activeDurationInternal();
194 194
195 switch (phase()) { 195 switch (phase()) {
196 case PhaseNone:
197 return std::numeric_limits<double>::infinity();
196 case PhaseBefore: 198 case PhaseBefore:
197 ASSERT(start >= localTime); 199 ASSERT(start >= localTime);
198 return forwards 200 return forwards
199 ? start - localTime 201 ? start - localTime
200 : std::numeric_limits<double>::infinity(); 202 : std::numeric_limits<double>::infinity();
201 case PhaseActive: 203 case PhaseActive:
202 if (forwards && hasActiveAnimationsOnCompositor()) { 204 if (forwards && hasActiveAnimationsOnCompositor()) {
203 ASSERT(specifiedTiming().playbackRate == 1); 205 ASSERT(specifiedTiming().playbackRate == 1);
204 // Need service to apply fill / fire events. 206 // Need service to apply fill / fire events.
205 const double timeToEnd = end - localTime; 207 const double timeToEnd = end - localTime;
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 309
308 void Animation::trace(Visitor* visitor) 310 void Animation::trace(Visitor* visitor)
309 { 311 {
310 visitor->trace(m_target); 312 visitor->trace(m_target);
311 visitor->trace(m_effect); 313 visitor->trace(m_effect);
312 visitor->trace(m_sampledEffect); 314 visitor->trace(m_sampledEffect);
313 AnimationNode::trace(visitor); 315 AnimationNode::trace(visitor);
314 } 316 }
315 317
316 } // namespace blink 318 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/web-animations-api/player-cancel-finishes.html ('k') | Source/core/animation/AnimationPlayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698