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

Side by Side Diff: include/core/SkFloatingPoint.h

Issue 13934009: path ops -- use standard max, min, double-is-nan (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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
« no previous file with comments | « no previous file | include/core/SkTypes.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkFloatingPoint_DEFINED 10 #ifndef SkFloatingPoint_DEFINED
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 static inline int sk_float_isinf(float x) { 70 static inline int sk_float_isinf(float x) {
71 int32_t bits = SkFloat2Bits(x); 71 int32_t bits = SkFloat2Bits(x);
72 return (bits << 1) == (0xFF << 24); 72 return (bits << 1) == (0xFF << 24);
73 } 73 }
74 #else 74 #else
75 #define sk_float_isfinite(x) isfinite(x) 75 #define sk_float_isfinite(x) isfinite(x)
76 #define sk_float_isnan(x) isnan(x) 76 #define sk_float_isnan(x) isnan(x)
77 #define sk_float_isinf(x) isinf(x) 77 #define sk_float_isinf(x) isinf(x)
78 #endif 78 #endif
79 79
80 #define sk_double_isnan(a) sk_float_isnan(a)
81
80 #ifdef SK_USE_FLOATBITS 82 #ifdef SK_USE_FLOATBITS
81 #define sk_float_floor2int(x) SkFloatToIntFloor(x) 83 #define sk_float_floor2int(x) SkFloatToIntFloor(x)
82 #define sk_float_round2int(x) SkFloatToIntRound(x) 84 #define sk_float_round2int(x) SkFloatToIntRound(x)
83 #define sk_float_ceil2int(x) SkFloatToIntCeil(x) 85 #define sk_float_ceil2int(x) SkFloatToIntCeil(x)
84 #else 86 #else
85 #define sk_float_floor2int(x) (int)sk_float_floor(x) 87 #define sk_float_floor2int(x) (int)sk_float_floor(x)
86 #define sk_float_round2int(x) (int)sk_float_floor((x) + 0.5f) 88 #define sk_float_round2int(x) (int)sk_float_floor((x) + 0.5f)
87 #define sk_float_ceil2int(x) (int)sk_float_ceil(x) 89 #define sk_float_ceil2int(x) (int)sk_float_ceil(x)
88 #endif 90 #endif
89 91
90 extern const uint32_t gIEEENotANumber; 92 extern const uint32_t gIEEENotANumber;
91 extern const uint32_t gIEEEInfinity; 93 extern const uint32_t gIEEEInfinity;
92 extern const uint32_t gIEEENegativeInfinity; 94 extern const uint32_t gIEEENegativeInfinity;
93 95
94 #define SK_FloatNaN (*SkTCast<const float*>(&gIEEENotANumber)) 96 #define SK_FloatNaN (*SkTCast<const float*>(&gIEEENotANumber))
95 #define SK_FloatInfinity (*SkTCast<const float*>(&gIEEEInfinity)) 97 #define SK_FloatInfinity (*SkTCast<const float*>(&gIEEEInfinity))
96 #define SK_FloatNegativeInfinity (*SkTCast<const float*>(&gIEEENegativeInfini ty)) 98 #define SK_FloatNegativeInfinity (*SkTCast<const float*>(&gIEEENegativeInfini ty))
97 #endif 99 #endif
OLDNEW
« no previous file with comments | « no previous file | include/core/SkTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698