8#ifndef SkGeometry_DEFINED
9#define SkGeometry_DEFINED
317 double d[4] =
nullptr);
329 this->
set(p0, p1, p2,
w);
442 return (fA * tt + fB) * tt + fC;
459 fNumer.fA = p2 -
times_2(p1w) + p0;
463 fDenom.fB =
times_2(ww - fDenom.fC);
464 fDenom.fA = 0 - fDenom.fB;
471 return numer / denom;
485 fA = P3 + three * (P1 - P2) - P0;
486 fB = three * (P2 -
times_2(P1) + P0);
487 fC = three * (P1 - P0);
492 return ((fA * t + fB) * t + fC) * t + fD;
525 int pow2 =
conic.computeQuadPOW2(tol);
526 fQuadCount = 1 << pow2;
528 fQuadCount =
conic.chopIntoQuadsPOW2(pts, pow2);
535 conic.set(pts, weight);
544 kPointCount = 1 + 2 * kQuadCount,
#define SK_ABORT(message,...)
static bool SkIsFinite(T x, Pack... values)
void SkChopCubicAtMidTangent(const SkPoint src[4], SkPoint dst[7])
void SkChopQuadAt(const SkPoint src[3], SkPoint dst[5], SkScalar t)
float SkFindQuadMidTangent(const SkPoint src[3])
static const char * SkCubicTypeName(SkCubicType type)
int SkChopQuadAtXExtrema(const SkPoint src[3], SkPoint dst[5])
SkPoint SkEvalQuadTangentAt(const SkPoint src[3], SkScalar t)
SkCubicType SkClassifyCubic(const SkPoint p[4], double t[2]=nullptr, double s[2]=nullptr, double d[4]=nullptr)
int SkChopCubicAtYExtrema(const SkPoint src[4], SkPoint dst[10])
void SkChopCubicAtHalf(const SkPoint src[4], SkPoint dst[7])
int SkChopCubicAtInflections(const SkPoint src[4], SkPoint dst[10])
void SkChopCubicAt(const SkPoint src[4], SkPoint dst[7], SkScalar t)
int SkFindUnitQuadRoots(SkScalar A, SkScalar B, SkScalar C, SkScalar roots[2])
SkVector SkFindBisector(SkVector, SkVector)
void SkChopQuadAtHalf(const SkPoint src[3], SkPoint dst[5])
SkScalar SkFindCubicCusp(const SkPoint src[4])
void SkConvertQuadToCubic(const SkPoint src[3], SkPoint dst[4])
void SkChopQuadAtMidTangent(const SkPoint src[3], SkPoint dst[5])
SkScalar SkFindQuadMaxCurvature(const SkPoint src[3])
static skvx::float2 times_2(const skvx::float2 &value)
@ kCW_SkRotationDirection
@ kCCW_SkRotationDirection
int SkFindCubicExtrema(SkScalar a, SkScalar b, SkScalar c, SkScalar d, SkScalar tValues[2])
int SkChopCubicAtMaxCurvature(const SkPoint src[4], SkPoint dst[13], SkScalar tValues[3]=nullptr)
float SkMeasureNonInflectCubicRotation(const SkPoint[4])
SkPoint SkEvalQuadAt(const SkPoint src[3], SkScalar t)
int SkFindCubicMaxCurvature(const SkPoint src[4], SkScalar tValues[3])
static skvx::float2 from_point(const SkPoint &point)
bool SkChopMonoCubicAtY(const SkPoint src[4], SkScalar y, SkPoint dst[7])
int SkChopCubicAtXExtrema(const SkPoint src[4], SkPoint dst[10])
static SkPoint to_point(const skvx::float2 &x)
float SkFindCubicMidTangent(const SkPoint src[4])
static bool SkCubicIsDegenerate(SkCubicType type)
int SkFindQuadExtrema(SkScalar a, SkScalar b, SkScalar c, SkScalar tValues[1])
int SkFindCubicInflections(const SkPoint src[4], SkScalar tValues[2])
bool SkChopMonoCubicAtX(const SkPoint src[4], SkScalar x, SkPoint dst[7])
void SkEvalCubicAt(const SkPoint src[4], SkScalar t, SkPoint *locOrNull, SkVector *tangentOrNull, SkVector *curvatureOrNull)
float SkMeasureAngleBetweenVectors(SkVector, SkVector)
float SkMeasureQuadRotation(const SkPoint pts[3])
int SkChopQuadAtMaxCurvature(const SkPoint src[3], SkPoint dst[5])
int SkChopQuadAtYExtrema(const SkPoint src[3], SkPoint dst[5])
const SkPoint * computeQuads(const SkPoint pts[3], SkScalar weight, SkScalar tol)
const SkPoint * computeQuads(const SkConic &conic, SkScalar tol)
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Optional< SkRect > bounds
bool findXExtrema(SkScalar *t) const
int SK_SPI chopIntoQuadsPOW2(SkPoint pts[], int pow2) const
SkVector evalTangentAt(SkScalar t) const
bool chopAtYExtrema(SkConic dst[2]) const
SkConic(const SkPoint &p0, const SkPoint &p1, const SkPoint &p2, SkScalar w)
void computeTightBounds(SkRect *bounds) const
int SK_SPI computeQuadPOW2(SkScalar tol) const
static SkScalar TransformW(const SkPoint[3], SkScalar w, const SkMatrix &)
void computeAsQuadError(SkVector *err) const
bool findYExtrema(SkScalar *t) const
SkConic(const SkPoint pts[3], SkScalar w)
bool chopAtXExtrema(SkConic dst[2]) const
float findMidTangent() const
void evalAt(SkScalar t, SkPoint *pos, SkVector *tangent=nullptr) const
bool chopAt(SkScalar t, SkConic dst[2]) const
bool asQuadTol(SkScalar tol) const
void set(const SkPoint pts[3], SkScalar w)
void set(const SkPoint &p0, const SkPoint &p1, const SkPoint &p2, SkScalar w)
void chop(SkConic dst[2]) const
static int BuildUnitArc(const SkVector &start, const SkVector &stop, SkRotationDirection, const SkMatrix *, SkConic conics[kMaxConicsForArc])
void computeFastBounds(SkRect *bounds) const
static SKVX_ALWAYS_INLINE Vec Load(const void *ptr)