| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 specified.playbackRate) + | 136 specified.playbackRate) + |
| 137 startOffset; | 137 startOffset; |
| 138 } | 138 } |
| 139 | 139 |
| 140 static inline bool endsOnIterationBoundary(double iterationCount, | 140 static inline bool endsOnIterationBoundary(double iterationCount, |
| 141 double iterationStart) { | 141 double iterationStart) { |
| 142 DCHECK(std::isfinite(iterationCount)); | 142 DCHECK(std::isfinite(iterationCount)); |
| 143 return !fmod(iterationCount + iterationStart, 1); | 143 return !fmod(iterationCount + iterationStart, 1); |
| 144 } | 144 } |
| 145 | 145 |
| 146 // TODO(crbug.com/630915): Align this function with current Web Animations spec
text. | 146 // TODO(crbug.com/630915): Align this function with current Web Animations spec |
| 147 // text. |
| 147 static inline double calculateIterationTime( | 148 static inline double calculateIterationTime( |
| 148 double iterationDuration, | 149 double iterationDuration, |
| 149 double repeatedDuration, | 150 double repeatedDuration, |
| 150 double scaledActiveTime, | 151 double scaledActiveTime, |
| 151 double startOffset, | 152 double startOffset, |
| 152 AnimationEffectReadOnly::Phase phase, | 153 AnimationEffectReadOnly::Phase phase, |
| 153 const Timing& specified) { | 154 const Timing& specified) { |
| 154 DCHECK_GT(iterationDuration, 0); | 155 DCHECK_GT(iterationDuration, 0); |
| 155 DCHECK_EQ(repeatedDuration, multiplyZeroAlwaysGivesZero( | 156 DCHECK_EQ(repeatedDuration, multiplyZeroAlwaysGivesZero( |
| 156 iterationDuration, specified.iterationCount)); | 157 iterationDuration, specified.iterationCount)); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 DCHECK(timeFraction >= 0 && timeFraction <= 1); | 249 DCHECK(timeFraction >= 0 && timeFraction <= 1); |
| 249 return multiplyZeroAlwaysGivesZero( | 250 return multiplyZeroAlwaysGivesZero( |
| 250 iterationDuration, | 251 iterationDuration, |
| 251 specified.timingFunction->evaluate( | 252 specified.timingFunction->evaluate( |
| 252 timeFraction, accuracyForDuration(iterationDuration))); | 253 timeFraction, accuracyForDuration(iterationDuration))); |
| 253 } | 254 } |
| 254 | 255 |
| 255 } // namespace blink | 256 } // namespace blink |
| 256 | 257 |
| 257 #endif | 258 #endif |
| OLD | NEW |