| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_BASE_MATH_UTIL_H_ | 5 #ifndef CC_BASE_MATH_UTIL_H_ |
| 6 #define CC_BASE_MATH_UTIL_H_ | 6 #define CC_BASE_MATH_UTIL_H_ |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 return (n > 0) ? ((n + mul - 1) / mul) * mul : (n / mul) * mul; | 316 return (n > 0) ? ((n + mul - 1) / mul) * mul : (n / mul) * mul; |
| 317 } | 317 } |
| 318 | 318 |
| 319 template <typename T> | 319 template <typename T> |
| 320 static T RoundDownInternal(T n, T mul) { | 320 static T RoundDownInternal(T n, T mul) { |
| 321 return (n > 0) ? (n / mul) * mul : (n == 0) ? 0 | 321 return (n > 0) ? (n / mul) * mul : (n == 0) ? 0 |
| 322 : ((n - mul + 1) / mul) * mul; | 322 : ((n - mul + 1) / mul) * mul; |
| 323 } | 323 } |
| 324 }; | 324 }; |
| 325 | 325 |
| 326 class ScopedSubnormalFloatDisabler { |
| 327 public: |
| 328 ScopedSubnormalFloatDisabler(); |
| 329 ~ScopedSubnormalFloatDisabler(); |
| 330 |
| 331 private: |
| 332 #ifdef __SSE__ |
| 333 unsigned int orig_state_; |
| 334 #endif |
| 335 DISALLOW_COPY_AND_ASSIGN(ScopedSubnormalFloatDisabler); |
| 336 }; |
| 337 |
| 326 } // namespace cc | 338 } // namespace cc |
| 327 | 339 |
| 328 #endif // CC_BASE_MATH_UTIL_H_ | 340 #endif // CC_BASE_MATH_UTIL_H_ |
| OLD | NEW |