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

Side by Side Diff: third_party/WebKit/Source/core/animation/TimingCalculations.h

Issue 2109333002: Replace ASSERT_NOT_REACHED with NOTREACHED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 static inline bool isActiveInParentPhase(AnimationEffect::Phase parentPhase, Tim ing::FillMode fillMode) 61 static inline bool isActiveInParentPhase(AnimationEffect::Phase parentPhase, Tim ing::FillMode fillMode)
62 { 62 {
63 switch (parentPhase) { 63 switch (parentPhase) {
64 case AnimationEffect::PhaseBefore: 64 case AnimationEffect::PhaseBefore:
65 return fillMode == Timing::FillModeBackwards || fillMode == Timing::Fill ModeBoth; 65 return fillMode == Timing::FillModeBackwards || fillMode == Timing::Fill ModeBoth;
66 case AnimationEffect::PhaseActive: 66 case AnimationEffect::PhaseActive:
67 return true; 67 return true;
68 case AnimationEffect::PhaseAfter: 68 case AnimationEffect::PhaseAfter:
69 return fillMode == Timing::FillModeForwards || fillMode == Timing::FillM odeBoth; 69 return fillMode == Timing::FillModeForwards || fillMode == Timing::FillM odeBoth;
70 default: 70 default:
71 ASSERT_NOT_REACHED(); 71 NOTREACHED();
72 return false; 72 return false;
73 } 73 }
74 } 74 }
75 75
76 static inline double calculateActiveTime(double activeDuration, Timing::FillMode fillMode, double localTime, AnimationEffect::Phase parentPhase, AnimationEffect ::Phase phase, const Timing& specified) 76 static inline double calculateActiveTime(double activeDuration, Timing::FillMode fillMode, double localTime, AnimationEffect::Phase parentPhase, AnimationEffect ::Phase phase, const Timing& specified)
77 { 77 {
78 ASSERT(activeDuration >= 0); 78 ASSERT(activeDuration >= 0);
79 ASSERT(phase == calculatePhase(activeDuration, localTime, specified)); 79 ASSERT(phase == calculatePhase(activeDuration, localTime, specified));
80 80
81 switch (phase) { 81 switch (phase) {
82 case AnimationEffect::PhaseBefore: 82 case AnimationEffect::PhaseBefore:
83 if (fillMode == Timing::FillModeBackwards || fillMode == Timing::FillMod eBoth) 83 if (fillMode == Timing::FillModeBackwards || fillMode == Timing::FillMod eBoth)
84 return 0; 84 return 0;
85 return nullValue(); 85 return nullValue();
86 case AnimationEffect::PhaseActive: 86 case AnimationEffect::PhaseActive:
87 if (isActiveInParentPhase(parentPhase, fillMode)) 87 if (isActiveInParentPhase(parentPhase, fillMode))
88 return localTime - specified.startDelay; 88 return localTime - specified.startDelay;
89 return nullValue(); 89 return nullValue();
90 case AnimationEffect::PhaseAfter: 90 case AnimationEffect::PhaseAfter:
91 if (fillMode == Timing::FillModeForwards || fillMode == Timing::FillMode Both) 91 if (fillMode == Timing::FillModeForwards || fillMode == Timing::FillMode Both)
92 return activeDuration; 92 return activeDuration;
93 return nullValue(); 93 return nullValue();
94 case AnimationEffect::PhaseNone: 94 case AnimationEffect::PhaseNone:
95 ASSERT(isNull(localTime)); 95 ASSERT(isNull(localTime));
96 return nullValue(); 96 return nullValue();
97 default: 97 default:
98 ASSERT_NOT_REACHED(); 98 NOTREACHED();
99 return nullValue(); 99 return nullValue();
100 } 100 }
101 } 101 }
102 102
103 static inline double calculateScaledActiveTime(double activeDuration, double act iveTime, double startOffset, const Timing& specified) 103 static inline double calculateScaledActiveTime(double activeDuration, double act iveTime, double startOffset, const Timing& specified)
104 { 104 {
105 ASSERT(activeDuration >= 0); 105 ASSERT(activeDuration >= 0);
106 ASSERT(startOffset >= 0); 106 ASSERT(startOffset >= 0);
107 107
108 if (isNull(activeTime)) 108 if (isNull(activeTime))
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 if (!std::isfinite(iterationDuration)) 197 if (!std::isfinite(iterationDuration))
198 return directedTime; 198 return directedTime;
199 double timeFraction = directedTime / iterationDuration; 199 double timeFraction = directedTime / iterationDuration;
200 ASSERT(timeFraction >= 0 && timeFraction <= 1); 200 ASSERT(timeFraction >= 0 && timeFraction <= 1);
201 return multiplyZeroAlwaysGivesZero(iterationDuration, specified.timingFuncti on->evaluate(timeFraction, accuracyForDuration(iterationDuration))); 201 return multiplyZeroAlwaysGivesZero(iterationDuration, specified.timingFuncti on->evaluate(timeFraction, accuracyForDuration(iterationDuration)));
202 } 202 }
203 203
204 } // namespace blink 204 } // namespace blink
205 205
206 #endif 206 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698