Chromium Code Reviews| Index: include/core/SkTypes.h |
| =================================================================== |
| --- include/core/SkTypes.h (revision 8808) |
| +++ include/core/SkTypes.h (working copy) |
| @@ -314,6 +314,14 @@ |
| return a; |
| } |
| +template <typename T> const T& SkTMin(const T& a, const T& b) { |
| + return (a < b) ? a : b; |
| +} |
| + |
| +template <typename T> const T& SkTMax(const T& a, const T& b) { |
| + return (b < a) ? a : b; |
| +} |
| + |
| static inline int32_t SkSign32(int32_t a) { |
| return (a >> 31) | ((unsigned) -a >> 31); |
| } |