7#ifndef SkIntersections_DEFINE
8#define SkIntersections_DEFINE
41 sk_bzero(fNearlySame,
sizeof(fNearlySame));
42#if DEBUG_T_SECT_LOOP_COUNT
43 sk_bzero(fDebugLoopCount,
sizeof(fDebugLoopCount));
60 fAllowNear = nearAllowed;
66 fIsCoincident[0] &= ~bit;
67 fIsCoincident[1] &= ~bit;
83 return vertical(conic, top, bottom,
x, flipped);
107 return vertical(cubic, top, bottom,
x, flipped);
125 return fUsed > 0 && (t == 0 ? fT[0][0] == 0 : fT[0][fUsed - 1] == 1);
130 return fUsed > 0 && (fT[1][0] == t || fT[1][fUsed - 1] == t);
142 return (fIsCoincident[0] & 1 << index) != 0;
157 return vertical(line, top, bottom,
x, flipped);
170 return fNearlySame[index];
193 return vertical(quad, top, bottom,
x, flipped);
208 sk_bzero(fIsCoincident,
sizeof(fIsCoincident));
239 if (!
between(0, fT[0][index], 1)) {
252 int closestTo(
double rangeStart,
double rangeEnd,
const SkDPoint& testPt,
double* dist)
const;
293 int vertical(
const SkDLine&,
double top,
double bottom,
double x,
bool flipped);
294 int vertical(
const SkDQuad&,
double top,
double bottom,
double x,
bool flipped);
295 int vertical(
const SkDConic&,
double top,
double bottom,
double x,
bool flipped);
296 int vertical(
const SkDCubic&,
double top,
double bottom,
double x,
bool flipped);
325 void cleanUpParallelLines(
bool parallel);
331 uint16_t fIsCoincident[2];
341#if DEBUG_T_SECT_LOOP_COUNT
342 int fDebugLoopCount[3];
static bool between(SkScalar a, SkScalar b, SkScalar c)
static void sk_bzero(void *buffer, size_t size)
#define SkDEBUGPARAMS(...)
const double BUMP_EPSILON
static bool left(const SkPoint &p0, const SkPoint &p1)
static bool right(const SkPoint &p0, const SkPoint &p1)
Type::kYUV Type::kRGBA() int(0.7 *637)
double operator[](int n) const
TArray(const double ts[10])
void merge(const SkIntersections &, int, const SkIntersections &, int)
const SkDPoint & pt2(int index) const
void cubicInsert(double one, double two, const SkDPoint &pt, const SkDCubic &c1, const SkDCubic &c2)
int intersectRay(const SkDLine &, const SkDLine &)
int conicHorizontal(const SkPoint a[3], SkScalar weight, SkScalar left, SkScalar right, SkScalar y, bool flipped)
int insertSwap(double one, double two, const SkDPoint &pt)
int horizontal(const SkDCubic &, double y, double tRange[3])
TArray operator[](int n) const
int quadVertical(const SkPoint a[3], SkScalar top, SkScalar bottom, SkScalar x, bool flipped)
bool nearlySame(int index) const
int insert(double one, double two, const SkDPoint &pt)
int intersect(const SkDLine &, const SkDLine &)
int cubicVertical(const SkPoint a[4], SkScalar top, SkScalar bottom, SkScalar x, bool flipped)
int intersectRay(const SkTCurve &tCurve, const SkDLine &line)
void allowNear(bool nearAllowed)
void removeOne(int index)
int horizontal(const SkDQuad &, double left, double right, double y, double tRange[2])
const SkDPoint & pt(int index) const
void insertNear(double one, double two, const SkDPoint &pt1, const SkDPoint &pt2)
int lineLine(const SkPoint a[2], const SkPoint b[2])
int conicVertical(const SkPoint a[3], SkScalar weight, SkScalar top, SkScalar bottom, SkScalar x, bool flipped)
int insertCoincident(double one, double two, const SkDPoint &pt)
int quadHorizontal(const SkPoint a[3], SkScalar left, SkScalar right, SkScalar y, bool flipped)
int lineVertical(const SkPoint a[2], SkScalar top, SkScalar bottom, SkScalar x, bool flipped)
int debugLoopCount(DebugLoop) const
int cubicLine(const SkPoint a[4], const SkPoint b[2])
static double VerticalIntercept(const SkDLine &line, double x)
int vertical(const SkDLine &, double top, double bottom, double x, bool flipped)
int closestTo(double rangeStart, double rangeEnd, const SkDPoint &testPt, double *dist) const
int debugCoincidentUsed() const
bool hasOppT(double t) const
SkIntersections(SkDEBUGCODE(SkOpGlobalState *globalState=nullptr))
void alignQuadPts(const SkPoint a[3], const SkPoint b[3])
bool hasT(double t) const
static double HorizontalIntercept(const SkDLine &line, double y)
void debugResetLoopCount()
int cubicHorizontal(const SkPoint a[4], SkScalar left, SkScalar right, SkScalar y, bool flipped)
void debugBumpLoopCount(DebugLoop)
void setCoincident(int index)
void set(bool swap, int tIndex, double t)
int horizontal(const SkDLine &, double left, double right, double y, bool flipped)
bool isCoincident(int index)
int lineHorizontal(const SkPoint a[2], SkScalar left, SkScalar right, SkScalar y, bool flipped)
int conicLine(const SkPoint a[3], SkScalar weight, const SkPoint b[2])
void clearCoincidence(int index)
int quadLine(const SkPoint a[3], const SkPoint b[2])
int mostOutside(double rangeStart, double rangeEnd, const SkDPoint &origin) const
int horizontal(const SkDCubic &, double left, double right, double y, double tRange[3])
virtual int intersectRay(SkIntersections *i, const SkDLine &line) const =0
static float max(float r, float g, float b)
const SkDLine & set(const SkPoint pts[2])
const SkDQuad & set(const SkPoint pts[kPointCount] SkDEBUGPARAMS(SkOpGlobalState *state=nullptr))