Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 151 | 151 |
| 152 double currentIteration; | 152 double currentIteration; |
| 153 double timeFraction; | 153 double timeFraction; |
| 154 if (const double iterationDuration = this->iterationDuration()) { | 154 if (const double iterationDuration = this->iterationDuration()) { |
| 155 const double startOffset = multiplyZeroAlwaysGivesZero(m_timing.iter ationStart, iterationDuration); | 155 const double startOffset = multiplyZeroAlwaysGivesZero(m_timing.iter ationStart, iterationDuration); |
| 156 ASSERT(startOffset >= 0); | 156 ASSERT(startOffset >= 0); |
| 157 const double scaledActiveTime = calculateScaledActiveTime(activeDura tion, activeTime, startOffset, m_timing); | 157 const double scaledActiveTime = calculateScaledActiveTime(activeDura tion, activeTime, startOffset, m_timing); |
| 158 const double iterationTime = calculateIterationTime(iterationDuratio n, repeatedDuration(), scaledActiveTime, startOffset, m_timing); | 158 const double iterationTime = calculateIterationTime(iterationDuratio n, repeatedDuration(), scaledActiveTime, startOffset, m_timing); |
| 159 | 159 |
| 160 currentIteration = calculateCurrentIteration(iterationDuration, iter ationTime, scaledActiveTime, m_timing); | 160 currentIteration = calculateCurrentIteration(iterationDuration, iter ationTime, scaledActiveTime, m_timing); |
| 161 timeFraction = calculateTransformedTime(currentIteration, iterationD uration, iterationTime, m_timing) / iterationDuration; | 161 const double transformedTime = calculateTransformedTime(currentItera tion, iterationDuration, iterationTime, m_timing); |
| 162 if (!std::isfinite(iterationDuration)) | |
|
alancutter (OOO until 2018)
2016/04/15 01:01:59
Is there a spec bug we can link to given that this
| |
| 163 timeFraction = fmod(m_timing.iterationStart, 1.0); | |
| 164 else | |
| 165 timeFraction = transformedTime / iterationDuration; | |
| 162 | 166 |
| 163 if (!isNull(iterationTime)) { | 167 if (!isNull(iterationTime)) { |
| 164 timeToNextIteration = (iterationDuration - iterationTime) / std: :abs(m_timing.playbackRate); | 168 timeToNextIteration = (iterationDuration - iterationTime) / std: :abs(m_timing.playbackRate); |
| 165 if (activeDuration - activeTime < timeToNextIteration) | 169 if (activeDuration - activeTime < timeToNextIteration) |
| 166 timeToNextIteration = std::numeric_limits<double>::infinity( ); | 170 timeToNextIteration = std::numeric_limits<double>::infinity( ); |
| 167 } | 171 } |
| 168 } else { | 172 } else { |
| 169 const double localIterationDuration = 1; | 173 const double localIterationDuration = 1; |
| 170 const double localRepeatedDuration = localIterationDuration * m_timi ng.iterationCount; | 174 const double localRepeatedDuration = localIterationDuration * m_timi ng.iterationCount; |
| 171 ASSERT(localRepeatedDuration >= 0); | 175 ASSERT(localRepeatedDuration >= 0); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 223 return AnimationEffectTiming::create(this); | 227 return AnimationEffectTiming::create(this); |
| 224 } | 228 } |
| 225 | 229 |
| 226 DEFINE_TRACE(AnimationEffect) | 230 DEFINE_TRACE(AnimationEffect) |
| 227 { | 231 { |
| 228 visitor->trace(m_animation); | 232 visitor->trace(m_animation); |
| 229 visitor->trace(m_eventDelegate); | 233 visitor->trace(m_eventDelegate); |
| 230 } | 234 } |
| 231 | 235 |
| 232 } // namespace blink | 236 } // namespace blink |
| OLD | NEW |