27 if (line[0].fX == line[1].fX) {
28 double top = line[0].fY;
29 double bottom = line[1].fY;
30 flipped = top > bottom;
35 result = intersections.
vertical(quad, top, bottom, line[0].fX, flipped);
36 }
else if (line[0].fY == line[1].fY) {
37 double left = line[0].fX;
38 double right = line[1].fX;
53 const SkDLine& line,
const double x,
const double y) {
55 pathStr.
appendf(
" path.moveTo(%1.9g, %1.9g);\n", quad[0].fX, quad[0].fY);
56 pathStr.
appendf(
" path.quadTo(%1.9g, %1.9g, %1.9g, %1.9g);\n", quad[1].fX,
57 quad[1].fY, quad[2].fX, quad[2].fY);
58 pathStr.
appendf(
" path.moveTo(%1.9g, %1.9g);\n", line[0].fX, line[0].fY);
59 pathStr.
appendf(
" path.lineTo(%1.9g, %1.9g);\n", line[1].fX, line[1].fY);
65 for (
int index = 0; index <
result; ++index) {
66 double quadT = intersections[0][index];
68 double lineT = intersections[1][index];
87 int ay =
state.fA >> 2;
88 int bx =
state.fB & 0x03;
89 int by =
state.fB >> 2;
90 int cx =
state.fC & 0x03;
91 int cy =
state.fC >> 2;
92 QuadPts q = {{{(double)
ax, (
double) ay}, {(double) bx, (
double) by},
93 {(double) cx, (
double) cy}}};
97 int order = reducer.
reduce(quad);
101 for (
int tIndex = 0; tIndex <= 4; ++tIndex) {
103 for (
int h = -2;
h <= 2; ++
h) {
104 for (
int v = -2; v <= 2; ++v) {
112 state.fReporter->bumpTestCount();
115 state.fReporter->bumpTestCount();
118 state.fReporter->bumpTestCount();
127 for (
int a = 0;
a < 16; ++
a) {
128 for (
int b = 0 ;
b < 16; ++
b) {
129 for (
int c = 0 ; c < 16; ++c) {
133 if (!
reporter->allowExtendedTest())
goto finish;
void initializeTests(skiatest::Reporter *reporter, const char *test)
static int doIntersect(SkIntersections &intersections, const SkDQuad &quad, const SkDLine &line, bool &flipped)
static void testLineIntersect(skiatest::Reporter *reporter, const SkDQuad &quad, const SkDLine &line, const double x, const double y)
static void testQuadLineIntersectMain(PathOpsThreadState *data)
static bool left(const SkPoint &p0, const SkPoint &p1)
static bool right(const SkPoint &p0, const SkPoint &p1)
void swap(sk_sp< T > &a, sk_sp< T > &b)
#define DEF_TEST(name, reporter)
#define REPORTER_ASSERT(r, cond,...)
SkTDArray< PathOpsThreadedRunnable * > fRunnables
int intersect(const SkDLine &, const SkDLine &)
int vertical(const SkDLine &, double top, double bottom, double x, bool flipped)
int horizontal(const SkDLine &, double left, double right, double y, bool flipped)
void void void appendf(const char format[],...) SK_PRINTF_LIKE(2
SkDPoint fPts[kPointCount]
bool approximatelyEqual(const SkDPoint &a) const
void debugSet(const SkDPoint *pts)
SkDPoint ptAtT(double t) const
int reduce(const SkDCubic &cubic, Quadratics)