68 {
69 size_t index;
71 int order;
72 enum {
73 RunAll,
74 RunPointDegenerates,
75 RunNotPointDegenerates,
76 RunLines,
77 RunNotLines,
78 RunModEpsilonLines,
79 RunLessEpsilonLines,
80 RunNegEpsilonLines,
81 RunQuadraticLines,
82 RunQuadraticPoints,
83 RunQuadraticModLines,
84 RunComputedLines,
85 RunNone
87 int firstTestIndex = 0;
88#if 0
89 run = RunComputedLines;
90 firstTestIndex = 18;
91#endif
92 int firstPointDegeneratesTest =
run == RunAll ? 0 :
run == RunPointDegenerates
94 int firstNotPointDegeneratesTest =
run == RunAll ? 0 :
run == RunNotPointDegenerates
96 int firstLinesTest =
run == RunAll ? 0 :
run == RunLines ? firstTestIndex :
SK_MaxS32;
97 int firstNotLinesTest =
run == RunAll ? 0 :
run == RunNotLines ? firstTestIndex :
SK_MaxS32;
98 int firstModEpsilonTest =
run == RunAll ? 0 :
run == RunModEpsilonLines
100 int firstLessEpsilonTest =
run == RunAll ? 0 :
run == RunLessEpsilonLines
102 int firstNegEpsilonTest =
run == RunAll ? 0 :
run == RunNegEpsilonLines
104 int firstQuadraticPointTest =
run == RunAll ? 0 :
run == RunQuadraticPoints
106 int firstQuadraticLineTest =
run == RunAll ? 0 :
run == RunQuadraticLines
108 int firstQuadraticModLineTest =
run == RunAll ? 0 :
run == RunQuadraticModLines
110#if 0
111 int firstComputedLinesTest =
run == RunAll ? 0 :
run == RunComputedLines
113#endif
120 if (order != 1) {
121 SkDebugf(
"[%d] pointDegenerates order=%d\n",
static_cast<int>(index), order);
123 }
124 }
131 if (order == 1) {
132 SkDebugf(
"[%d] notPointDegenerates order=%d\n",
static_cast<int>(index), order);
135 }
136 }
137 for (index = firstLinesTest; index <
lines_count; ++index) {
143 if (order != 2) {
144 SkDebugf(
"[%d] lines order=%d\n",
static_cast<int>(index), order);
146 }
147 }
148 for (index = firstNotLinesTest; index <
notLines_count; ++index) {
154 if (order == 2) {
155 SkDebugf(
"[%d] notLines order=%d\n",
static_cast<int>(index), order);
157 }
158 }
165 if (order == 2) {
166 SkDebugf(
"[%d] line mod by epsilon order=%d\n",
static_cast<int>(index), order);
168 }
169 }
176 if (order != 2) {
177 SkDebugf(
"[%d] line less by epsilon/2 order=%d\n",
static_cast<int>(index), order);
180 }
181 }
188 if (order != 2) {
189 SkDebugf(
"[%d] line neg by epsilon/2 order=%d\n",
static_cast<int>(index), order);
191 }
192 }
200 if (order != 1) {
201 SkDebugf(
"[%d] point quad order=%d\n",
static_cast<int>(index), order);
203 }
204 }
212 if (order != 2) {
213 SkDebugf(
"[%d] line quad order=%d\n",
static_cast<int>(index), order);
215 }
216 }
224 if (order != 3) {
225 SkDebugf(
"[%d] line mod quad order=%d\n",
static_cast<int>(index), order);
227 }
228 }
229
230#if 0
231
232 for (index = firstComputedLinesTest; index <
lines_count; ++index) {
235 bool controlsInside = controls_inside(
cubic);
237 SkReduceOrder::kStroke_Style);
238 if (order == 2 && reducer.
fLine[0] == reducer.
fLine[1]) {
239 SkDebugf(
"[%d] line computed ends match order=%d\n",
static_cast<int>(index), order);
241 }
242 if (controlsInside) {
247 SkDebugf(
"[%d] line computed ends order=%d\n",
static_cast<int>(index), order);
249 }
250 } else {
251
252
263 SkDebugf(
"[%d] line computed tight bounds order=%d\n",
static_cast<int>(index), order);
265 }
266 }
267 }
268#endif
269}
const size_t quadraticLines_count
const QuadPts quadraticModEpsilonLines[]
const size_t quadraticPoints_count
const size_t quadraticModEpsilonLines_count
const QuadPts quadraticPoints[]
const QuadPts quadraticLines[]
bool ValidCubic(const SkDCubic &cubic)
bool ValidQuad(const SkDQuad &quad)
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static constexpr int32_t SK_MaxS32
bool AlmostEqualUlps(const SkPoint &pt1, const SkPoint &pt2)
#define REPORTER_ASSERT(r, cond,...)
const CubicPts negEpsilonLines[]
const size_t modEpsilonLines_count
const CubicPts lessEpsilonLines[]
const size_t notPointDegenerates_count
const CubicPts notPointDegenerates[]
const size_t lessEpsilonLines_count
const size_t negEpsilonLines_count
const CubicPts pointDegenerates[]
const CubicPts notLines[]
const CubicPts modEpsilonLines[]
const size_t notLines_count
const size_t pointDegenerates_count
Optional< SkRect > bounds
SkDPoint fPts[kPointCount]
SkDPoint fPts[kPointCount]
void debugSet(const SkDPoint *pts)
SkDCubic debugToCubic() const
int reduce(const SkDCubic &cubic, Quadratics)