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

Side by Side Diff: Source/core/animation/TimedItemCalculations.h

Issue 178663007: Web Animations: Reduce duplication of Timing defaults. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 ASSERT(iterationDuration > 0); 183 ASSERT(iterationDuration > 0);
184 ASSERT(isNull(iterationTime) || (iterationTime >= 0 && iterationTime <= iter ationDuration)); 184 ASSERT(isNull(iterationTime) || (iterationTime >= 0 && iterationTime <= iter ationDuration));
185 185
186 double directedTime = calculateDirectedTime(currentIteration, iterationDurat ion, iterationTime, specified); 186 double directedTime = calculateDirectedTime(currentIteration, iterationDurat ion, iterationTime, specified);
187 if (isNull(directedTime)) 187 if (isNull(directedTime))
188 return nullValue(); 188 return nullValue();
189 if (!std::isfinite(iterationDuration)) 189 if (!std::isfinite(iterationDuration))
190 return directedTime; 190 return directedTime;
191 double timeFraction = directedTime / iterationDuration; 191 double timeFraction = directedTime / iterationDuration;
192 ASSERT(timeFraction >= 0 && timeFraction <= 1); 192 ASSERT(timeFraction >= 0 && timeFraction <= 1);
193 return specified.timingFunction 193 return multiplyZeroAlwaysGivesZero(iterationDuration, specified.timingFuncti on->evaluate(timeFraction, accuracyForDuration(iterationDuration)));
194 ? multiplyZeroAlwaysGivesZero(iterationDuration, specified.timingFunctio n->evaluate(timeFraction, accuracyForDuration(iterationDuration)))
195 : directedTime;
196 } 194 }
197 195
198 } // namespace WebCore 196 } // namespace WebCore
199 197
200 #endif 198 #endif
OLDNEW
« no previous file with comments | « Source/core/animation/Animation.cpp ('k') | Source/core/animation/TimedItemCalculationsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698