quads;
double precision = calcPrecision(cubic);
(void) cubic_to_quadratics(cubic, precision, quads);
int count = quads.count();
SkASSERT(count > 0);
SkASSERT(--count < arrayMax);
quadDist[count]++;
int sCount = sampleCount[count];
if (sCount < sampleMax) {
memcpy(samples[count][sCount], cubic, sizeof(Cubic));
sampleCount[count]++;
}
}
for (int x = 0; x < arrayMax; ++x) {
if (!quadDist[x]) {
continue;
}
SkDebugf("%d %1.9g%%\n", x + 1, (double) quadDist[x] / tests * 100);
}
SkDebugf("\n");
for (int x = 0; x < arrayMax; ++x) {
for (int y = 0; y < sampleCount[x]; ++y) {
#if TEST_AVERAGE_END_POINTS
for (int w = 0; w < 2; ++w) {
AVERAGE_END_POINTS = w;
#else
int w = 0;
#endif
SkDebugf("\n", x + 1, y, w ? "x" : "");
const Cubic& cubic = samples[x][y];
SkDebugf("{{%1.9g, %1.9g}, {%1.9g, %1.9g}, {%1.9g, %1.9g}, {%1.9g, %1.9g}},\n",
cubic[0].x, cubic[0].y, cubic[1].x, cubic[1].y, cubic[2].x, cubic[2].y,
cubic[3].x, cubic[3].y);
SkTDArray quads;
double precision = calcPrecision(cubic);
(void) cubic_to_quadratics(cubic, precision, quads);
for (int z = 0; z < quads.count(); ++z) {
const Quadratic& quad = quads[z];
SkDebugf("{{%1.9g, %1.9g}, {%1.9g, %1.9g}, {%1.9g, %1.9g}},\n",
quad[0].x, quad[0].y, quad[1].x, quad[1].y, quad[2].x, quad[2].y);
}
SkDebugf("
\n\n");
#if TEST_AVERAGE_END_POINTS
}
#endif
}
}
SkDebugf("