7#ifndef SkPathOpsCurve_DEFINE
8#define SkPathOpsCurve_DEFINE
30 const SkPoint&
operator[](
int n)
const {
39 fPts[index] = quad[index].asSkPoint();
47 fPts[index] = cubic[index].asSkPoint();
64 const SkDPoint&
operator[](
int n)
const {
75 double s,
double e,
double* topT);
106 double tStart, double tEnd, double* topT);
111 return line.ptAtT(t);
117 return quad.
ptAtT(t);
122 conic.set(
a, weight);
123 return conic.ptAtT(t);
129 return cubic.ptAtT(t);
191 return line[1] - line[0];
202 conic.set(
a, weight);
203 return conic.dxdyAtT(t);
209 return cubic.dxdyAtT(t);
271 SkDPoint dst[2] = { line.ptAtT(startT), line.ptAtT(endT) };
284 conic.set(
a, weight);
285 SkDConic dst = conic.subDivide(startT, endT);
292 SkDCubic dst = cubic.subDivide(startT, endT);
322 conic.set(
a, weight);
367 if (
a[0].fY ==
a[1].fY) {
372 return between(0, roots[0], 1);
376 if (
a[0].fX ==
a[1].fX) {
381 return between(0, roots[0], 1);
406 return cubic.set(
a).horizontalIntersect(
y, roots);
411 return cubic.set(
a).verticalIntersect(
x, roots);
static bool between(SkScalar a, SkScalar b, SkScalar c)
static SkDVector dline_dxdy_at_t(const SkPoint a[2], SkScalar, double)
static SkPoint fline_xy_at_t(const SkPoint a[2], SkScalar weight, double t)
static SkDPoint dconic_xy_at_t(const SkPoint a[3], SkScalar weight, double t)
static SkDVector dquad_dxdy_at_t(const SkPoint a[3], SkScalar, double t)
static int conic_intercept_v(const SkPoint a[2], SkScalar w, SkScalar x, double *roots)
static SkDPoint(*const CurveDPointAtT[])(const SkPoint[], SkScalar, double)
static void quad_intersect_ray(const SkPoint a[3], SkScalar, const SkDLine &ray, SkIntersections *i)
static void dcubic_intersect_ray(const SkDCurve &c, const SkDLine &ray, SkIntersections *i)
static SkDPoint dline_xy_at_t(const SkPoint a[2], SkScalar, double t)
static SkDVector dcubic_dxdy_at_t(const SkPoint a[4], SkScalar, double t)
static bool conic_is_vertical(const SkPoint a[3], SkScalar weight, double startT, double endT)
static void conic_intersect_ray(const SkPoint a[3], SkScalar weight, const SkDLine &ray, SkIntersections *i)
static bool quad_is_vertical(const SkPoint a[3], SkScalar, double startT, double endT)
static void line_intersect_ray(const SkPoint a[2], SkScalar, const SkDLine &ray, SkIntersections *i)
static int quad_intercept_h(const SkPoint a[2], SkScalar, SkScalar y, double *roots)
static SkDPoint dquad_xy_at_t(const SkPoint a[3], SkScalar, double t)
static SkVector fconic_dxdy_at_t(const SkPoint a[3], SkScalar weight, double t)
static void cubic_intersect_ray(const SkPoint a[4], SkScalar, const SkDLine &ray, SkIntersections *i)
static bool cubic_is_vertical(const SkPoint a[4], SkScalar, double startT, double endT)
static int quad_intercept_v(const SkPoint a[2], SkScalar, SkScalar x, double *roots)
static void dline_intersect_ray(const SkDCurve &c, const SkDLine &ray, SkIntersections *i)
static void dconic_intersect_ray(const SkDCurve &c, const SkDLine &ray, SkIntersections *i)
static SkDVector(*const CurveDDSlopeAtT[])(const SkDCurve &, double)
static SkPoint fconic_xy_at_t(const SkPoint a[3], SkScalar weight, double t)
static SkDVector ddconic_dxdy_at_t(const SkDCurve &c, double t)
static SkDVector ddquad_dxdy_at_t(const SkDCurve &c, double t)
static SkDVector ddcubic_dxdy_at_t(const SkDCurve &c, double t)
static SkDPoint ddconic_xy_at_t(const SkDCurve &c, double t)
static SkDVector ddline_dxdy_at_t(const SkDCurve &c, double)
static bool line_is_vertical(const SkPoint a[2], SkScalar, double startT, double endT)
static bool(*const CurveIsVertical[])(const SkPoint[], SkScalar, double, double)
static SkPoint fcubic_xy_at_t(const SkPoint a[4], SkScalar weight, double t)
static int(*const CurveIntercept[])(const SkPoint[], SkScalar, SkScalar, double *)
static void dquad_intersect_ray(const SkDCurve &c, const SkDLine &ray, SkIntersections *i)
static SkPoint fquad_xy_at_t(const SkPoint a[3], SkScalar weight, double t)
static SkDVector(*const CurveDSlopeAtT[])(const SkPoint[], SkScalar, double)
static int line_intercept_h(const SkPoint a[2], SkScalar, SkScalar y, double *roots)
static void(*const CurveDIntersectRay[])(const SkDCurve &, const SkDLine &, SkIntersections *)
static SkPoint(*const CurvePointAtT[])(const SkPoint[], SkScalar, double)
static SkDPoint dcubic_xy_at_t(const SkPoint a[4], SkScalar, double t)
static SkVector fcubic_dxdy_at_t(const SkPoint a[4], SkScalar weight, double t)
SkDPoint(SkDCurve::*const Top[])(const SkPoint curve[], SkScalar cWeight, double tStart, double tEnd, double *topT)
static SkDPoint(*const CurveDDPointAtT[])(const SkDCurve &, double)
static void(*const CurveIntersectRay[])(const SkPoint[], SkScalar, const SkDLine &, SkIntersections *)
static int cubic_intercept_h(const SkPoint a[3], SkScalar, SkScalar y, double *roots)
static int conic_intercept_h(const SkPoint a[2], SkScalar w, SkScalar y, double *roots)
static SkDPoint ddline_xy_at_t(const SkDCurve &c, double t)
static SkDPoint ddcubic_xy_at_t(const SkDCurve &c, double t)
static SkVector fquad_dxdy_at_t(const SkPoint a[3], SkScalar weight, double t)
static SkVector(*const CurveSlopeAtT[])(const SkPoint[], SkScalar, double)
static SkDPoint ddquad_xy_at_t(const SkDCurve &c, double t)
static int line_intercept_v(const SkPoint a[2], SkScalar, SkScalar x, double *roots)
static SkDVector dconic_dxdy_at_t(const SkPoint a[3], SkScalar weight, double t)
static SkVector fline_dxdy_at_t(const SkPoint a[2], SkScalar, double)
static int cubic_intercept_v(const SkPoint a[3], SkScalar, SkScalar x, double *roots)
bool AlmostEqualUlps(const SkPoint &pt1, const SkPoint &pt2)
int SkPathOpsVerbToPoints(SkPath::Verb verb)
Type::kYUV Type::kRGBA() int(0.7 *637)
void setCurveHullSweep(SkPath::Verb verb)
int intersectRay(const SkDLine &, const SkDLine &)
static double VerticalIntercept(const SkDLine &line, double x)
static double HorizontalIntercept(const SkDLine &line, double y)
SkDPoint ptAtT(double t) const
SkDVector dxdyAtT(double t) const
SkDVector dxdyAtT(double t) const
SkDPoint ptAtT(double t) const
static const int kPointCount
void setCubicBounds(const SkPoint curve[4], SkScalar, double s, double e, SkPathOpsBounds *)
void setConicBounds(const SkPoint curve[3], SkScalar curveWeight, double s, double e, SkPathOpsBounds *)
SkDEBUGCODE(SkPath::Verb fVerb;) const SkDPoint &operator[](int n) const
double nearPoint(SkPath::Verb verb, const SkDPoint &xy, const SkDPoint &opp) const
SkDPoint & operator[](int n)
SkDPoint lineTop(const SkPoint[2], SkScalar, double, double, double *topT)
SkDPoint conicTop(const SkPoint curve[3], SkScalar curveWeight, double s, double e, double *topT)
void setQuadBounds(const SkPoint curve[3], SkScalar, double s, double e, SkPathOpsBounds *)
SkDPoint quadTop(const SkPoint curve[3], SkScalar, double s, double e, double *topT)
SkDPoint cubicTop(const SkPoint curve[4], SkScalar, double s, double e, double *topT)
SkDPoint ptAtT(double t) const
SkPoint asSkPoint() const
const SkDQuad & set(const SkPoint pts[kPointCount] SkDEBUGPARAMS(SkOpGlobalState *state=nullptr))
SkDQuad subDivide(double t1, double t2) const
SkDPoint ptAtT(double t) const
SkDVector dxdyAtT(double t) const
static const int kPointCount
SkVector asSkVector() const
void set(const SkDQuad &quad)
void set(const SkDCubic &cubic)
SkDEBUGCODE(SkPath::Verb fVerb;) const SkPoint &operator[](int n) const