30 bool areCusps =
false;
31 float inflectT[2], convex180T[2];
41 for (
int i = 0;
i < convex180N; ++
i) {
50 for (
int i = 0;
i <= convex180N; ++
i) {
79 for (
int i = 0;
i < (1 << 8); ++
i) {
89 static const uint32_t hexPts[] = {0x3ee0ac74, 0x3f1e061a, 0x3e0fc408, 0x3f457230,
90 0x3f42ac7c, 0x3f70d76c, 0x3f4e6520, 0x3f6acafa};
92 memcpy(
p, hexPts,
sizeof(
p));
97 SkPoint quad[4] = {{0,0}, {2,2}, {4,2}, {6,0}};
103 SkPoint cusp[4] = {{0,0}, {1,1}, {1,0}, {0,1}};
109 constexpr static double kEpsilon = 1.0 / (1 << 11);
111 double h = (1 - kEpsilonSquared) / (3 * kEpsilonSquared + 1);
112 double dy = (1 -
h) / 2;
119 cusp[1].
fY = (
float)(1 - 1.1 * dy);
120 cusp[2].
fY = (
float)(0 + 1.1 * dy);
125 cusp[1].
fY = (
float)(1 - .9 * dy);
126 cusp[2].
fY = (
float)(0 + .9 * dy);
static constexpr double kEpsilon
float SkMeasureNonInflectCubicRotation(const SkPoint pts[4])
void SkChopCubicAt(const SkPoint src[4], SkPoint dst[7], SkScalar t)
int SkFindCubicInflections(const SkPoint src[4], SkScalar tValues[2])
static bool SkScalarNearlyZero(SkScalar x, SkScalar tolerance=SK_ScalarNearlyZero)
static bool SkScalarNearlyEqual(SkScalar x, SkScalar y, SkScalar tolerance=SK_ScalarNearlyZero)
#define SK_ScalarNearlyZero
#define REPORTER_ASSERT(r, cond,...)
int64_t cross(Point d0, Point d1)
DEF_TEST(CullTestTest, reporter)
static bool is_linear(SkPoint p0, SkPoint p1, SkPoint p2)
int FindCubicConvex180Chops(const SkPoint pts[], float T[2], bool *areCusps)
static void check_cubic_convex_180(skiatest::Reporter *r, const SkPoint p[4])
static constexpr SkPoint Make(float x, float y)