19 float denormalizedCheck = FLT_EPSILON * epsilon / 2;
20 return fabsf(
a) <= denormalizedCheck && fabsf(
b) <= denormalizedCheck;
25static bool equal_ulps(
float a,
float b,
int epsilon,
int depsilon) {
32 return aBits < bBits + epsilon && bBits < aBits + epsilon;
39 return aBits < bBits + epsilon && bBits < aBits + epsilon;
52 return aBits < bBits + epsilon && bBits < aBits + epsilon;
59 return aBits < bBits + epsilon && bBits < aBits + epsilon;
69 return aBits >= bBits + epsilon || bBits >= aBits + epsilon;
82 return aBits >= bBits + epsilon || bBits >= aBits + epsilon;
89 return aBits >= bBits + epsilon || bBits >= aBits + epsilon;
94 return a <=
b - FLT_EPSILON * epsilon;
99 return aBits <= bBits - epsilon;
104 return a <
b + FLT_EPSILON * epsilon;
109 return aBits < bBits + epsilon;
114 const int UlpsEpsilon = 2;
119 const int UlpsEpsilon = 8;
124 const int UlpsEpsilon = 16;
139 const int UlpsEpsilon = 16;
144 const int UlpsEpsilon = 16;
149 const int UlpsEpsilon = 16;
154 const int UlpsEpsilon = 16;
159 const int UlpsEpsilon = 16;
164 const int UlpsEpsilon = 16;
169 const int UlpsEpsilon = 256;
170 const int DUlpsEpsilon = 1024;
175 const int UlpsEpsilon = 2;
181 const int UlpsEpsilon = 16;
186 const int UlpsEpsilon = 16;
191 int32_t floatIntA, floatIntB;
192 memcpy(&floatIntA, &
a,
sizeof(int32_t));
193 memcpy(&floatIntB, &
b,
sizeof(int32_t));
195 if ((floatIntA < 0) != (floatIntB < 0)) {
200 return SkTAbs(floatIntA - floatIntB);
207 : fAllocator(allocator)
208 , fCoincidence(nullptr)
211 , fWindingFailed(
false)
221#if DEBUG_T_SECT_LOOP_COUNT
222 debugResetLoopCounts();
225 fPreviousFuncName =
nullptr;
static int32_t SkFloatAs2sCompliment(float x)
static bool SkIsFinite(T x, Pack... values)
static constexpr double sk_ieee_double_divide(double numer, double denom)
static constexpr int32_t SK_MaxS32
#define SkDEBUGPARAMS(...)
static bool less_ulps(float a, float b, int epsilon)
bool RoughlyEqualUlps(float a, float b)
static bool arguments_denormalized(float a, float b, int epsilon)
static bool d_equal_ulps(float a, float b, int epsilon)
static bool not_equal_ulps(float a, float b, int epsilon)
bool AlmostPequalUlps(float a, float b)
static bool equal_ulps_pin(float a, float b, int epsilon, int depsilon)
static bool d_not_equal_ulps(float a, float b, int epsilon)
static bool equal_ulps(float a, float b, int epsilon, int depsilon)
bool AlmostEqualUlps_Pin(float a, float b)
static bool less_or_equal_ulps(float a, float b, int epsilon)
bool AlmostEqualUlps(float a, float b)
bool AlmostBequalUlps(float a, float b)
int UlpsDistance(float a, float b)
bool NotAlmostEqualUlps_Pin(float a, float b)
bool NotAlmostDequalUlps(float a, float b)
static bool not_equal_ulps_pin(float a, float b, int epsilon)
bool NotAlmostEqualUlps(float a, float b)
bool AlmostDequalUlps(float a, float b)
bool AlmostLessOrEqualUlps(float a, float b)
bool AlmostBetweenUlps(float a, float b, float c)
bool AlmostEqualUlpsNoNormalCheck(float a, float b)
bool AlmostLessUlps(float a, float b)
static bool equal_ulps_no_normal_check(float a, float b, int epsilon, int depsilon)
#define SkDoubleToScalar(x)
SkOpGlobalState(SkOpContourHead *head, SkArenaAlloc *allocator SkDEBUGPARAMS(bool debugSkipAssert) SkDEBUGPARAMS(const char *testName))
static float max(float r, float g, float b)