7#ifndef SkPathOpsTypes_DEFINED
8#define SkPathOpsTypes_DEFINED
47 return fAllocatedOpSpan;
81 bool debugSkipAssert()
const {
return fDebugSkipAssert; }
83 const char* debugTestName()
const {
return fDebugTestName; }
86#if DEBUG_T_SECT_LOOP_COUNT
90 void debugLoopReport();
91 void debugResetLoopCounts();
95 void debugSetCheckHealth(
bool check) { fDebugCheckHealth =
check; }
96 bool debugCheckHealth()
const {
return fDebugCheckHealth; }
99#if DEBUG_VALIDATE || DEBUG_COIN
104 void debugAddToCoinChangedDict();
105 void debugAddToGlobalCoinDicts();
106 SkPathOpsDebug::CoinDict* debugCoinChangedDict() {
return &fCoinChangedDict; }
107 const SkPathOpsDebug::CoinDictEntry& debugCoinDictEntry()
const {
return fCoinDictEntry; }
109 static void DumpCoinDict();
126 int nextContourID() {
134 int nextSegmentID() {
148 fAllocatedOpSpan =
false;
152 fAllocatedOpSpan =
true;
173 fWindingFailed =
true;
177 return fWindingFailed;
185 bool fAllocatedOpSpan;
189 const char* fDebugTestName;
190 void* fDebugReporter;
197 bool fDebugSkipAssert;
199#if DEBUG_T_SECT_LOOP_COUNT
200 int fDebugLoopCount[3];
203 float fDebugWorstWeight[6];
206 SkPathOpsDebug::CoinDict fCoinChangedDict;
207 SkPathOpsDebug::CoinDict fCoinVisitedDict;
208 SkPathOpsDebug::CoinDictEntry fCoinDictEntry;
209 const char* fPreviousFuncName;
212 bool fDebugCheckHealth;
218#define SkOPASSERT(cond) SkASSERT((this->globalState() && \
219 (this->globalState()->debugCheckHealth() || \
220 this->globalState()->debugSkipAssert())) || (cond))
222#define SkOPASSERT(cond) SkASSERT((this->globalState() && \
223 this->globalState()->debugSkipAssert()) || (cond))
225#define SkOPOBJASSERT(obj, cond) SkASSERT((obj->globalState() && \
226 obj->globalState()->debugSkipAssert()) || (cond))
228#define SkOPASSERT(cond)
229#define SkOPOBJASSERT(obj, cond)
324 return x == 0 ||
x == 1;
328 return fabs(
x) < FLT_EPSILON;
340 return fabs(
x) < FLT_EPSILON;
372 return x == 0 || fabs(
x) < fabs(
y * FLT_EPSILON);
376 return x == 0 || fabs(
x) < fabs(
y * DBL_EPSILON);
414 return x - FLT_EPSILON >=
y;
426 return x + FLT_EPSILON >
y;
438 return x + FLT_EPSILON <=
y;
450 return x - FLT_EPSILON <
y;
462 return x > 1 - FLT_EPSILON;
470 return x < FLT_EPSILON;
478 return x < FLT_EPSILON;
490 return x < 1 + FLT_EPSILON;
498 return x > -FLT_EPSILON;
506 return x > -FLT_EPSILON;
533 return (
a -
b) * (c -
b) <= 0;
554 int verb = (1 <<
points) >> 1;
568 int points = (
int) verb - (((
int) verb + 1) >> 2);
582 return A + (
B -
A) *
t;
588 return (
x > 0) - (
x < 0);
594 return (
x > 0) + (
x >= 0);
static const int points[]
#define check(reporter, ref, unref, make, kill)
#define SkDEBUGFAIL(message)
#define DEBUG_COIN_DECLARE_PARAMS()
#define SkDEBUGPARAMS(...)
const double FLT_EPSILON_CUBED
bool RoughlyEqualUlps(float a, float b)
bool approximately_negative_orderable(double x)
bool roughly_zero_when_compared_to(double x, double y)
bool approximately_less_than_zero(double x)
const double ROUGH_EPSILON
bool approximately_greater(double x, double y)
bool approximately_equal(double x, double y)
const double FLT_EPSILON_INVERSE
bool approximately_one_or_less_double(double x)
bool approximately_greater_or_equal_orderable(double x, double y)
const double FLT_EPSILON_SQRT
bool precisely_zero(double x)
bool approximately_lesser_orderable(double x, double y)
bool AlmostPequalUlps(float a, float b)
bool approximately_lesser_or_equal_double(double x, double y)
const double FLT_EPSILON_DOUBLE
bool approximately_zero_orderable(double x)
bool approximately_one_or_less(double x)
bool approximately_zero_or_more_double(double x)
bool roughly_between(double a, double b, double c)
bool precisely_subdivide_equal(double x, double y)
bool approximately_zero(double x)
const double FLT_EPSILON_SQUARED
bool approximately_zero_squared(double x)
bool precisely_negative(double x)
bool approximately_zero_or_more(double x)
const double BUMP_EPSILON
bool approximately_greater_than_one(double x)
const double FLT_EPSILON_HALF
bool roughly_negative(double x)
const double FLT_EPSILON_ORDERABLE_ERR
bool AlmostEqualUlps_Pin(float a, float b)
bool approximately_lesser_or_equal_orderable(double x, double y)
const SkScalar INVERSE_NUMBER_RANGE
bool approximately_between_orderable(double a, double b, double c)
bool between(double a, double b, double c)
bool precisely_less_than_zero(double x)
bool approximately_negative(double x)
bool AlmostEqualUlps(float a, float b)
bool precisely_between(double a, double b, double c)
bool approximately_equal_double(double x, double y)
const double DBL_EPSILON_ERR
bool roughly_equal(double x, double y)
const double MORE_ROUGH_EPSILON
bool approximately_positive_squared(double x)
bool approximately_equal_half(double x, double y)
bool AlmostBequalUlps(float a, float b)
bool approximately_zero_sqrt(double x)
bool precisely_equal(double x, double y)
double SkDInterp(double A, double B, double t)
int UlpsDistance(float a, float b)
bool approximately_zero_inverse(double x)
bool precisely_greater_than_one(double x)
const double WAY_ROUGH_EPSILON
bool NotAlmostEqualUlps_Pin(float a, float b)
bool precisely_zero_when_compared_to(double x, double y)
bool approximately_zero_when_compared_to(double x, double y)
bool approximately_positive(double x)
bool approximately_greater_or_equal_double(double x, double y)
bool approximately_equal_orderable(double x, double y)
bool NotAlmostDequalUlps(float a, float b)
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 approximately_lesser(double x, double y)
bool approximately_zero_half(double x)
bool approximately_equal_squared(double x, double y)
bool approximately_lesser_or_equal(double x, double y)
bool approximately_greater_double(double x, double y)
bool precisely_subdivide_zero(double x)
bool AlmostLessUlps(float a, float b)
bool approximately_greater_orderable(double x, double y)
bool zero_or_one(double x)
SkPath::Verb SkPathOpsPointsToVerb(int points)
bool approximately_lesser_double(double x, double y)
bool approximately_zero_double(double x)
bool more_roughly_equal(double x, double y)
const double DBL_EPSILON_SUBDIVIDE_ERR
bool approximately_between(double a, double b, double c)
bool roughly_zero(double x)
int SkPathOpsVerbToPoints(SkPath::Verb verb)
bool approximately_greater_or_equal(double x, double y)
#define SkDoubleToScalar(x)
const SkOpAngle * debugAngle(int id) const
SkOpContour * debugContour(int id) const
const SkOpCoincidence * debugCoincidence() const
bool allocatedOpSpan() const
void setPhase(SkOpPhase phase)
SkArenaAlloc * allocator()
bool windingFailed() const
SkOpContourHead * contourHead()
SkOpCoincidence * coincidence()
void setContourHead(SkOpContourHead *contourHead)
void resetAllocatedOpSpan()
SkOpGlobalState(SkOpContourHead *head, SkArenaAlloc *allocator SkDEBUGPARAMS(bool debugSkipAssert) SkDEBUGPARAMS(const char *testName))
void setCoincidence(SkOpCoincidence *coincidence)
static bool DebugRunFail()
void setAllocatedOpSpan()
const SkOpPtT * debugPtT(int id) const
const SkOpSegment * debugSegment(int id) const
const SkOpSpanBase * debugSpan(int id) const