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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 // TODO(crbug.com/630915): Align this function with current Web Animations spec | 146 // TODO(crbug.com/630915): Align this function with current Web Animations spec |
147 // text. | 147 // text. |
148 static inline double calculateIterationTime( | 148 static inline double calculateIterationTime( |
149 double iterationDuration, | 149 double iterationDuration, |
150 double repeatedDuration, | 150 double repeatedDuration, |
151 double scaledActiveTime, | 151 double scaledActiveTime, |
152 double startOffset, | 152 double startOffset, |
153 AnimationEffectReadOnly::Phase phase, | 153 AnimationEffectReadOnly::Phase phase, |
154 const Timing& specified) { | 154 const Timing& specified) { |
155 DCHECK_GT(iterationDuration, 0); | 155 DCHECK_GT(iterationDuration, 0); |
156 DCHECK_EQ(repeatedDuration, multiplyZeroAlwaysGivesZero( | 156 DCHECK_EQ( |
157 iterationDuration, specified.iterationCount)); | 157 repeatedDuration, |
| 158 multiplyZeroAlwaysGivesZero(iterationDuration, specified.iterationCount)); |
158 | 159 |
159 if (isNull(scaledActiveTime)) | 160 if (isNull(scaledActiveTime)) |
160 return nullValue(); | 161 return nullValue(); |
161 | 162 |
162 DCHECK_GE(scaledActiveTime, 0); | 163 DCHECK_GE(scaledActiveTime, 0); |
163 DCHECK_LE(scaledActiveTime, repeatedDuration + startOffset); | 164 DCHECK_LE(scaledActiveTime, repeatedDuration + startOffset); |
164 | 165 |
165 if (!std::isfinite(scaledActiveTime) || | 166 if (!std::isfinite(scaledActiveTime) || |
166 (scaledActiveTime - startOffset == repeatedDuration && | 167 (scaledActiveTime - startOffset == repeatedDuration && |
167 specified.iterationCount && | 168 specified.iterationCount && |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 DCHECK(timeFraction >= 0 && timeFraction <= 1); | 250 DCHECK(timeFraction >= 0 && timeFraction <= 1); |
250 return multiplyZeroAlwaysGivesZero( | 251 return multiplyZeroAlwaysGivesZero( |
251 iterationDuration, | 252 iterationDuration, |
252 specified.timingFunction->evaluate( | 253 specified.timingFunction->evaluate( |
253 timeFraction, accuracyForDuration(iterationDuration))); | 254 timeFraction, accuracyForDuration(iterationDuration))); |
254 } | 255 } |
255 | 256 |
256 } // namespace blink | 257 } // namespace blink |
257 | 258 |
258 #endif | 259 #endif |
OLD | NEW |