blob: 356f1723b6e1a723d9bede77294601387a3c7a63 [file] [log] [blame]
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001/*
2 * Copyright 2012 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7#include "PathOpsExtendedTest.h"
8
9#define TEST(name) { name, #name }
10
11static void testLine1(skiatest::Reporter* reporter) {
12 SkPath path;
13 path.moveTo(2,0);
14 path.lineTo(1,1);
15 path.lineTo(0,0);
16 path.close();
17 testSimplify(reporter, path);
18}
19
20static void testLine1x(skiatest::Reporter* reporter) {
21 SkPath path;
22 path.setFillType(SkPath::kEvenOdd_FillType);
23 path.moveTo(2,0);
24 path.lineTo(1,1);
25 path.lineTo(0,0);
26 path.close();
27 testSimplify(reporter, path);
28}
29
30static void addInnerCWTriangle(SkPath& path) {
31 path.moveTo(3,0);
32 path.lineTo(4,1);
33 path.lineTo(2,1);
34 path.close();
35}
36
37static void addInnerCCWTriangle(SkPath& path) {
38 path.moveTo(3,0);
39 path.lineTo(2,1);
40 path.lineTo(4,1);
41 path.close();
42}
43
44static void addOuterCWTriangle(SkPath& path) {
45 path.moveTo(3,0);
46 path.lineTo(6,2);
47 path.lineTo(0,2);
48 path.close();
49}
50
51static void addOuterCCWTriangle(SkPath& path) {
52 path.moveTo(3,0);
53 path.lineTo(0,2);
54 path.lineTo(6,2);
55 path.close();
56}
57
58static void testLine2(skiatest::Reporter* reporter) {
59 SkPath path;
60 path.setFillType(SkPath::kEvenOdd_FillType);
61 addInnerCWTriangle(path);
62 addOuterCWTriangle(path);
63 testSimplify(reporter, path);
64}
65
66static void testLine2x(skiatest::Reporter* reporter) {
67 SkPath path;
68 path.setFillType(SkPath::kEvenOdd_FillType);
69 addInnerCWTriangle(path);
70 addOuterCWTriangle(path);
71 testSimplify(reporter, path);
72}
73
74static void testLine3(skiatest::Reporter* reporter) {
75 SkPath path;
76 path.setFillType(SkPath::kEvenOdd_FillType);
77 addInnerCCWTriangle(path);
78 addOuterCWTriangle(path);
79 testSimplify(reporter, path);
80}
81
82static void testLine3x(skiatest::Reporter* reporter) {
83 SkPath path;
84 path.setFillType(SkPath::kEvenOdd_FillType);
85 addInnerCCWTriangle(path);
86 addOuterCWTriangle(path);
87 testSimplify(reporter, path);
88}
89
90static void testLine3a(skiatest::Reporter* reporter) {
91 SkPath path;
92 addInnerCWTriangle(path);
93 addOuterCCWTriangle(path);
94 testSimplify(reporter, path);
95}
96
97static void testLine3ax(skiatest::Reporter* reporter) {
98 SkPath path;
99 path.setFillType(SkPath::kEvenOdd_FillType);
100 addInnerCWTriangle(path);
101 addOuterCCWTriangle(path);
102 testSimplify(reporter, path);
103}
104
105static void testLine3b(skiatest::Reporter* reporter) {
106 SkPath path;
107 addInnerCCWTriangle(path);
108 addOuterCCWTriangle(path);
109 testSimplify(reporter, path);
110}
111
112static void testLine3bx(skiatest::Reporter* reporter) {
113 SkPath path;
114 path.setFillType(SkPath::kEvenOdd_FillType);
115 addInnerCCWTriangle(path);
116 addOuterCCWTriangle(path);
117 testSimplify(reporter, path);
118}
119
120static void testLine4(skiatest::Reporter* reporter) {
121 SkPath path;
122 addOuterCCWTriangle(path);
123 addOuterCWTriangle(path);
124 testSimplify(reporter, path);
125}
126
127static void testLine4x(skiatest::Reporter* reporter) {
128 SkPath path;
129 path.setFillType(SkPath::kEvenOdd_FillType);
130 addOuterCCWTriangle(path);
131 addOuterCWTriangle(path);
132 testSimplify(reporter, path);
133}
134
135static void testLine5(skiatest::Reporter* reporter) {
136 SkPath path;
137 addOuterCWTriangle(path);
138 addOuterCWTriangle(path);
139 testSimplify(reporter, path);
140}
141
142static void testLine5x(skiatest::Reporter* reporter) {
143 SkPath path;
144 path.setFillType(SkPath::kEvenOdd_FillType);
145 addOuterCWTriangle(path);
146 addOuterCWTriangle(path);
147 testSimplify(reporter, path);
148}
149
150static void testLine6(skiatest::Reporter* reporter) {
151 SkPath path;
152 path.moveTo(0,0);
153 path.lineTo(4,0);
154 path.lineTo(2,2);
155 path.close();
156 path.moveTo(2,0);
157 path.lineTo(6,0);
158 path.lineTo(4,2);
159 path.close();
160 testSimplify(reporter, path);
161}
162
163static void testLine6x(skiatest::Reporter* reporter) {
164 SkPath path;
165 path.setFillType(SkPath::kEvenOdd_FillType);
166 path.moveTo(0,0);
167 path.lineTo(4,0);
168 path.lineTo(2,2);
169 path.close();
170 path.moveTo(2,0);
171 path.lineTo(6,0);
172 path.lineTo(4,2);
173 path.close();
174 testSimplify(reporter, path);
175}
176
177static void testLine7(skiatest::Reporter* reporter) {
178 SkPath path;
179 path.moveTo(0,0);
180 path.lineTo(4,0);
181 path.lineTo(2,2);
182 path.close();
183 path.moveTo(6,0);
184 path.lineTo(2,0);
185 path.lineTo(4,2);
186 path.close();
187 testSimplify(reporter, path);
188}
189
190static void testLine7x(skiatest::Reporter* reporter) {
191 SkPath path;
192 path.setFillType(SkPath::kEvenOdd_FillType);
193 path.moveTo(0,0);
194 path.lineTo(4,0);
195 path.lineTo(2,2);
196 path.close();
197 path.moveTo(6,0);
198 path.lineTo(2,0);
199 path.lineTo(4,2);
200 path.close();
201 testSimplify(reporter, path);
202}
203
204static void testLine7a(skiatest::Reporter* reporter) {
205 SkPath path;
206 path.moveTo(0,0);
207 path.lineTo(4,0);
208 path.lineTo(2,2);
209 path.close();
210 testSimplify(reporter, path);
211}
212
213static void testLine7ax(skiatest::Reporter* reporter) {
214 SkPath path;
215 path.setFillType(SkPath::kEvenOdd_FillType);
216 path.moveTo(0,0);
217 path.lineTo(4,0);
218 path.lineTo(2,2);
219 path.close();
220 testSimplify(reporter, path);
221}
222
223static void testLine7b(skiatest::Reporter* reporter) {
224 SkPath path;
225 path.moveTo(0,0);
226 path.lineTo(4,0);
227 path.close();
228 path.moveTo(6,0);
229 path.lineTo(2,0);
230 path.lineTo(4,2);
231 path.close();
232 testSimplify(reporter, path);
233}
234
235static void testLine7bx(skiatest::Reporter* reporter) {
236 SkPath path;
237 path.setFillType(SkPath::kEvenOdd_FillType);
238 path.moveTo(0,0);
239 path.lineTo(4,0);
240 path.close();
241 path.moveTo(6,0);
242 path.lineTo(2,0);
243 path.lineTo(4,2);
244 path.close();
245 testSimplify(reporter, path);
246}
247
248static void testLine8(skiatest::Reporter* reporter) {
249 SkPath path;
250 path.moveTo(0,4);
251 path.lineTo(4,4);
252 path.lineTo(2,2);
253 path.close();
254 path.moveTo(2,4);
255 path.lineTo(6,4);
256 path.lineTo(4,2);
257 path.close();
258 testSimplify(reporter, path);
259}
260
261static void testLine8x(skiatest::Reporter* reporter) {
262 SkPath path;
263 path.setFillType(SkPath::kEvenOdd_FillType);
264 path.moveTo(0,4);
265 path.lineTo(4,4);
266 path.lineTo(2,2);
267 path.close();
268 path.moveTo(2,4);
269 path.lineTo(6,4);
270 path.lineTo(4,2);
271 path.close();
272 testSimplify(reporter, path);
273}
274
275static void testLine9(skiatest::Reporter* reporter) {
276 SkPath path;
277 path.moveTo(0,4);
278 path.lineTo(4,4);
279 path.lineTo(2,2);
280 path.close();
281 path.moveTo(6,4);
282 path.lineTo(2,4);
283 path.lineTo(4,2);
284 path.close();
285 testSimplify(reporter, path);
286}
287
288static void testLine9x(skiatest::Reporter* reporter) {
289 SkPath path;
290 path.setFillType(SkPath::kEvenOdd_FillType);
291 path.moveTo(0,4);
292 path.lineTo(4,4);
293 path.lineTo(2,2);
294 path.close();
295 path.moveTo(6,4);
296 path.lineTo(2,4);
297 path.lineTo(4,2);
298 path.close();
299 testSimplify(reporter, path);
300}
301
302static void testLine10(skiatest::Reporter* reporter) {
303 SkPath path;
304 path.moveTo(0,4);
305 path.lineTo(4,4);
306 path.lineTo(2,2);
307 path.close();
308 path.moveTo(2,1);
309 path.lineTo(3,4);
310 path.lineTo(6,1);
311 path.close();
312 testSimplify(reporter, path);
313}
314
315static void testLine10x(skiatest::Reporter* reporter) {
316 SkPath path;
317 path.setFillType(SkPath::kEvenOdd_FillType);
318 path.moveTo(0,4);
319 path.lineTo(4,4);
320 path.lineTo(2,2);
321 path.close();
322 path.moveTo(2,1);
323 path.lineTo(3,4);
324 path.lineTo(6,1);
325 path.close();
326 testSimplify(reporter, path);
327}
328
329static void testLine10a(skiatest::Reporter* reporter) {
330 SkPath path;
331 path.moveTo(0,4);
332 path.lineTo(8,4);
333 path.lineTo(4,0);
334 path.close();
335 path.moveTo(2,2);
336 path.lineTo(3,3);
337 path.lineTo(4,2);
338 path.close();
339 testSimplify(reporter, path);
340}
341
342static void testLine10ax(skiatest::Reporter* reporter) {
343 SkPath path;
344 path.setFillType(SkPath::kEvenOdd_FillType);
345 path.moveTo(0,4);
346 path.lineTo(8,4);
347 path.lineTo(4,0);
348 path.close();
349 path.moveTo(2,2);
350 path.lineTo(3,3);
351 path.lineTo(4,2);
352 path.close();
353 testSimplify(reporter, path);
354}
355
356static void addCWContainer(SkPath& path) {
357 path.moveTo(6,4);
358 path.lineTo(0,4);
359 path.lineTo(3,1);
360 path.close();
361}
362
363static void addCCWContainer(SkPath& path) {
364 path.moveTo(0,4);
365 path.lineTo(6,4);
366 path.lineTo(3,1);
367 path.close();
368}
369
370static void addCWContents(SkPath& path) {
371 path.moveTo(2,3);
372 path.lineTo(3,2);
373 path.lineTo(4,3);
374 path.close();
375}
376
377static void addCCWContents(SkPath& path) {
378 path.moveTo(3,2);
379 path.lineTo(2,3);
380 path.lineTo(4,3);
381 path.close();
382}
383
384static void testLine11(skiatest::Reporter* reporter) {
385 SkPath path;
386 addCWContainer(path);
387 addCWContents(path);
388 testSimplify(reporter, path);
389}
390
391static void testLine11x(skiatest::Reporter* reporter) {
392 SkPath path;
393 path.setFillType(SkPath::kEvenOdd_FillType);
394 addCWContainer(path);
395 addCWContents(path);
396 testSimplify(reporter, path);
397}
398
399static void testLine12(skiatest::Reporter* reporter) {
400 SkPath path;
401 addCCWContainer(path);
402 addCWContents(path);
403 testSimplify(reporter, path);
404}
405
406static void testLine12x(skiatest::Reporter* reporter) {
407 SkPath path;
408 path.setFillType(SkPath::kEvenOdd_FillType);
409 addCCWContainer(path);
410 addCWContents(path);
411 testSimplify(reporter, path);
412}
413
414static void testLine13(skiatest::Reporter* reporter) {
415 SkPath path;
416 addCWContainer(path);
417 addCCWContents(path);
418 testSimplify(reporter, path);
419}
420
421static void testLine13x(skiatest::Reporter* reporter) {
422 SkPath path;
423 path.setFillType(SkPath::kEvenOdd_FillType);
424 addCWContainer(path);
425 addCCWContents(path);
426 testSimplify(reporter, path);
427}
428
429static void testLine14(skiatest::Reporter* reporter) {
430 SkPath path;
431 addCCWContainer(path);
432 addCCWContents(path);
433 testSimplify(reporter, path);
434}
435
436static void testLine14x(skiatest::Reporter* reporter) {
437 SkPath path;
438 path.setFillType(SkPath::kEvenOdd_FillType);
439 addCCWContainer(path);
440 addCCWContents(path);
441 testSimplify(reporter, path);
442}
443
444static void testLine15(skiatest::Reporter* reporter) {
445 SkPath path;
446 path.addRect(0, 0, 9, 9, SkPath::kCW_Direction);
447 testSimplify(reporter, path);
448}
449
450static void testLine15x(skiatest::Reporter* reporter) {
451 SkPath path;
452 path.setFillType(SkPath::kEvenOdd_FillType);
453 path.addRect(0, 0, 9, 9, SkPath::kCW_Direction);
454 testSimplify(reporter, path);
455}
456
457static void testLine16(skiatest::Reporter* reporter) {
458 SkPath path;
459 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
460 path.addRect(0, 4, 9, 9, SkPath::kCW_Direction);
461 testSimplify(reporter, path);
462}
463
464static void testLine16x(skiatest::Reporter* reporter) {
465 SkPath path;
466 path.setFillType(SkPath::kEvenOdd_FillType);
467 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
468 path.addRect(0, 4, 9, 9, SkPath::kCW_Direction);
469 testSimplify(reporter, path);
470}
471
472static void testLine17(skiatest::Reporter* reporter) {
473 SkPath path;
474 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
475 path.addRect(4, 12, 13, 13, SkPath::kCW_Direction);
476 testSimplify(reporter, path);
477}
478
479static void testLine17x(skiatest::Reporter* reporter) {
480 SkPath path;
481 path.setFillType(SkPath::kEvenOdd_FillType);
482 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
483 path.addRect(4, 12, 13, 13, SkPath::kCW_Direction);
484 testSimplify(reporter, path);
485}
486
487static void testLine18(skiatest::Reporter* reporter) {
488 SkPath path;
489 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
490 path.addRect(12, 4, 21, 21, SkPath::kCW_Direction);
491 testSimplify(reporter, path);
492}
493
494static void testLine18x(skiatest::Reporter* reporter) {
495 SkPath path;
496 path.setFillType(SkPath::kEvenOdd_FillType);
497 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
498 path.addRect(12, 4, 21, 21, SkPath::kCW_Direction);
499 testSimplify(reporter, path);
500}
501
502static void testLine19(skiatest::Reporter* reporter) {
503 SkPath path;
504 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
505 path.addRect(12, 16, 21, 21, SkPath::kCW_Direction);
506 testSimplify(reporter, path);
507}
508
509static void testLine19x(skiatest::Reporter* reporter) {
510 SkPath path;
511 path.setFillType(SkPath::kEvenOdd_FillType);
512 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
513 path.addRect(12, 16, 21, 21, SkPath::kCW_Direction);
514 testSimplify(reporter, path);
515}
516
517static void testLine20(skiatest::Reporter* reporter) {
518 SkPath path;
519 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
520 path.addRect(0, 12, 9, 9, SkPath::kCW_Direction);
521 testSimplify(reporter, path);
522}
523
524static void testLine20x(skiatest::Reporter* reporter) {
525 SkPath path;
526 path.setFillType(SkPath::kEvenOdd_FillType);
527 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
528 path.addRect(0, 12, 9, 9, SkPath::kCW_Direction);
529 testSimplify(reporter, path);
530}
531
532static void testLine21(skiatest::Reporter* reporter) {
533 SkPath path;
534 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
535 path.addRect(0, 16, 9, 9, SkPath::kCW_Direction);
536 testSimplify(reporter, path);
537}
538
539static void testLine21x(skiatest::Reporter* reporter) {
540 SkPath path;
541 path.setFillType(SkPath::kEvenOdd_FillType);
542 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
543 path.addRect(0, 16, 9, 9, SkPath::kCW_Direction);
544 testSimplify(reporter, path);
545}
546
547static void testLine22(skiatest::Reporter* reporter) {
548 SkPath path;
549 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
550 path.addRect(4, 12, 13, 13, SkPath::kCW_Direction);
551 testSimplify(reporter, path);
552}
553
554static void testLine22x(skiatest::Reporter* reporter) {
555 SkPath path;
556 path.setFillType(SkPath::kEvenOdd_FillType);
557 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
558 path.addRect(4, 12, 13, 13, SkPath::kCW_Direction);
559 testSimplify(reporter, path);
560}
561
562static void testLine23(skiatest::Reporter* reporter) {
563 SkPath path;
564 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
565 path.addRect(12, 0, 21, 21, SkPath::kCW_Direction);
566 testSimplify(reporter, path);
567}
568
569static void testLine23x(skiatest::Reporter* reporter) {
570 SkPath path;
571 path.setFillType(SkPath::kEvenOdd_FillType);
572 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
573 path.addRect(12, 0, 21, 21, SkPath::kCW_Direction);
574 testSimplify(reporter, path);
575}
576
577static void testLine24a(skiatest::Reporter* reporter) {
578 SkPath path;
579 path.moveTo(2,0);
580 path.lineTo(4,4);
581 path.lineTo(0,4);
582 path.close();
583 path.moveTo(2,0);
584 path.lineTo(1,2);
585 path.lineTo(2,2);
586 path.close();
587 testSimplify(reporter, path);
588}
589
590static void testLine24ax(skiatest::Reporter* reporter) {
591 SkPath path;
592 path.setFillType(SkPath::kEvenOdd_FillType);
593 path.moveTo(2,0);
594 path.lineTo(4,4);
595 path.lineTo(0,4);
596 path.close();
597 path.moveTo(2,0);
598 path.lineTo(1,2);
599 path.lineTo(2,2);
600 path.close();
601 testSimplify(reporter, path);
602}
603
604static void testLine24(skiatest::Reporter* reporter) {
605 SkPath path;
606 path.addRect(0, 18, 12, 12, SkPath::kCW_Direction);
607 path.addRect(4, 12, 13, 13, SkPath::kCW_Direction);
608 testSimplify(reporter, path);
609}
610
611static void testLine24x(skiatest::Reporter* reporter) {
612 SkPath path;
613 path.setFillType(SkPath::kEvenOdd_FillType);
614 path.addRect(0, 18, 12, 12, SkPath::kCW_Direction);
615 path.addRect(4, 12, 13, 13, SkPath::kCW_Direction);
616 testSimplify(reporter, path);
617}
618
619static void testLine25(skiatest::Reporter* reporter) {
620 SkPath path;
621 path.addRect(0, 6, 12, 12, SkPath::kCW_Direction);
622 path.addRect(12, 0, 21, 21, SkPath::kCW_Direction);
623 testSimplify(reporter, path);
624}
625
626static void testLine25x(skiatest::Reporter* reporter) {
627 SkPath path;
628 path.setFillType(SkPath::kEvenOdd_FillType);
629 path.addRect(0, 6, 12, 12, SkPath::kCW_Direction);
630 path.addRect(12, 0, 21, 21, SkPath::kCW_Direction);
631 testSimplify(reporter, path);
632}
633
634static void testLine26(skiatest::Reporter* reporter) {
635 SkPath path;
636 path.addRect(0, 18, 12, 12, SkPath::kCW_Direction);
637 path.addRect(0, 12, 9, 9, SkPath::kCW_Direction);
638 testSimplify(reporter, path);
639}
640
641static void testLine26x(skiatest::Reporter* reporter) {
642 SkPath path;
643 path.setFillType(SkPath::kEvenOdd_FillType);
644 path.addRect(0, 18, 12, 12, SkPath::kCW_Direction);
645 path.addRect(0, 12, 9, 9, SkPath::kCW_Direction);
646 testSimplify(reporter, path);
647}
648
649static void testLine27(skiatest::Reporter* reporter) {
650 SkPath path;
651 path.addRect(0, 18, 12, 12, SkPath::kCW_Direction);
652 path.addRect(12, 8, 21, 21, SkPath::kCW_Direction);
653 testSimplify(reporter, path);
654}
655
656static void testLine27x(skiatest::Reporter* reporter) {
657 SkPath path;
658 path.setFillType(SkPath::kEvenOdd_FillType);
659 path.addRect(0, 18, 12, 12, SkPath::kCW_Direction);
660 path.addRect(12, 8, 21, 21, SkPath::kCW_Direction);
661 testSimplify(reporter, path);
662}
663
664static void testLine28(skiatest::Reporter* reporter) {
665 SkPath path;
666 path.addRect(0, 6, 12, 12, SkPath::kCW_Direction);
667 path.addRect(0, 0, 9, 9, SkPath::kCW_Direction);
668 testSimplify(reporter, path);
669}
670
671static void testLine28x(skiatest::Reporter* reporter) {
672 SkPath path;
673 path.setFillType(SkPath::kEvenOdd_FillType);
674 path.addRect(0, 6, 12, 12, SkPath::kCW_Direction);
675 path.addRect(0, 0, 9, 9, SkPath::kCW_Direction);
676 testSimplify(reporter, path);
677}
678
679static void testLine29(skiatest::Reporter* reporter) {
680 SkPath path;
681 path.addRect(0, 18, 12, 12, SkPath::kCW_Direction);
682 path.addRect(12, 12, 21, 21, SkPath::kCW_Direction);
683 testSimplify(reporter, path);
684}
685
686static void testLine29x(skiatest::Reporter* reporter) {
687 SkPath path;
688 path.setFillType(SkPath::kEvenOdd_FillType);
689 path.addRect(0, 18, 12, 12, SkPath::kCW_Direction);
690 path.addRect(12, 12, 21, 21, SkPath::kCW_Direction);
691 testSimplify(reporter, path);
692}
693
694static void testLine30(skiatest::Reporter* reporter) {
695 SkPath path;
696 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
697 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
698 path.addRect(4, 4, 13, 13, SkPath::kCW_Direction);
699 testSimplify(reporter, path);
700}
701
702static void testLine30x(skiatest::Reporter* reporter) {
703 SkPath path;
704 path.setFillType(SkPath::kEvenOdd_FillType);
705 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
706 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
707 path.addRect(4, 4, 13, 13, SkPath::kCW_Direction);
708 testSimplify(reporter, path);
709}
710
711static void testLine31(skiatest::Reporter* reporter) {
712 SkPath path;
713 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
714 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
715 path.addRect(0, 4, 9, 9, SkPath::kCW_Direction);
716 testSimplify(reporter, path);
717}
718
719static void testLine31x(skiatest::Reporter* reporter) {
720 SkPath path;
721 path.setFillType(SkPath::kEvenOdd_FillType);
722 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
723 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
724 path.addRect(0, 4, 9, 9, SkPath::kCW_Direction);
725 testSimplify(reporter, path);
726}
727
728static void testLine32(skiatest::Reporter* reporter) {
729 SkPath path;
730 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
731 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
732 path.addRect(4, 12, 13, 13, SkPath::kCW_Direction);
733 testSimplify(reporter, path);
734}
735
736static void testLine32x(skiatest::Reporter* reporter) {
737 SkPath path;
738 path.setFillType(SkPath::kEvenOdd_FillType);
739 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
740 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
741 path.addRect(4, 12, 13, 13, SkPath::kCW_Direction);
742 testSimplify(reporter, path);
743}
744
745static void testLine33(skiatest::Reporter* reporter) {
746 SkPath path;
747 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
748 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
749 path.addRect(4, 16, 13, 13, SkPath::kCW_Direction);
750 testSimplify(reporter, path);
751}
752
753static void testLine33x(skiatest::Reporter* reporter) {
754 SkPath path;
755 path.setFillType(SkPath::kEvenOdd_FillType);
756 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
757 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
758 path.addRect(4, 16, 13, 13, SkPath::kCW_Direction);
759 testSimplify(reporter, path);
760}
761
762static void testLine34(skiatest::Reporter* reporter) {
763 SkPath path;
764 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
765 path.addRect(0, 6, 12, 12, SkPath::kCW_Direction);
766 path.addRect(4, 12, 13, 13, SkPath::kCW_Direction);
767 testSimplify(reporter, path);
768}
769
770static void testLine34x(skiatest::Reporter* reporter) {
771 SkPath path;
772 path.setFillType(SkPath::kEvenOdd_FillType);
773 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
774 path.addRect(0, 6, 12, 12, SkPath::kCW_Direction);
775 path.addRect(4, 12, 13, 13, SkPath::kCW_Direction);
776 testSimplify(reporter, path);
777}
778
779static void testLine35(skiatest::Reporter* reporter) {
780 SkPath path;
781 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
782 path.addRect(6, 0, 18, 18, SkPath::kCW_Direction);
783 path.addRect(4, 16, 13, 13, SkPath::kCW_Direction);
784 testSimplify(reporter, path);
785}
786
787static void testLine35x(skiatest::Reporter* reporter) {
788 SkPath path;
789 path.setFillType(SkPath::kEvenOdd_FillType);
790 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
791 path.addRect(6, 0, 18, 18, SkPath::kCW_Direction);
792 path.addRect(4, 16, 13, 13, SkPath::kCW_Direction);
793 testSimplify(reporter, path);
794}
795
796static void testLine36(skiatest::Reporter* reporter) {
797 SkPath path;
798 path.addRect(0, 10, 20, 20, SkPath::kCW_Direction);
799 path.addRect(6, 12, 18, 18, SkPath::kCW_Direction);
800 path.addRect(4, 16, 13, 13, SkPath::kCW_Direction);
801 testSimplify(reporter, path);
802}
803
804static void testLine36x(skiatest::Reporter* reporter) {
805 SkPath path;
806 path.setFillType(SkPath::kEvenOdd_FillType);
807 path.addRect(0, 10, 20, 20, SkPath::kCW_Direction);
808 path.addRect(6, 12, 18, 18, SkPath::kCW_Direction);
809 path.addRect(4, 16, 13, 13, SkPath::kCW_Direction);
810 testSimplify(reporter, path);
811}
812
813static void testLine37(skiatest::Reporter* reporter) {
814 SkPath path;
815 path.addRect(0, 20, 20, 20, SkPath::kCW_Direction);
816 path.addRect(18, 24, 30, 30, SkPath::kCW_Direction);
817 path.addRect(0, 0, 9, 9, SkPath::kCW_Direction);
818 testSimplify(reporter, path);
819}
820
821static void testLine37x(skiatest::Reporter* reporter) {
822 SkPath path;
823 path.setFillType(SkPath::kEvenOdd_FillType);
824 path.addRect(0, 20, 20, 20, SkPath::kCW_Direction);
825 path.addRect(18, 24, 30, 30, SkPath::kCW_Direction);
826 path.addRect(0, 0, 9, 9, SkPath::kCW_Direction);
827 testSimplify(reporter, path);
828}
829
830static void testLine38(skiatest::Reporter* reporter) {
831 SkPath path;
832 path.addRect(10, 0, 30, 30, SkPath::kCW_Direction);
833 path.addRect(6, 12, 18, 18, SkPath::kCW_Direction);
834 path.addRect(12, 12, 21, 21, SkPath::kCW_Direction);
835 testSimplify(reporter, path);
836}
837
838static void testLine38x(skiatest::Reporter* reporter) {
839 SkPath path;
840 path.setFillType(SkPath::kEvenOdd_FillType);
841 path.addRect(10, 0, 30, 30, SkPath::kCW_Direction);
842 path.addRect(6, 12, 18, 18, SkPath::kCW_Direction);
843 path.addRect(12, 12, 21, 21, SkPath::kCW_Direction);
844 testSimplify(reporter, path);
845}
846
847static void testLine40(skiatest::Reporter* reporter) {
848 SkPath path;
849 path.addRect(10, 0, 30, 30, SkPath::kCW_Direction);
850 path.addRect(12, 18, 24, 24, SkPath::kCW_Direction);
851 path.addRect(4, 16, 13, 13, SkPath::kCW_Direction);
852 testSimplify(reporter, path);
853}
854
855static void testLine40x(skiatest::Reporter* reporter) {
856 SkPath path;
857 path.setFillType(SkPath::kEvenOdd_FillType);
858 path.addRect(10, 0, 30, 30, SkPath::kCW_Direction);
859 path.addRect(12, 18, 24, 24, SkPath::kCW_Direction);
860 path.addRect(4, 16, 13, 13, SkPath::kCW_Direction);
861 testSimplify(reporter, path);
862}
863
864static void testLine41(skiatest::Reporter* reporter) {
865 SkPath path;
866 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
867 path.addRect(18, 24, 30, 30, SkPath::kCW_Direction);
868 path.addRect(12, 0, 21, 21, SkPath::kCW_Direction);
869 testSimplify(reporter, path);
870}
871
872static void testLine41x(skiatest::Reporter* reporter) {
873 SkPath path;
874 path.setFillType(SkPath::kEvenOdd_FillType);
875 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
876 path.addRect(18, 24, 30, 30, SkPath::kCW_Direction);
877 path.addRect(12, 0, 21, 21, SkPath::kCW_Direction);
878 testSimplify(reporter, path);
879}
880
881static void testLine42(skiatest::Reporter* reporter) {
882 SkPath path;
883 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
884 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
885 path.addRect(8, 16, 17, 17, SkPath::kCW_Direction);
886 testSimplify(reporter, path);
887}
888
889static void testLine42x(skiatest::Reporter* reporter) {
890 SkPath path;
891 path.setFillType(SkPath::kEvenOdd_FillType);
892 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
893 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
894 path.addRect(8, 16, 17, 17, SkPath::kCW_Direction);
895 testSimplify(reporter, path);
896}
897
898static void testLine43(skiatest::Reporter* reporter) {
899 SkPath path;
900 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
901 path.addRect(6, 24, 18, 18, SkPath::kCW_Direction);
902 path.addRect(0, 32, 9, 36, SkPath::kCCW_Direction);
903 testSimplify(reporter, path);
904}
905
906static void testLine43x(skiatest::Reporter* reporter) {
907 SkPath path;
908 path.setFillType(SkPath::kEvenOdd_FillType);
909 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
910 path.addRect(6, 24, 18, 18, SkPath::kCW_Direction);
911 path.addRect(0, 32, 9, 36, SkPath::kCCW_Direction);
912 testSimplify(reporter, path);
913}
914
915static void testLine44(skiatest::Reporter* reporter) {
916 SkPath path;
917 path.addRect(10, 40, 30, 30, SkPath::kCW_Direction);
918 path.addRect(18, 0, 30, 30, SkPath::kCW_Direction);
919 path.addRect(18, 32, 27, 36, SkPath::kCCW_Direction);
920 testSimplify(reporter, path);
921}
922
923static void testLine44x(skiatest::Reporter* reporter) {
924 SkPath path;
925 path.setFillType(SkPath::kEvenOdd_FillType);
926 path.addRect(10, 40, 30, 30, SkPath::kCW_Direction);
927 path.addRect(18, 0, 30, 30, SkPath::kCW_Direction);
928 path.addRect(18, 32, 27, 36, SkPath::kCCW_Direction);
929 testSimplify(reporter, path);
930}
931
932static void testLine45(skiatest::Reporter* reporter) {
933 SkPath path;
934 path.addRect(10, 0, 30, 30, SkPath::kCW_Direction);
935 path.addRect(18, 0, 30, 30, SkPath::kCW_Direction);
936 path.addRect(24, 32, 33, 36, SkPath::kCW_Direction);
937 testSimplify(reporter, path);
938}
939
940static void testLine45x(skiatest::Reporter* reporter) {
941 SkPath path;
942 path.setFillType(SkPath::kEvenOdd_FillType);
943 path.addRect(10, 0, 30, 30, SkPath::kCW_Direction);
944 path.addRect(18, 0, 30, 30, SkPath::kCW_Direction);
945 path.addRect(24, 32, 33, 36, SkPath::kCW_Direction);
946 testSimplify(reporter, path);
947}
948
949static void testLine46(skiatest::Reporter* reporter) {
950 SkPath path;
951 path.addRect(10, 40, 30, 30, SkPath::kCW_Direction);
952 path.addRect(24, 0, 36, 36, SkPath::kCW_Direction);
953 path.addRect(24, 32, 33, 36, SkPath::kCW_Direction);
954 testSimplify(reporter, path);
955}
956
957static void testLine46x(skiatest::Reporter* reporter) {
958 SkPath path;
959 path.setFillType(SkPath::kEvenOdd_FillType);
960 path.addRect(10, 40, 30, 30, SkPath::kCW_Direction);
961 path.addRect(24, 0, 36, 36, SkPath::kCW_Direction);
962 path.addRect(24, 32, 33, 36, SkPath::kCW_Direction);
963 testSimplify(reporter, path);
964}
965
966static void testLine47(skiatest::Reporter* reporter) {
967 SkPath path;
968 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
969 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
970 path.addRect(0, 0, 9, 9, SkPath::kCCW_Direction);
971 testSimplify(reporter, path);
972}
973
974static void testLine47x(skiatest::Reporter* reporter) {
975 SkPath path;
976 path.setFillType(SkPath::kEvenOdd_FillType);
977 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
978 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
979 path.addRect(0, 0, 9, 9, SkPath::kCCW_Direction);
980 testSimplify(reporter, path);
981}
982
983static void testLine48(skiatest::Reporter* reporter) {
984 SkPath path;
985 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
986 path.addRect(0, 6, 12, 12, SkPath::kCW_Direction);
987 path.addRect(0, 0, 9, 9, SkPath::kCCW_Direction);
988 testSimplify(reporter, path);
989}
990
991static void testLine48x(skiatest::Reporter* reporter) {
992 SkPath path;
993 path.setFillType(SkPath::kEvenOdd_FillType);
994 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
995 path.addRect(0, 6, 12, 12, SkPath::kCW_Direction);
996 path.addRect(0, 0, 9, 9, SkPath::kCCW_Direction);
997 testSimplify(reporter, path);
998}
999
1000static void testLine49(skiatest::Reporter* reporter) {
1001 SkPath path;
1002 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1003 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
1004 path.addRect(0, 0, 9, 9, SkPath::kCW_Direction);
1005 testSimplify(reporter, path);
1006}
1007
1008static void testLine49x(skiatest::Reporter* reporter) {
1009 SkPath path;
1010 path.setFillType(SkPath::kEvenOdd_FillType);
1011 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1012 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
1013 path.addRect(0, 0, 9, 9, SkPath::kCW_Direction);
1014 testSimplify(reporter, path);
1015}
1016
1017static void testLine50(skiatest::Reporter* reporter) {
1018 SkPath path;
1019 path.addRect(10, 30, 30, 30, SkPath::kCW_Direction);
1020 path.addRect(24, 20, 36, 30, SkPath::kCW_Direction);
1021 testSimplify(reporter, path);
1022}
1023
1024static void testLine50x(skiatest::Reporter* reporter) {
1025 SkPath path;
1026 path.setFillType(SkPath::kEvenOdd_FillType);
1027 path.addRect(10, 30, 30, 30, SkPath::kCW_Direction);
1028 path.addRect(24, 20, 36, 30, SkPath::kCW_Direction);
1029 testSimplify(reporter, path);
1030}
1031
1032static void testLine51(skiatest::Reporter* reporter) {
1033 SkPath path;
1034 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1035 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
1036 path.addRect(4, 12, 13, 13, SkPath::kCCW_Direction);
1037 testSimplify(reporter, path);
1038}
1039
1040static void testLine51x(skiatest::Reporter* reporter) {
1041 SkPath path;
1042 path.setFillType(SkPath::kEvenOdd_FillType);
1043 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1044 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
1045 path.addRect(4, 12, 13, 13, SkPath::kCCW_Direction);
1046 testSimplify(reporter, path);
1047}
1048
1049static void testLine52(skiatest::Reporter* reporter) {
1050 SkPath path;
1051 path.addRect(0, 30, 20, 20, SkPath::kCW_Direction);
1052 path.addRect(6, 20, 18, 30, SkPath::kCW_Direction);
1053 path.addRect(32, 0, 36, 41, SkPath::kCW_Direction);
1054 testSimplify(reporter, path);
1055}
1056
1057static void testLine52x(skiatest::Reporter* reporter) {
1058 SkPath path;
1059 path.setFillType(SkPath::kEvenOdd_FillType);
1060 path.addRect(0, 30, 20, 20, SkPath::kCW_Direction);
1061 path.addRect(6, 20, 18, 30, SkPath::kCW_Direction);
1062 path.addRect(32, 0, 36, 41, SkPath::kCW_Direction);
1063 testSimplify(reporter, path);
1064}
1065
1066static void testLine53(skiatest::Reporter* reporter) {
1067 SkPath path;
1068 path.addRect(10, 30, 30, 30, SkPath::kCW_Direction);
1069 path.addRect(12, 20, 24, 30, SkPath::kCW_Direction);
1070 path.addRect(12, 32, 21, 36, SkPath::kCCW_Direction);
1071 testSimplify(reporter, path);
1072}
1073
1074static void testLine53x(skiatest::Reporter* reporter) {
1075 SkPath path;
1076 path.setFillType(SkPath::kEvenOdd_FillType);
1077 path.addRect(10, 30, 30, 30, SkPath::kCW_Direction);
1078 path.addRect(12, 20, 24, 30, SkPath::kCW_Direction);
1079 path.addRect(12, 32, 21, 36, SkPath::kCCW_Direction);
1080 testSimplify(reporter, path);
1081}
1082
1083static void testLine54(skiatest::Reporter* reporter) {
1084 SkPath path;
1085 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1086 path.addRect(6, 0, 18, 18, SkPath::kCW_Direction);
1087 path.addRect(8, 4, 17, 17, SkPath::kCCW_Direction);
1088 testSimplify(reporter, path);
1089}
1090
1091static void testLine54x(skiatest::Reporter* reporter) {
1092 SkPath path;
1093 path.setFillType(SkPath::kEvenOdd_FillType);
1094 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1095 path.addRect(6, 0, 18, 18, SkPath::kCW_Direction);
1096 path.addRect(8, 4, 17, 17, SkPath::kCCW_Direction);
1097 testSimplify(reporter, path);
1098}
1099
1100static void testLine55(skiatest::Reporter* reporter) {
1101 SkPath path;
1102 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1103 path.addRect(6, 6, 18, 18, SkPath::kCW_Direction);
1104 path.addRect(4, 4, 13, 13, SkPath::kCCW_Direction);
1105 testSimplify(reporter, path);
1106}
1107
1108static void testLine55x(skiatest::Reporter* reporter) {
1109 SkPath path;
1110 path.setFillType(SkPath::kEvenOdd_FillType);
1111 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1112 path.addRect(6, 6, 18, 18, SkPath::kCW_Direction);
1113 path.addRect(4, 4, 13, 13, SkPath::kCCW_Direction);
1114 testSimplify(reporter, path);
1115}
1116
1117static void testLine56(skiatest::Reporter* reporter) {
1118 SkPath path;
1119 path.addRect(0, 20, 20, 20, SkPath::kCW_Direction);
1120 path.addRect(18, 20, 30, 30, SkPath::kCW_Direction);
1121 path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction);
1122 testSimplify(reporter, path);
1123}
1124
1125static void testLine56x(skiatest::Reporter* reporter) {
1126 SkPath path;
1127 path.setFillType(SkPath::kEvenOdd_FillType);
1128 path.addRect(0, 20, 20, 20, SkPath::kCW_Direction);
1129 path.addRect(18, 20, 30, 30, SkPath::kCW_Direction);
1130 path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction);
1131 testSimplify(reporter, path);
1132}
1133
1134static void testLine57(skiatest::Reporter* reporter) {
1135 SkPath path;
1136 path.addRect(20, 0, 40, 40, SkPath::kCW_Direction);
1137 path.addRect(20, 0, 30, 40, SkPath::kCW_Direction);
1138 path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction);
1139 testSimplify(reporter, path);
1140}
1141
1142static void testLine57x(skiatest::Reporter* reporter) {
1143 SkPath path;
1144 path.setFillType(SkPath::kEvenOdd_FillType);
1145 path.addRect(20, 0, 40, 40, SkPath::kCW_Direction);
1146 path.addRect(20, 0, 30, 40, SkPath::kCW_Direction);
1147 path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction);
1148 testSimplify(reporter, path);
1149}
1150
1151static void testLine58(skiatest::Reporter* reporter) {
1152 SkPath path;
1153 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1154 path.addRect(0, 0, 12, 12, SkPath::kCCW_Direction);
1155 path.addRect(0, 12, 9, 9, SkPath::kCCW_Direction);
1156 testSimplify(reporter, path);
1157}
1158
1159static void testLine58x(skiatest::Reporter* reporter) {
1160 SkPath path;
1161 path.setFillType(SkPath::kEvenOdd_FillType);
1162 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1163 path.addRect(0, 0, 12, 12, SkPath::kCCW_Direction);
1164 path.addRect(0, 12, 9, 9, SkPath::kCCW_Direction);
1165 testSimplify(reporter, path);
1166}
1167
1168static void testLine59(skiatest::Reporter* reporter) {
1169 SkPath path;
1170 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1171 path.addRect(6, 6, 18, 18, SkPath::kCCW_Direction);
1172 path.addRect(4, 4, 13, 13, SkPath::kCCW_Direction);
1173 testSimplify(reporter, path);
1174}
1175
1176static void testLine59x(skiatest::Reporter* reporter) {
1177 SkPath path;
1178 path.setFillType(SkPath::kEvenOdd_FillType);
1179 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1180 path.addRect(6, 6, 18, 18, SkPath::kCCW_Direction);
1181 path.addRect(4, 4, 13, 13, SkPath::kCCW_Direction);
1182 testSimplify(reporter, path);
1183}
1184
1185static void testLine60(skiatest::Reporter* reporter) {
1186 SkPath path;
1187 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1188 path.addRect(6, 12, 18, 18, SkPath::kCCW_Direction);
1189 path.addRect(4, 12, 13, 13, SkPath::kCCW_Direction);
1190 testSimplify(reporter, path);
1191}
1192
1193static void testLine60x(skiatest::Reporter* reporter) {
1194 SkPath path;
1195 path.setFillType(SkPath::kEvenOdd_FillType);
1196 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1197 path.addRect(6, 12, 18, 18, SkPath::kCCW_Direction);
1198 path.addRect(4, 12, 13, 13, SkPath::kCCW_Direction);
1199 testSimplify(reporter, path);
1200}
1201
1202static void testLine61(skiatest::Reporter* reporter) {
1203 SkPath path;
1204 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1205 path.addRect(12, 0, 24, 24, SkPath::kCCW_Direction);
1206 path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction);
1207 testSimplify(reporter, path);
1208}
1209
1210static void testLine61x(skiatest::Reporter* reporter) {
1211 SkPath path;
1212 path.setFillType(SkPath::kEvenOdd_FillType);
1213 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1214 path.addRect(12, 0, 24, 24, SkPath::kCCW_Direction);
1215 path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction);
1216 testSimplify(reporter, path);
1217}
1218
1219static void testLine62(skiatest::Reporter* reporter) {
1220 SkPath path;
1221 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1222 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1223 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
1224 path.addRect(4, 12, 13, 13, SkPath::kCCW_Direction);
1225 testSimplify(reporter, path);
1226}
1227
1228static void testLine62x(skiatest::Reporter* reporter) {
1229 SkPath path;
1230 path.setFillType(SkPath::kEvenOdd_FillType);
1231 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1232 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1233 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
1234 path.addRect(4, 12, 13, 13, SkPath::kCCW_Direction);
1235 testSimplify(reporter, path);
1236}
1237
1238static void testLine63(skiatest::Reporter* reporter) {
1239 SkPath path;
1240 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1241 path.addRect(0, 10, 20, 20, SkPath::kCW_Direction);
1242 path.addRect(0, 6, 12, 12, SkPath::kCCW_Direction);
1243 path.addRect(0, 32, 9, 36, SkPath::kCCW_Direction);
1244 testSimplify(reporter, path);
1245}
1246
1247static void testLine63x(skiatest::Reporter* reporter) {
1248 SkPath path;
1249 path.setFillType(SkPath::kEvenOdd_FillType);
1250 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1251 path.addRect(0, 10, 20, 20, SkPath::kCW_Direction);
1252 path.addRect(0, 6, 12, 12, SkPath::kCCW_Direction);
1253 path.addRect(0, 32, 9, 36, SkPath::kCCW_Direction);
1254 testSimplify(reporter, path);
1255}
1256
1257static void testLine64(skiatest::Reporter* reporter) {
1258 SkPath path;
1259 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1260 path.addRect(10, 40, 30, 30, SkPath::kCW_Direction);
1261 path.addRect(18, 6, 30, 30, SkPath::kCW_Direction);
1262 testSimplify(reporter, path);
1263}
1264
1265static void testLine64x(skiatest::Reporter* reporter) {
1266 SkPath path;
1267 path.setFillType(SkPath::kEvenOdd_FillType);
1268 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1269 path.addRect(10, 40, 30, 30, SkPath::kCW_Direction);
1270 path.addRect(18, 6, 30, 30, SkPath::kCW_Direction);
1271 testSimplify(reporter, path);
1272}
1273
1274static void testLine65(skiatest::Reporter* reporter) {
1275 SkPath path;
1276 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1277 path.addRect(10, 0, 30, 30, SkPath::kCW_Direction);
1278 path.addRect(24, 0, 36, 36, SkPath::kCW_Direction);
1279 path.addRect(32, 6, 36, 41, SkPath::kCCW_Direction);
1280 testSimplify(reporter, path);
1281}
1282
1283static void testLine65x(skiatest::Reporter* reporter) {
1284 SkPath path;
1285 path.setFillType(SkPath::kEvenOdd_FillType);
1286 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1287 path.addRect(10, 0, 30, 30, SkPath::kCW_Direction);
1288 path.addRect(24, 0, 36, 36, SkPath::kCW_Direction);
1289 path.addRect(32, 6, 36, 41, SkPath::kCCW_Direction);
1290 testSimplify(reporter, path);
1291}
1292
1293static void testLine66(skiatest::Reporter* reporter) {
1294 SkPath path;
1295 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1296 path.addRect(0, 30, 20, 20, SkPath::kCW_Direction);
1297 path.addRect(12, 20, 24, 30, SkPath::kCW_Direction);
1298 testSimplify(reporter, path);
1299}
1300
1301static void testLine66x(skiatest::Reporter* reporter) {
1302 SkPath path;
1303 path.setFillType(SkPath::kEvenOdd_FillType);
1304 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1305 path.addRect(0, 30, 20, 20, SkPath::kCW_Direction);
1306 path.addRect(12, 20, 24, 30, SkPath::kCW_Direction);
1307 testSimplify(reporter, path);
1308}
1309
1310static void testLine67(skiatest::Reporter* reporter) {
1311 SkPath path;
1312 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1313 path.addRect(10, 40, 30, 30, SkPath::kCW_Direction);
1314 path.addRect(24, 20, 36, 30, SkPath::kCW_Direction);
1315 path.addRect(32, 0, 36, 41, SkPath::kCW_Direction);
1316 testSimplify(reporter, path);
1317}
1318
1319static void testLine67x(skiatest::Reporter* reporter) {
1320 SkPath path;
1321 path.setFillType(SkPath::kEvenOdd_FillType);
1322 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1323 path.addRect(10, 40, 30, 30, SkPath::kCW_Direction);
1324 path.addRect(24, 20, 36, 30, SkPath::kCW_Direction);
1325 path.addRect(32, 0, 36, 41, SkPath::kCW_Direction);
1326 testSimplify(reporter, path);
1327}
1328
1329static void testLine68a(skiatest::Reporter* reporter) {
1330 SkPath path;
1331 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1332 path.addRect(2, 2, 6, 6, SkPath::kCW_Direction);
1333 path.addRect(1, 2, 4, 2, SkPath::kCW_Direction);
1334 testSimplify(reporter, path);
1335}
1336
1337static void testLine68ax(skiatest::Reporter* reporter) {
1338 SkPath path;
1339 path.setFillType(SkPath::kEvenOdd_FillType);
1340 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1341 path.addRect(2, 2, 6, 6, SkPath::kCW_Direction);
1342 path.addRect(1, 2, 4, 2, SkPath::kCW_Direction);
1343 testSimplify(reporter, path);
1344}
1345
1346static void testLine68b(skiatest::Reporter* reporter) {
1347 SkPath path;
1348 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1349 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1350 path.addRect(1, 2, 2, 2, SkPath::kCW_Direction);
1351 testSimplify(reporter, path);
1352}
1353
1354static void testLine68bx(skiatest::Reporter* reporter) {
1355 SkPath path;
1356 path.setFillType(SkPath::kEvenOdd_FillType);
1357 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1358 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1359 path.addRect(1, 2, 2, 2, SkPath::kCW_Direction);
1360 testSimplify(reporter, path);
1361}
1362
1363static void testLine68c(skiatest::Reporter* reporter) {
1364 SkPath path;
1365 path.addRect(0, 0, 8, 8, SkPath::kCCW_Direction);
1366 path.addRect(2, 2, 6, 6, SkPath::kCW_Direction);
1367 path.addRect(1, 2, 4, 2, SkPath::kCW_Direction);
1368 testSimplify(reporter, path);
1369}
1370
1371static void testLine68cx(skiatest::Reporter* reporter) {
1372 SkPath path;
1373 path.setFillType(SkPath::kEvenOdd_FillType);
1374 path.addRect(0, 0, 8, 8, SkPath::kCCW_Direction);
1375 path.addRect(2, 2, 6, 6, SkPath::kCW_Direction);
1376 path.addRect(1, 2, 4, 2, SkPath::kCW_Direction);
1377 testSimplify(reporter, path);
1378}
1379
1380static void testLine68d(skiatest::Reporter* reporter) {
1381 SkPath path;
1382 path.addRect(0, 0, 8, 8, SkPath::kCCW_Direction);
1383 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1384 path.addRect(1, 2, 4, 2, SkPath::kCW_Direction);
1385 testSimplify(reporter, path);
1386}
1387
1388static void testLine68dx(skiatest::Reporter* reporter) {
1389 SkPath path;
1390 path.setFillType(SkPath::kEvenOdd_FillType);
1391 path.addRect(0, 0, 8, 8, SkPath::kCCW_Direction);
1392 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1393 path.addRect(1, 2, 4, 2, SkPath::kCW_Direction);
1394 testSimplify(reporter, path);
1395}
1396
1397static void testLine68e(skiatest::Reporter* reporter) {
1398 SkPath path;
1399 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1400 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1401 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1402 path.addRect(1, 2, 2, 2, SkPath::kCW_Direction);
1403 testSimplify(reporter, path);
1404}
1405
1406static void testLine68ex(skiatest::Reporter* reporter) {
1407 SkPath path;
1408 path.setFillType(SkPath::kEvenOdd_FillType);
1409 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1410 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1411 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1412 path.addRect(1, 2, 2, 2, SkPath::kCW_Direction);
1413 testSimplify(reporter, path);
1414}
1415
1416static void testLine68f(skiatest::Reporter* reporter) {
1417 SkPath path;
1418 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1419 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1420 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1421 path.addRect(1, 2, 2, 2, SkPath::kCW_Direction);
1422 testSimplify(reporter, path);
1423}
1424
1425static void testLine68fx(skiatest::Reporter* reporter) {
1426 SkPath path;
1427 path.setFillType(SkPath::kEvenOdd_FillType);
1428 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1429 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1430 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1431 path.addRect(1, 2, 2, 2, SkPath::kCW_Direction);
1432 testSimplify(reporter, path);
1433}
1434
1435static void testLine68g(skiatest::Reporter* reporter) {
1436 SkPath path;
1437 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1438 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1439 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1440 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1441 path.addRect(1, 2, 2, 2, SkPath::kCW_Direction);
1442 testSimplify(reporter, path);
1443}
1444
1445static void testLine68gx(skiatest::Reporter* reporter) {
1446 SkPath path;
1447 path.setFillType(SkPath::kEvenOdd_FillType);
1448 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1449 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1450 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1451 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1452 path.addRect(1, 2, 2, 2, SkPath::kCW_Direction);
1453 testSimplify(reporter, path);
1454}
1455
1456static void testLine68h(skiatest::Reporter* reporter) {
1457 SkPath path;
1458 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1459 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1460 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1461 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1462 path.addRect(1, 2, 2, 2, SkPath::kCW_Direction);
1463 testSimplify(reporter, path);
1464}
1465
1466static void testLine68hx(skiatest::Reporter* reporter) {
1467 SkPath path;
1468 path.setFillType(SkPath::kEvenOdd_FillType);
1469 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1470 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1471 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1472 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1473 path.addRect(1, 2, 2, 2, SkPath::kCW_Direction);
1474 testSimplify(reporter, path);
1475}
1476
1477static void testLine69(skiatest::Reporter* reporter) {
1478 SkPath path;
1479 path.addRect(0, 20, 20, 20, SkPath::kCW_Direction);
1480 path.addRect(0, 20, 12, 30, SkPath::kCW_Direction);
1481 path.addRect(12, 32, 21, 36, SkPath::kCW_Direction);
1482 testSimplify(reporter, path);
1483}
1484
1485static void testLine69x(skiatest::Reporter* reporter) {
1486 SkPath path;
1487 path.setFillType(SkPath::kEvenOdd_FillType);
1488 path.addRect(0, 20, 20, 20, SkPath::kCW_Direction);
1489 path.addRect(0, 20, 12, 30, SkPath::kCW_Direction);
1490 path.addRect(12, 32, 21, 36, SkPath::kCW_Direction);
1491 testSimplify(reporter, path);
1492}
1493
1494static void testLine70(skiatest::Reporter* reporter) {
1495 SkPath path;
1496 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1497 path.addRect(0, 24, 12, 12, SkPath::kCW_Direction);
1498 path.addRect(12, 32, 21, 36, SkPath::kCCW_Direction);
1499 testSimplify(reporter, path);
1500}
1501
1502static void testLine70x(skiatest::Reporter* reporter) {
1503 SkPath path;
1504 path.setFillType(SkPath::kEvenOdd_FillType);
1505 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1506 path.addRect(0, 24, 12, 12, SkPath::kCW_Direction);
1507 path.addRect(12, 32, 21, 36, SkPath::kCCW_Direction);
1508 testSimplify(reporter, path);
1509}
1510
1511static void testLine71(skiatest::Reporter* reporter) {
1512 SkPath path;
1513 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1514 path.addRect(12, 0, 24, 24, SkPath::kCW_Direction);
1515 path.addRect(12, 32, 21, 36, SkPath::kCW_Direction);
1516 testSimplify(reporter, path);
1517}
1518
1519static void testLine71x(skiatest::Reporter* reporter) {
1520 SkPath path;
1521 path.setFillType(SkPath::kEvenOdd_FillType);
1522 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1523 path.addRect(12, 0, 24, 24, SkPath::kCW_Direction);
1524 path.addRect(12, 32, 21, 36, SkPath::kCW_Direction);
1525 testSimplify(reporter, path);
1526}
1527
1528static void testLine72(skiatest::Reporter* reporter) {
1529 SkPath path;
1530 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1531 path.addRect(10, 40, 30, 30, SkPath::kCW_Direction);
1532 path.addRect(6, 20, 18, 30, SkPath::kCW_Direction);
1533 testSimplify(reporter, path);
1534}
1535
1536static void testLine72x(skiatest::Reporter* reporter) {
1537 SkPath path;
1538 path.setFillType(SkPath::kEvenOdd_FillType);
1539 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1540 path.addRect(10, 40, 30, 30, SkPath::kCW_Direction);
1541 path.addRect(6, 20, 18, 30, SkPath::kCW_Direction);
1542 testSimplify(reporter, path);
1543}
1544
1545static void testLine73(skiatest::Reporter* reporter) {
1546 SkPath path;
1547 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1548 path.addRect(0, 40, 20, 20, SkPath::kCW_Direction);
1549 path.addRect(0, 20, 12, 30, SkPath::kCW_Direction);
1550 path.addRect(0, 0, 9, 9, SkPath::kCCW_Direction);
1551 testSimplify(reporter, path);
1552}
1553
1554static void testLine73x(skiatest::Reporter* reporter) {
1555 SkPath path;
1556 path.setFillType(SkPath::kEvenOdd_FillType);
1557 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1558 path.addRect(0, 40, 20, 20, SkPath::kCW_Direction);
1559 path.addRect(0, 20, 12, 30, SkPath::kCW_Direction);
1560 path.addRect(0, 0, 9, 9, SkPath::kCCW_Direction);
1561 testSimplify(reporter, path);
1562}
1563
1564static void testLine74(skiatest::Reporter* reporter) {
1565 SkPath path;
1566 path.addRect(20, 30, 40, 40, SkPath::kCW_Direction);
1567 path.addRect(24, 20, 36, 30, SkPath::kCCW_Direction);
1568 path.addRect(32, 24, 36, 41, SkPath::kCCW_Direction);
1569 testSimplify(reporter, path);
1570}
1571
1572static void testLine74x(skiatest::Reporter* reporter) {
1573 SkPath path;
1574 path.setFillType(SkPath::kEvenOdd_FillType);
1575 path.addRect(20, 30, 40, 40, SkPath::kCW_Direction);
1576 path.addRect(24, 20, 36, 30, SkPath::kCCW_Direction);
1577 path.addRect(32, 24, 36, 41, SkPath::kCCW_Direction);
1578 testSimplify(reporter, path);
1579}
1580
1581static void testLine75(skiatest::Reporter* reporter) {
1582 SkPath path;
1583 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1584 path.addRect(10, 0, 30, 30, SkPath::kCCW_Direction);
1585 path.addRect(18, 0, 30, 30, SkPath::kCCW_Direction);
1586 path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction);
1587 testSimplify(reporter, path);
1588}
1589
1590static void testLine75x(skiatest::Reporter* reporter) {
1591 SkPath path;
1592 path.setFillType(SkPath::kEvenOdd_FillType);
1593 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1594 path.addRect(10, 0, 30, 30, SkPath::kCCW_Direction);
1595 path.addRect(18, 0, 30, 30, SkPath::kCCW_Direction);
1596 path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction);
1597 testSimplify(reporter, path);
1598}
1599
1600static void testLine76(skiatest::Reporter* reporter) {
1601 SkPath path;
1602 path.addRect(36, 0, 66, 60, SkPath::kCW_Direction);
1603 path.addRect(10, 20, 40, 30, SkPath::kCW_Direction);
1604 path.addRect(24, 20, 36, 30, SkPath::kCCW_Direction);
1605 path.addRect(32, 6, 36, 41, SkPath::kCCW_Direction);
1606 testSimplify(reporter, path);
1607}
1608
1609static void testLine76x(skiatest::Reporter* reporter) {
1610 SkPath path;
1611 path.setFillType(SkPath::kEvenOdd_FillType);
1612 path.addRect(36, 0, 66, 60, SkPath::kCW_Direction);
1613 path.addRect(10, 20, 40, 30, SkPath::kCW_Direction);
1614 path.addRect(24, 20, 36, 30, SkPath::kCCW_Direction);
1615 path.addRect(32, 6, 36, 41, SkPath::kCCW_Direction);
1616 testSimplify(reporter, path);
1617}
1618
1619static void testLine77(skiatest::Reporter* reporter) {
1620 SkPath path;
1621 path.addRect(20, 0, 40, 40, SkPath::kCW_Direction);
1622 path.addRect(24, 6, 36, 36, SkPath::kCCW_Direction);
1623 path.addRect(24, 32, 33, 36, SkPath::kCCW_Direction);
1624 testSimplify(reporter, path);
1625}
1626
1627static void testLine77x(skiatest::Reporter* reporter) {
1628 SkPath path;
1629 path.setFillType(SkPath::kEvenOdd_FillType);
1630 path.addRect(20, 0, 40, 40, SkPath::kCW_Direction);
1631 path.addRect(24, 6, 36, 36, SkPath::kCCW_Direction);
1632 path.addRect(24, 32, 33, 36, SkPath::kCCW_Direction);
1633 testSimplify(reporter, path);
1634}
1635
1636static void testLine78(skiatest::Reporter* reporter) {
1637 SkPath path;
1638 path.addRect(0, 0, 30, 60, SkPath::kCW_Direction);
1639 path.addRect(10, 20, 30, 30, SkPath::kCCW_Direction);
1640 path.addRect(18, 20, 30, 30, SkPath::kCCW_Direction);
1641 path.addRect(32, 0, 36, 41, SkPath::kCCW_Direction);
1642 testSimplify(reporter, path);
1643}
1644
1645static void testLine78x(skiatest::Reporter* reporter) {
1646 SkPath path;
1647 path.setFillType(SkPath::kEvenOdd_FillType);
1648 path.addRect(0, 0, 30, 60, SkPath::kCW_Direction);
1649 path.addRect(10, 20, 30, 30, SkPath::kCCW_Direction);
1650 path.addRect(18, 20, 30, 30, SkPath::kCCW_Direction);
1651 path.addRect(32, 0, 36, 41, SkPath::kCCW_Direction);
1652 testSimplify(reporter, path);
1653}
1654
1655static void testLine79(skiatest::Reporter* reporter) {
1656 SkPath path;
1657 path.addRect(0, 36, 60, 30, SkPath::kCW_Direction);
1658 path.addRect(10, 30, 40, 30, SkPath::kCW_Direction);
1659 path.addRect(0, 20, 12, 30, SkPath::kCCW_Direction);
1660 path.addRect(0, 32, 9, 36, SkPath::kCCW_Direction);
1661 testSimplify(reporter, path);
1662}
1663
1664static void testLine79x(skiatest::Reporter* reporter) {
1665 SkPath path;
1666 path.setFillType(SkPath::kEvenOdd_FillType);
1667 path.addRect(0, 36, 60, 30, SkPath::kCW_Direction);
1668 path.addRect(10, 30, 40, 30, SkPath::kCW_Direction);
1669 path.addRect(0, 20, 12, 30, SkPath::kCCW_Direction);
1670 path.addRect(0, 32, 9, 36, SkPath::kCCW_Direction);
1671 testSimplify(reporter, path);
1672}
1673
1674static void testLine81(skiatest::Reporter* reporter) {
1675 SkPath path;
1676 path.addRect(-1, -1, 3, 3, SkPath::kCW_Direction);
1677 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
1678 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
1679 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
1680 path.addRect(1, 1, 2, 2, SkPath::kCCW_Direction);
1681 testSimplify(reporter, path);
1682}
1683
1684static void testDegenerate1(skiatest::Reporter* reporter) {
1685 SkPath path;
1686 path.moveTo(0, 0);
1687 path.lineTo(0, 0);
1688 path.lineTo(2, 0);
1689 path.close();
1690 path.moveTo(0, 0);
1691 path.lineTo(1, 0);
1692 path.lineTo(2, 0);
1693 path.close();
1694 testSimplify(reporter, path);
1695}
1696
1697static void testDegenerate1x(skiatest::Reporter* reporter) {
1698 SkPath path;
1699 path.setFillType(SkPath::kEvenOdd_FillType);
1700 path.moveTo(0, 0);
1701 path.lineTo(0, 0);
1702 path.lineTo(2, 0);
1703 path.close();
1704 path.moveTo(0, 0);
1705 path.lineTo(1, 0);
1706 path.lineTo(2, 0);
1707 path.close();
1708 testSimplify(reporter, path);
1709}
1710
1711static void testDegenerate2(skiatest::Reporter* reporter) {
1712 SkPath path;
1713 path.moveTo(0, 0);
1714 path.lineTo(0, 0);
1715 path.lineTo(0, 0);
1716 path.close();
1717 path.moveTo(0, 0);
1718 path.lineTo(1, 0);
1719 path.lineTo(0, 1);
1720 path.close();
1721 testSimplify(reporter, path);
1722}
1723
1724static void testDegenerate2x(skiatest::Reporter* reporter) {
1725 SkPath path;
1726 path.setFillType(SkPath::kEvenOdd_FillType);
1727 path.moveTo(0, 0);
1728 path.lineTo(0, 0);
1729 path.lineTo(0, 0);
1730 path.close();
1731 path.moveTo(0, 0);
1732 path.lineTo(1, 0);
1733 path.lineTo(0, 1);
1734 path.close();
1735 testSimplify(reporter, path);
1736}
1737
1738static void testDegenerate3(skiatest::Reporter* reporter) {
1739 SkPath path;
1740 path.moveTo(0, 0);
1741 path.lineTo(2, 0);
1742 path.lineTo(1, 0);
1743 path.close();
1744 path.moveTo(0, 0);
1745 path.lineTo(0, 0);
1746 path.lineTo(3, 0);
1747 path.close();
1748 testSimplify(reporter, path);
1749}
1750
1751static void testDegenerate3x(skiatest::Reporter* reporter) {
1752 SkPath path;
1753 path.setFillType(SkPath::kEvenOdd_FillType);
1754 path.moveTo(0, 0);
1755 path.lineTo(2, 0);
1756 path.lineTo(1, 0);
1757 path.close();
1758 path.moveTo(0, 0);
1759 path.lineTo(0, 0);
1760 path.lineTo(3, 0);
1761 path.close();
1762 testSimplify(reporter, path);
1763}
1764
1765static void testDegenerate4(skiatest::Reporter* reporter) {
1766 SkPath path;
1767 path.moveTo(0, 0);
1768 path.lineTo(1, 0);
1769 path.lineTo(1, 3);
1770 path.close();
1771 path.moveTo(1, 0);
1772 path.lineTo(1, 1);
1773 path.lineTo(1, 2);
1774 path.close();
1775 testSimplify(reporter, path);
1776}
1777
1778static void testDegenerate4x(skiatest::Reporter* reporter) {
1779 SkPath path;
1780 path.setFillType(SkPath::kEvenOdd_FillType);
1781 path.moveTo(0, 0);
1782 path.lineTo(1, 0);
1783 path.lineTo(1, 3);
1784 path.close();
1785 path.moveTo(1, 0);
1786 path.lineTo(1, 1);
1787 path.lineTo(1, 2);
1788 path.close();
1789 testSimplify(reporter, path);
1790}
1791
1792static void testNondegenerate1(skiatest::Reporter* reporter) {
1793 SkPath path;
1794 path.moveTo(0, 0);
1795 path.lineTo(3, 0);
1796 path.lineTo(1, 3);
1797 path.close();
1798 path.moveTo(1, 1);
1799 path.lineTo(2, 1);
1800 path.lineTo(1, 2);
1801 path.close();
1802 testSimplify(reporter, path);
1803}
1804
1805static void testNondegenerate1x(skiatest::Reporter* reporter) {
1806 SkPath path;
1807 path.setFillType(SkPath::kEvenOdd_FillType);
1808 path.moveTo(0, 0);
1809 path.lineTo(3, 0);
1810 path.lineTo(1, 3);
1811 path.close();
1812 path.moveTo(1, 1);
1813 path.lineTo(2, 1);
1814 path.lineTo(1, 2);
1815 path.close();
1816 testSimplify(reporter, path);
1817}
1818
1819static void testNondegenerate2(skiatest::Reporter* reporter) {
1820 SkPath path;
1821 path.moveTo(1, 0);
1822 path.lineTo(0, 1);
1823 path.lineTo(1, 1);
1824 path.close();
1825 path.moveTo(0, 2);
1826 path.lineTo(0, 3);
1827 path.lineTo(1, 2);
1828 path.close();
1829 testSimplify(reporter, path);
1830}
1831
1832static void testNondegenerate2x(skiatest::Reporter* reporter) {
1833 SkPath path;
1834 path.setFillType(SkPath::kEvenOdd_FillType);
1835 path.moveTo(1, 0);
1836 path.lineTo(0, 1);
1837 path.lineTo(1, 1);
1838 path.close();
1839 path.moveTo(0, 2);
1840 path.lineTo(0, 3);
1841 path.lineTo(1, 2);
1842 path.close();
1843 testSimplify(reporter, path);
1844}
1845
1846static void testNondegenerate3(skiatest::Reporter* reporter) {
1847 SkPath path;
1848 path.moveTo(0, 0);
1849 path.lineTo(1, 0);
1850 path.lineTo(2, 1);
1851 path.close();
1852 path.moveTo(0, 1);
1853 path.lineTo(1, 1);
1854 path.lineTo(0, 2);
1855 path.close();
1856 testSimplify(reporter, path);
1857}
1858
1859static void testNondegenerate3x(skiatest::Reporter* reporter) {
1860 SkPath path;
1861 path.setFillType(SkPath::kEvenOdd_FillType);
1862 path.moveTo(0, 0);
1863 path.lineTo(1, 0);
1864 path.lineTo(2, 1);
1865 path.close();
1866 path.moveTo(0, 1);
1867 path.lineTo(1, 1);
1868 path.lineTo(0, 2);
1869 path.close();
1870 testSimplify(reporter, path);
1871}
1872
1873static void testNondegenerate4(skiatest::Reporter* reporter) {
1874 SkPath path;
1875 path.moveTo(1, 0);
1876 path.lineTo(0, 1);
1877 path.lineTo(1, 2);
1878 path.close();
1879 path.moveTo(0, 2);
1880 path.lineTo(0, 3);
1881 path.lineTo(1, 3);
1882 path.close();
1883 testSimplify(reporter, path);
1884}
1885
1886static void testNondegenerate4x(skiatest::Reporter* reporter) {
1887 SkPath path;
1888 path.setFillType(SkPath::kEvenOdd_FillType);
1889 path.moveTo(1, 0);
1890 path.lineTo(0, 1);
1891 path.lineTo(1, 2);
1892 path.close();
1893 path.moveTo(0, 2);
1894 path.lineTo(0, 3);
1895 path.lineTo(1, 3);
1896 path.close();
1897 testSimplify(reporter, path);
1898}
1899
1900static void testQuadralateral5(skiatest::Reporter* reporter) {
1901 SkPath path;
1902 path.moveTo(0, 0);
1903 path.lineTo(0, 0);
1904 path.lineTo(1, 0);
1905 path.lineTo(1, 1);
1906 path.close();
1907 path.moveTo(0, 0);
1908 path.lineTo(2, 2);
1909 path.lineTo(3, 2);
1910 path.lineTo(3, 3);
1911 path.close();
1912 testSimplify(reporter, path);
1913}
1914
1915static void testQuadralateral5x(skiatest::Reporter* reporter) {
1916 SkPath path;
1917 path.setFillType(SkPath::kEvenOdd_FillType);
1918 path.moveTo(0, 0);
1919 path.lineTo(0, 0);
1920 path.lineTo(1, 0);
1921 path.lineTo(1, 1);
1922 path.close();
1923 path.moveTo(0, 0);
1924 path.lineTo(2, 2);
1925 path.lineTo(3, 2);
1926 path.lineTo(3, 3);
1927 path.close();
1928 testSimplify(reporter, path);
1929}
1930
1931static void testQuadralateral6(skiatest::Reporter* reporter) {
1932 SkPath path;
1933 path.moveTo(0, 0);
1934 path.lineTo(0, 0);
1935 path.lineTo(1, 0);
1936 path.lineTo(1, 1);
1937 path.close();
1938 path.moveTo(1, 0);
1939 path.lineTo(2, 0);
1940 path.lineTo(0, 2);
1941 path.lineTo(2, 2);
1942 path.close();
1943 testSimplify(reporter, path);
1944}
1945
1946static void testQuadralateral6x(skiatest::Reporter* reporter) {
1947 SkPath path;
1948 path.setFillType(SkPath::kEvenOdd_FillType);
1949 path.moveTo(0, 0);
1950 path.lineTo(0, 0);
1951 path.lineTo(1, 0);
1952 path.lineTo(1, 1);
1953 path.close();
1954 path.moveTo(1, 0);
1955 path.lineTo(2, 0);
1956 path.lineTo(0, 2);
1957 path.lineTo(2, 2);
1958 path.close();
1959 testSimplify(reporter, path);
1960}
1961
1962static void testFauxQuadralateral6(skiatest::Reporter* reporter) {
1963 SkPath path;
1964 path.moveTo(0, 0);
1965 path.lineTo(1, 0);
1966 path.lineTo(1, 1);
1967 path.close();
1968 path.moveTo(1, 0);
1969 path.lineTo(2, 0);
1970 path.lineTo(1 + 1.0f/3, 2.0f/3);
1971 path.close();
1972 path.moveTo(1 + 1.0f/3, 2.0f/3);
1973 path.lineTo(0, 2);
1974 path.lineTo(2, 2);
1975 path.close();
1976 testSimplify(reporter, path);
1977}
1978
1979static void testFauxQuadralateral6x(skiatest::Reporter* reporter) {
1980 SkPath path;
1981 path.setFillType(SkPath::kEvenOdd_FillType);
1982 path.moveTo(0, 0);
1983 path.lineTo(1, 0);
1984 path.lineTo(1, 1);
1985 path.close();
1986 path.moveTo(1, 0);
1987 path.lineTo(2, 0);
1988 path.lineTo(1 + 1.0f/3, 2.0f/3);
1989 path.close();
1990 path.moveTo(1 + 1.0f/3, 2.0f/3);
1991 path.lineTo(0, 2);
1992 path.lineTo(2, 2);
1993 path.close();
1994 testSimplify(reporter, path);
1995}
1996
1997static void testFauxQuadralateral6a(skiatest::Reporter* reporter) {
1998 SkPath path;
1999 path.moveTo(0, 0);
2000 path.lineTo(3, 0);
2001 path.lineTo(3, 3);
2002 path.close();
2003 path.moveTo(3, 0);
2004 path.lineTo(6, 0);
2005 path.lineTo(4, 2);
2006 path.close();
2007 path.moveTo(4, 2);
2008 path.lineTo(0, 6);
2009 path.lineTo(6, 6);
2010 path.close();
2011 testSimplify(reporter, path);
2012}
2013
2014static void testFauxQuadralateral6ax(skiatest::Reporter* reporter) {
2015 SkPath path;
2016 path.setFillType(SkPath::kEvenOdd_FillType);
2017 path.moveTo(0, 0);
2018 path.lineTo(3, 0);
2019 path.lineTo(3, 3);
2020 path.close();
2021 path.moveTo(3, 0);
2022 path.lineTo(6, 0);
2023 path.lineTo(4, 2);
2024 path.close();
2025 path.moveTo(4, 2);
2026 path.lineTo(0, 6);
2027 path.lineTo(6, 6);
2028 path.close();
2029 testSimplify(reporter, path);
2030}
2031
2032static void testFauxQuadralateral6b(skiatest::Reporter* reporter) {
2033 SkPath path;
2034 path.moveTo(0, 0);
2035 path.lineTo(3, 0);
2036 path.lineTo(3, 3);
2037 path.close();
2038 path.moveTo(3, 0);
2039 path.lineTo(6, 0);
2040 path.lineTo(4, 2);
2041 path.close();
2042 path.moveTo(4, 2);
2043 path.lineTo(6, 6);
2044 path.lineTo(0, 6);
2045 path.close();
2046 testSimplify(reporter, path);
2047}
2048
2049static void testFauxQuadralateral6bx(skiatest::Reporter* reporter) {
2050 SkPath path;
2051 path.setFillType(SkPath::kEvenOdd_FillType);
2052 path.moveTo(0, 0);
2053 path.lineTo(3, 0);
2054 path.lineTo(3, 3);
2055 path.close();
2056 path.moveTo(3, 0);
2057 path.lineTo(6, 0);
2058 path.lineTo(4, 2);
2059 path.close();
2060 path.moveTo(4, 2);
2061 path.lineTo(6, 6);
2062 path.lineTo(0, 6);
2063 path.close();
2064 testSimplify(reporter, path);
2065}
2066
2067static void testFauxQuadralateral6c(skiatest::Reporter* reporter) {
2068 SkPath path;
2069 path.moveTo(0, 0);
2070 path.lineTo(3, 3);
2071 path.lineTo(3, 0);
2072 path.close();
2073 path.moveTo(3, 0);
2074 path.lineTo(6, 0);
2075 path.lineTo(4, 2);
2076 path.close();
2077 path.moveTo(4, 2);
2078 path.lineTo(0, 6);
2079 path.lineTo(6, 6);
2080 path.close();
2081 testSimplify(reporter, path);
2082}
2083
2084static void testFauxQuadralateral6cx(skiatest::Reporter* reporter) {
2085 SkPath path;
2086 path.setFillType(SkPath::kEvenOdd_FillType);
2087 path.moveTo(0, 0);
2088 path.lineTo(3, 3);
2089 path.lineTo(3, 0);
2090 path.close();
2091 path.moveTo(3, 0);
2092 path.lineTo(6, 0);
2093 path.lineTo(4, 2);
2094 path.close();
2095 path.moveTo(4, 2);
2096 path.lineTo(0, 6);
2097 path.lineTo(6, 6);
2098 path.close();
2099 testSimplify(reporter, path);
2100}
2101
2102static void testFauxQuadralateral6d(skiatest::Reporter* reporter) {
2103 SkPath path;
2104 path.moveTo(0, 0);
2105 path.lineTo(3, 3);
2106 path.lineTo(3, 0);
2107 path.close();
2108 path.moveTo(3, 0);
2109 path.lineTo(6, 0);
2110 path.lineTo(4, 2);
2111 path.close();
2112 path.moveTo(4, 2);
2113 path.lineTo(6, 6);
2114 path.lineTo(0, 6);
2115 path.close();
2116 testSimplify(reporter, path);
2117}
2118
2119static void testFauxQuadralateral6dx(skiatest::Reporter* reporter) {
2120 SkPath path;
2121 path.setFillType(SkPath::kEvenOdd_FillType);
2122 path.moveTo(0, 0);
2123 path.lineTo(3, 3);
2124 path.lineTo(3, 0);
2125 path.close();
2126 path.moveTo(3, 0);
2127 path.lineTo(6, 0);
2128 path.lineTo(4, 2);
2129 path.close();
2130 path.moveTo(4, 2);
2131 path.lineTo(6, 6);
2132 path.lineTo(0, 6);
2133 path.close();
2134 testSimplify(reporter, path);
2135}
2136
2137static void testQuadralateral6a(skiatest::Reporter* reporter) {
2138 SkPath path;
2139 path.moveTo(0, 0);
2140 path.lineTo(0, 0);
2141 path.lineTo(3, 0);
2142 path.lineTo(3, 3);
2143 path.close();
2144 path.moveTo(3, 0);
2145 path.lineTo(6, 0);
2146 path.lineTo(0, 6);
2147 path.lineTo(6, 6);
2148 path.close();
2149 testSimplify(reporter, path);
2150}
2151
2152static void testQuadralateral6ax(skiatest::Reporter* reporter) {
2153 SkPath path;
2154 path.setFillType(SkPath::kEvenOdd_FillType);
2155 path.moveTo(0, 0);
2156 path.lineTo(0, 0);
2157 path.lineTo(3, 0);
2158 path.lineTo(3, 3);
2159 path.close();
2160 path.moveTo(3, 0);
2161 path.lineTo(6, 0);
2162 path.lineTo(0, 6);
2163 path.lineTo(6, 6);
2164 path.close();
2165 testSimplify(reporter, path);
2166}
2167
2168static void testQuadralateral7(skiatest::Reporter* reporter) {
2169 SkPath path;
2170 path.moveTo(0, 0);
2171 path.lineTo(0, 0);
2172 path.lineTo(1, 0);
2173 path.lineTo(2, 1);
2174 path.close();
2175 path.moveTo(1, 0);
2176 path.lineTo(1, 1);
2177 path.lineTo(2, 2);
2178 path.lineTo(1, 3);
2179 path.close();
2180 testSimplify(reporter, path);
2181}
2182
2183static void testQuadralateral7x(skiatest::Reporter* reporter) {
2184 SkPath path;
2185 path.setFillType(SkPath::kEvenOdd_FillType);
2186 path.moveTo(0, 0);
2187 path.lineTo(0, 0);
2188 path.lineTo(1, 0);
2189 path.lineTo(2, 1);
2190 path.close();
2191 path.moveTo(1, 0);
2192 path.lineTo(1, 1);
2193 path.lineTo(2, 2);
2194 path.lineTo(1, 3);
2195 path.close();
2196 testSimplify(reporter, path);
2197}
2198
2199static void testQuadralateral8(skiatest::Reporter* reporter) {
2200 SkPath path;
2201 path.moveTo(0, 0);
2202 path.lineTo(3, 1);
2203 path.lineTo(1, 3);
2204 path.lineTo(3, 3);
2205 path.close();
2206 path.moveTo(2, 1);
2207 path.lineTo(0, 2);
2208 path.lineTo(3, 2);
2209 path.lineTo(2, 3);
2210 path.close();
2211 testSimplify(reporter, path);
2212}
2213
2214static void testQuadralateral8x(skiatest::Reporter* reporter) {
2215 SkPath path;
2216 path.setFillType(SkPath::kEvenOdd_FillType);
2217 path.moveTo(0, 0);
2218 path.lineTo(3, 1);
2219 path.lineTo(1, 3);
2220 path.lineTo(3, 3);
2221 path.close();
2222 path.moveTo(2, 1);
2223 path.lineTo(0, 2);
2224 path.lineTo(3, 2);
2225 path.lineTo(2, 3);
2226 path.close();
2227 testSimplify(reporter, path);
2228}
2229
2230static void testQuadralateral9(skiatest::Reporter* reporter) {
2231 SkPath path;
2232 path.moveTo(0, 0);
2233 path.lineTo(1, 0);
2234 path.lineTo(1, 2);
2235 path.lineTo(2, 2);
2236 path.close();
2237 path.moveTo(1, 1);
2238 path.lineTo(2, 1);
2239 path.lineTo(1, 3);
2240 path.lineTo(2, 3);
2241 path.close();
2242 testSimplify(reporter, path);
2243}
2244
2245static void testQuadralateral9x(skiatest::Reporter* reporter) {
2246 SkPath path;
2247 path.setFillType(SkPath::kEvenOdd_FillType);
2248 path.moveTo(0, 0);
2249 path.lineTo(1, 0);
2250 path.lineTo(1, 2);
2251 path.lineTo(2, 2);
2252 path.close();
2253 path.moveTo(1, 1);
2254 path.lineTo(2, 1);
2255 path.lineTo(1, 3);
2256 path.lineTo(2, 3);
2257 path.close();
2258 testSimplify(reporter, path);
2259}
2260
2261static void testLine1a(skiatest::Reporter* reporter) {
2262 SkPath path;
2263 path.setFillType(SkPath::kWinding_FillType);
2264 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
2265 path.addRect(4, 0, 13, 13, SkPath::kCCW_Direction);
2266 testSimplify(reporter, path);
2267}
2268
2269static void testLine1ax(skiatest::Reporter* reporter) {
2270 SkPath path;
2271 path.setFillType(SkPath::kEvenOdd_FillType);
2272 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
2273 path.addRect(4, 0, 13, 13, SkPath::kCCW_Direction);
2274 testSimplify(reporter, path);
2275}
2276
2277static void testLine2ax(skiatest::Reporter* reporter) {
2278 SkPath path;
2279 path.setFillType(SkPath::kEvenOdd_FillType);
2280 path.addRect(0, 20, 20, 20, SkPath::kCW_Direction);
2281 path.addRect(0, 20, 12, 30, SkPath::kCW_Direction);
2282 path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction);
2283 testSimplify(reporter, path);
2284}
2285
2286static void testLine3aax(skiatest::Reporter* reporter) {
2287 SkPath path;
2288 path.setFillType(SkPath::kEvenOdd_FillType);
2289 path.addRect(10, 30, 30, 30, SkPath::kCW_Direction);
2290 path.addRect(18, 20, 30, 30, SkPath::kCCW_Direction);
2291 path.addRect(0, 32, 9, 36, SkPath::kCCW_Direction);
2292 testSimplify(reporter, path);
2293}
2294
2295static void testLine4ax(skiatest::Reporter* reporter) {
2296 SkPath path;
2297 path.setFillType(SkPath::kEvenOdd_FillType);
2298 path.addRect(10, 30, 30, 30, SkPath::kCW_Direction);
2299 path.addRect(24, 20, 36, 30, SkPath::kCCW_Direction);
2300 path.addRect(0, 32, 9, 36, SkPath::kCCW_Direction);
2301 testSimplify(reporter, path);
2302}
2303
2304static void testQuadratic1(skiatest::Reporter* reporter) {
2305 SkPath path;
2306 path.moveTo(0, 0);
2307 path.quadTo(0, 0, 0, 0);
2308 path.lineTo(1, 0);
2309 path.close();
2310 path.moveTo(0, 0);
2311 path.lineTo(0, 0);
2312 path.quadTo(0, 0, 0, 0);
2313 path.close();
2314 testSimplify(reporter, path);
2315}
2316
2317static void testQuadratic1x(skiatest::Reporter* reporter) {
2318 SkPath path;
2319 path.setFillType(SkPath::kEvenOdd_FillType);
2320 path.moveTo(0, 0);
2321 path.quadTo(0, 0, 0, 0);
2322 path.lineTo(1, 0);
2323 path.close();
2324 path.moveTo(0, 0);
2325 path.lineTo(0, 0);
2326 path.quadTo(0, 0, 0, 0);
2327 path.close();
2328 testSimplify(reporter, path);
2329}
2330
2331static void testQuadratic2(skiatest::Reporter* reporter) {
2332 SkPath path;
2333 path.moveTo(0, 0);
2334 path.quadTo(0, 0, 0, 0);
2335 path.lineTo(3, 0);
2336 path.close();
2337 path.moveTo(0, 0);
2338 path.lineTo(0, 0);
2339 path.quadTo(1, 0, 0, 1);
2340 path.close();
2341 testSimplify(reporter, path);
2342}
2343
2344static void testQuadratic2x(skiatest::Reporter* reporter) {
2345 SkPath path;
2346 path.setFillType(SkPath::kEvenOdd_FillType);
2347 path.moveTo(0, 0);
2348 path.quadTo(0, 0, 0, 0);
2349 path.lineTo(3, 0);
2350 path.close();
2351 path.moveTo(0, 0);
2352 path.lineTo(0, 0);
2353 path.quadTo(1, 0, 0, 1);
2354 path.close();
2355 testSimplify(reporter, path);
2356}
2357
2358static void testQuadratic3(skiatest::Reporter* reporter) {
2359 SkPath path;
2360 path.moveTo(0, 0);
2361 path.quadTo(0, 0, 1, 0);
2362 path.lineTo(0, 2);
2363 path.close();
2364 path.moveTo(0, 0);
2365 path.lineTo(0, 0);
2366 path.quadTo(1, 0, 0, 1);
2367 path.close();
2368 testSimplify(reporter, path);
2369}
2370
2371static void testQuadratic3x(skiatest::Reporter* reporter) {
2372 SkPath path;
2373 path.setFillType(SkPath::kEvenOdd_FillType);
2374 path.moveTo(0, 0);
2375 path.quadTo(0, 0, 1, 0);
2376 path.lineTo(0, 2);
2377 path.close();
2378 path.moveTo(0, 0);
2379 path.lineTo(0, 0);
2380 path.quadTo(1, 0, 0, 1);
2381 path.close();
2382 testSimplify(reporter, path);
2383}
2384
2385static void testQuadratic4(skiatest::Reporter* reporter) {
2386 SkPath path;
2387 path.moveTo(0, 0);
2388 path.quadTo(0, 0, 1, 0);
2389 path.lineTo(0, 2);
2390 path.close();
2391 path.moveTo(0, 0);
2392 path.lineTo(0, 0);
2393 path.quadTo(1, 0, 0, 2);
2394 path.close();
2395 testSimplify(reporter, path);
2396}
2397
2398static void testQuadratic4x(skiatest::Reporter* reporter) {
2399 SkPath path;
2400 path.setFillType(SkPath::kEvenOdd_FillType);
2401 path.moveTo(0, 0);
2402 path.quadTo(0, 0, 1, 0);
2403 path.lineTo(0, 2);
2404 path.close();
2405 path.moveTo(0, 0);
2406 path.lineTo(0, 0);
2407 path.quadTo(1, 0, 0, 2);
2408 path.close();
2409 testSimplify(reporter, path);
2410}
2411
2412static void testQuadratic5(skiatest::Reporter* reporter) {
2413 SkPath path;
2414 path.moveTo(0, 0);
2415 path.quadTo(0, 0, 0, 0);
2416 path.lineTo(0, 1);
2417 path.close();
2418 path.moveTo(0, 0);
2419 path.lineTo(1, 0);
2420 path.quadTo(0, 1, 0, 2);
2421 path.close();
2422 testSimplify(reporter, path);
2423}
2424
2425static void testQuadratic6(skiatest::Reporter* reporter) {
2426 SkPath path;
2427 path.moveTo(0, 0);
2428 path.quadTo(0, 0, 1, 0);
2429 path.lineTo(2, 1);
2430 path.close();
2431 path.moveTo(0, 0);
2432 path.lineTo(0, 0);
2433 path.quadTo(2, 0, 0, 1);
2434 path.close();
2435 testSimplify(reporter, path);
2436}
2437
2438static void testQuadratic7(skiatest::Reporter* reporter) {
2439 SkPath path;
2440 path.moveTo(0, 0);
2441 path.quadTo(0, 0, 1, 0);
2442 path.lineTo(3, 1);
2443 path.close();
2444 path.moveTo(0, 0);
2445 path.lineTo(0, 0);
2446 path.quadTo(3, 0, 1, 2);
2447 path.close();
2448 testSimplify(reporter, path);
2449}
2450
2451static void testQuadratic8(skiatest::Reporter* reporter) {
2452 SkPath path;
2453 path.moveTo(0, 0);
2454 path.quadTo(0, 0, 1, 0);
2455 path.lineTo(0, 2);
2456 path.close();
2457 path.moveTo(0, 0);
2458 path.lineTo(1, 0);
2459 path.quadTo(0, 1, 1, 2);
2460 path.close();
2461 testSimplify(reporter, path);
2462}
2463
2464static void testQuadratic9(skiatest::Reporter* reporter) {
2465 SkPath path;
2466 path.moveTo(0, 0);
2467 path.quadTo(0, 0, 1, 0);
2468 path.lineTo(3, 1);
2469 path.close();
2470 path.moveTo(0, 0);
2471 path.lineTo(1, 0);
2472 path.quadTo(1, 2, 3, 2);
2473 path.close();
2474 testSimplify(reporter, path);
2475}
2476
2477static void testQuadratic14(skiatest::Reporter* reporter) {
2478 SkPath path;
2479 path.moveTo(0, 0);
2480 path.quadTo(0, 0, 1, 0);
2481 path.lineTo(3, 2);
2482 path.close();
2483 path.moveTo(0, 0);
2484 path.lineTo(1, 0);
2485 path.quadTo(3, 2, 3, 3);
2486 path.close();
2487 testSimplify(reporter, path);
2488}
2489
2490static void testQuadratic15(skiatest::Reporter* reporter) {
2491 SkPath path;
2492 path.moveTo(0, 0);
2493 path.quadTo(0, 0, 1, 0);
2494 path.lineTo(1, 3);
2495 path.close();
2496 path.moveTo(1, 0);
2497 path.lineTo(0, 1);
2498 path.quadTo(1, 1, 0, 3);
2499 path.close();
2500 testSimplify(reporter, path);
2501}
2502
2503static void testQuadratic17x(skiatest::Reporter* reporter) {
2504 SkPath path;
2505 path.setFillType(SkPath::kEvenOdd_FillType);
2506 path.moveTo(0, 0);
2507 path.quadTo(0, 0, 3, 1);
2508 path.lineTo(0, 2);
2509 path.close();
2510 path.moveTo(0, 0);
2511 path.lineTo(1, 0);
2512 path.quadTo(3, 1, 0, 2);
2513 path.close();
2514 testSimplify(reporter, path);
2515}
2516
2517static void testQuadratic18(skiatest::Reporter* reporter) {
2518 SkPath path;
2519 path.moveTo(0, 0);
2520 path.quadTo(1, 0, 0, 1);
2521 path.lineTo(0, 1);
2522 path.close();
2523 path.moveTo(0, 0);
2524 path.lineTo(0, 0);
2525 path.quadTo(1, 0, 1, 1);
2526 path.close();
2527 testSimplify(reporter, path);
2528}
2529
2530static void testQuadratic19(skiatest::Reporter* reporter) {
2531 SkPath path;
2532 path.moveTo(0, 0);
2533 path.quadTo(1, 0, 0, 1);
2534 path.lineTo(0, 1);
2535 path.close();
2536 path.moveTo(0, 0);
2537 path.lineTo(0, 0);
2538 path.quadTo(2, 0, 0, 1);
2539 path.close();
2540 testSimplify(reporter, path);
2541}
2542
2543static void testQuadratic20(skiatest::Reporter* reporter) {
2544 SkPath path;
2545 path.moveTo(0, 0);
2546 path.quadTo(1, 0, 0, 1);
2547 path.lineTo(0, 1);
2548 path.close();
2549 path.moveTo(0, 0);
2550 path.lineTo(0, 0);
2551 path.quadTo(1, 0, 0, 1);
2552 path.close();
2553 testSimplify(reporter, path);
2554}
2555
2556static void testQuadratic21(skiatest::Reporter* reporter) {
2557 SkPath path;
2558 path.moveTo(0, 0);
2559 path.quadTo(1, 0, 0, 1);
2560 path.lineTo(0, 1);
2561 path.close();
2562 path.moveTo(0, 0);
2563 path.lineTo(0, 0);
2564 path.quadTo(1, 0, 0, 2);
2565 path.close();
2566 testSimplify(reporter, path);
2567}
2568
2569static void testQuadratic22(skiatest::Reporter* reporter) {
2570 SkPath path;
2571 path.moveTo(0, 0);
2572 path.quadTo(1, 0, 0, 1);
2573 path.lineTo(0, 1);
2574 path.close();
2575 path.moveTo(0, 0);
2576 path.lineTo(0, 0);
2577 path.quadTo(0, 1, 2, 1);
2578 path.close();
2579 testSimplify(reporter, path);
2580}
2581
2582static void testQuadratic23(skiatest::Reporter* reporter) {
2583 SkPath path;
2584 path.moveTo(0, 0);
2585 path.quadTo(1, 0, 0, 1);
2586 path.lineTo(0, 1);
2587 path.close();
2588 path.moveTo(0, 0);
2589 path.lineTo(0, 0);
2590 path.quadTo(0, 2, 1, 2);
2591 path.close();
2592 testSimplify(reporter, path);
2593}
2594
2595static void testQuadratic24(skiatest::Reporter* reporter) {
2596 SkPath path;
2597 path.moveTo(0, 0);
2598 path.quadTo(1, 0, 0, 1);
2599 path.lineTo(0, 1);
2600 path.close();
2601 path.moveTo(0, 0);
2602 path.lineTo(1, 0);
2603 path.quadTo(2, 0, 0, 1);
2604 path.close();
2605 testSimplify(reporter, path);
2606}
2607
2608static void testQuadratic25(skiatest::Reporter* reporter) {
2609 SkPath path;
2610 path.moveTo(0, 0);
2611 path.quadTo(1, 0, 1, 1);
2612 path.lineTo(1, 1);
2613 path.close();
2614 path.moveTo(0, 0);
2615 path.lineTo(0, 0);
2616 path.quadTo(2, 1, 0, 2);
2617 path.close();
2618 testSimplify(reporter, path);
2619}
2620
2621static void testQuadratic26(skiatest::Reporter* reporter) {
2622 SkPath path;
2623 path.moveTo(0, 0);
2624 path.quadTo(1, 0, 1, 1);
2625 path.lineTo(0, 2);
2626 path.close();
2627 path.moveTo(0, 0);
2628 path.lineTo(0, 0);
2629 path.quadTo(1, 0, 0, 1);
2630 path.close();
2631 testSimplify(reporter, path);
2632}
2633
2634static void testQuadratic27(skiatest::Reporter* reporter) {
2635 SkPath path;
2636 path.moveTo(0, 0);
2637 path.quadTo(1, 0, 1, 1);
2638 path.lineTo(2, 1);
2639 path.close();
2640 path.moveTo(0, 0);
2641 path.lineTo(0, 0);
2642 path.quadTo(2, 1, 0, 2);
2643 path.close();
2644 testSimplify(reporter, path);
2645}
2646
2647static void testQuadratic28(skiatest::Reporter* reporter) {
2648 SkPath path;
2649 path.moveTo(0, 0);
2650 path.quadTo(1, 0, 0, 1);
2651 path.lineTo(0, 1);
2652 path.close();
2653 path.moveTo(0, 0);
2654 path.lineTo(0, 2);
2655 path.quadTo(1, 2, 0, 3);
2656 path.close();
2657 testSimplify(reporter, path);
2658}
2659
2660static void testQuadratic29(skiatest::Reporter* reporter) {
2661 SkPath path;
2662 path.moveTo(0, 0);
2663 path.quadTo(1, 0, 2, 1);
2664 path.lineTo(0, 2);
2665 path.close();
2666 path.moveTo(0, 0);
2667 path.lineTo(0, 0);
2668 path.quadTo(1, 0, 0, 1);
2669 path.close();
2670 testSimplify(reporter, path);
2671}
2672
2673static void testQuadratic30(skiatest::Reporter* reporter) {
2674 SkPath path;
2675 path.moveTo(0, 0);
2676 path.quadTo(1, 0, 1, 2);
2677 path.lineTo(1, 2);
2678 path.close();
2679 path.moveTo(0, 0);
2680 path.lineTo(1, 0);
2681 path.quadTo(0, 1, 1, 2);
2682 path.close();
2683 testSimplify(reporter, path);
2684}
2685
2686static void testQuadratic31(skiatest::Reporter* reporter) {
2687 SkPath path;
2688 path.moveTo(0, 0);
2689 path.quadTo(1, 0, 1, 2);
2690 path.lineTo(1, 2);
2691 path.close();
2692 path.moveTo(0, 0);
2693 path.lineTo(1, 0);
2694 path.quadTo(0, 1, 1, 3);
2695 path.close();
2696 testSimplify(reporter, path);
2697}
2698
2699static void testQuadratic32(skiatest::Reporter* reporter) {
2700 SkPath path;
2701 path.moveTo(0, 0);
2702 path.quadTo(1, 0, 2, 3);
2703 path.lineTo(2, 3);
2704 path.close();
2705 path.moveTo(0, 0);
2706 path.lineTo(0, 0);
2707 path.quadTo(3, 1, 0, 2);
2708 path.close();
2709 testSimplify(reporter, path);
2710}
2711
2712static void testQuadratic33(skiatest::Reporter* reporter) {
2713 SkPath path;
2714 path.moveTo(0, 0);
2715 path.quadTo(2, 0, 0, 1);
2716 path.lineTo(0, 1);
2717 path.close();
2718 path.moveTo(0, 0);
2719 path.lineTo(1, 1);
2720 path.quadTo(2, 1, 2, 2);
2721 path.close();
2722 testSimplify(reporter, path);
2723}
2724
2725static void testQuadratic34(skiatest::Reporter* reporter) {
2726 SkPath path;
2727 path.moveTo(0, 0);
2728 path.quadTo(2, 0, 0, 1);
2729 path.lineTo(0, 1);
2730 path.close();
2731 path.moveTo(1, 0);
2732 path.lineTo(1, 1);
2733 path.quadTo(2, 1, 1, 2);
2734 path.close();
2735 testSimplify(reporter, path);
2736}
2737
2738static void testQuadratic35(skiatest::Reporter* reporter) {
2739 SkPath path;
2740 path.moveTo(0, 0);
2741 path.quadTo(0, 1, 1, 1);
2742 path.lineTo(1, 3);
2743 path.close();
2744 path.moveTo(2, 0);
2745 path.lineTo(3, 0);
2746 path.quadTo(0, 1, 1, 1);
2747 path.close();
2748 testSimplify(reporter, path);
2749}
2750
2751static void testQuadratic36(skiatest::Reporter* reporter) {
2752 SkPath path;
2753 path.moveTo(0, 0);
2754 path.quadTo(2, 1, 2, 3);
2755 path.lineTo(2, 3);
2756 path.close();
2757 path.moveTo(3, 1);
2758 path.lineTo(1, 2);
2759 path.quadTo(3, 2, 1, 3);
2760 path.close();
2761 testSimplify(reporter, path);
2762}
2763
2764static void testQuadratic37(skiatest::Reporter* reporter) {
2765 SkPath path;
2766 path.moveTo(0, 0);
2767 path.quadTo(0, 2, 1, 2);
2768 path.lineTo(1, 2);
2769 path.close();
2770 path.moveTo(0, 0);
2771 path.lineTo(3, 1);
2772 path.quadTo(0, 2, 1, 2);
2773 path.close();
2774 testSimplify(reporter, path);
2775}
2776
2777static void testQuadratic38(skiatest::Reporter* reporter) {
2778 SkPath path;
2779 path.moveTo(1, 0);
2780 path.quadTo(0, 1, 1, 1);
2781 path.lineTo(1, 1);
2782 path.close();
2783 path.moveTo(1, 0);
2784 path.lineTo(1, 2);
2785 path.quadTo(2, 2, 1, 3);
2786 path.close();
2787 testSimplify(reporter, path);
2788}
2789
2790static void testQuadratic51(skiatest::Reporter* reporter) {
2791 SkPath path;
2792 path.moveTo(369.863983f, 145.645813f);
2793 path.quadTo(382.380371f, 121.254936f, 406.236359f, 121.254936f);
2794 path.lineTo(369.863983f, 145.645813f);
2795 path.close();
2796 path.moveTo(369.970581f, 137.94342f);
2797 path.quadTo(383.98465f, 121.254936f, 406.235992f, 121.254936f);
2798 path.lineTo(369.970581f, 137.94342f);
2799 path.close();
2800 testSimplify(reporter, path);
2801}
2802
2803static void testQuadratic53(skiatest::Reporter* reporter) {
2804 SkPath path;
2805 path.moveTo(303.12088f, 141.299606f);
2806 path.lineTo(330.463562f, 217.659027f);
2807 path.lineTo(303.12088f, 141.299606f);
2808 path.close();
2809 path.moveTo(371.919067f, 205.854996f);
2810 path.lineTo(326.236786f, 205.854996f);
2811 path.quadTo(329.104431f, 231.663818f, 351.512085f, 231.663818f);
2812 path.lineTo(371.919067f, 205.854996f);
2813 path.close();
2814 testSimplify(reporter, path);
2815}
2816static void testQuadratic55(skiatest::Reporter* reporter) {
2817 SkPath path;
2818path.moveTo(303.12088f, 141.299606f);
2819path.lineTo(330.463562f, 217.659027f);
2820path.lineTo(358.606506f, 141.299606f);
2821path.lineTo(303.12088f, 141.299606f);
2822path.close();
2823path.moveTo(326.236786f, 205.854996f);
2824path.quadTo(329.104431f, 231.663818f, 351.512085f, 231.663818f);
2825path.lineTo(326.236786f, 205.854996f);
2826path.close();
2827 testSimplify(reporter, path);
2828}
2829
2830static void testQuadratic56(skiatest::Reporter* reporter) {
2831 SkPath path;
2832path.moveTo(366.608826f, 151.196014f);
2833path.quadTo(378.803101f, 136.674606f, 398.164948f, 136.674606f);
2834path.lineTo(354.009216f, 208.816208f);
2835path.lineTo(393.291473f, 102.232819f);
2836path.lineTo(359.978058f, 136.581512f);
2837path.quadTo(378.315979f, 136.581512f, 388.322723f, 149.613556f);
2838path.lineTo(364.390686f, 157.898193f);
2839path.quadTo(375.281769f, 136.674606f, 396.039917f, 136.674606f);
2840path.lineTo(350, 120);
2841path.lineTo(366.608826f, 151.196014f);
2842path.close();
2843 testSimplify(reporter, path);
2844}
2845
2846static void testLine80(skiatest::Reporter* reporter) {
2847 SkPath path;
2848path.moveTo(4, 0);
2849path.lineTo(3, 7);
2850path.lineTo(7, 5);
2851path.lineTo(2, 2);
2852path.close();
2853path.moveTo(0, 6);
2854path.lineTo(6, 12);
2855path.lineTo(8, 3);
2856path.close();
2857 testSimplify(reporter, path);
2858}
2859
2860static void testQuadratic58(skiatest::Reporter* reporter) {
2861 SkPath path;
2862path.moveTo(283.714233f, 240);
2863path.lineTo(283.714233f, 141.299606f);
2864path.lineTo(303.12088f, 141.299606f);
2865path.lineTo(330.463562f, 217.659027f);
2866path.lineTo(358.606506f, 141.299606f);
2867path.lineTo(362.874634f, 159.705902f);
2868path.lineTo(335.665344f, 233.397751f);
2869path.lineTo(322.12738f, 233.397751f);
2870path.lineTo(295.718353f, 159.505829f);
2871path.lineTo(295.718353f, 240);
2872path.lineTo(283.714233f, 240);
2873path.close();
2874path.moveTo(322.935669f, 231.030273f);
2875path.quadTo(312.832214f, 220.393295f, 312.832214f, 203.454178f);
2876path.quadTo(312.832214f, 186.981888f, 321.73526f, 176.444946f);
2877path.quadTo(330.638306f, 165.90802f, 344.509705f, 165.90802f);
2878path.quadTo(357.647522f, 165.90802f, 364.81665f, 175.244537f);
2879path.lineTo(371.919067f, 205.854996f);
2880path.lineTo(326.236786f, 205.854996f);
2881path.quadTo(329.104431f, 231.663818f, 351.512085f, 231.663818f);
2882path.lineTo(322.935669f, 231.030273f);
2883path.close();
2884path.moveTo(326.837006f, 195.984955f);
2885path.lineTo(358.78125f, 195.984955f);
2886path.quadTo(358.78125f, 175.778046f, 343.709442f, 175.778046f);
2887path.quadTo(328.570923f, 175.778046f, 326.837006f, 195.984955f);
2888path.close();
2889 testSimplify(reporter, path);
2890}
2891
2892static void testQuadratic59x(skiatest::Reporter* reporter) {
2893 SkPath path;
2894 path.setFillType(SkPath::kEvenOdd_FillType);
2895 path.moveTo(0, 0);
2896 path.quadTo(0, 0, 0, 0);
2897 path.lineTo(2, 2);
2898 path.close();
2899 path.moveTo(0, 0);
2900 path.lineTo(2, 0);
2901 path.quadTo(3, 1, 1, 2);
2902 path.close();
2903 testSimplify(reporter, path);
2904}
2905
2906static void testQuadratic59(skiatest::Reporter* reporter) {
2907 SkPath path;
2908 path.setFillType(SkPath::kWinding_FillType);
2909 path.moveTo(0, 0);
2910 path.quadTo(0, 0, 0, 0);
2911 path.lineTo(2, 2);
2912 path.close();
2913 path.moveTo(0, 0);
2914 path.lineTo(2, 0);
2915 path.quadTo(3, 1, 1, 2);
2916 path.close();
2917 testSimplify(reporter, path);
2918}
2919
2920static void testQuadratic63(skiatest::Reporter* reporter) {
2921 SkPath path;
2922 path.moveTo(0, 0);
2923 path.quadTo(0, 0, 0, 0);
2924 path.lineTo(3, 2);
2925 path.close();
2926 path.moveTo(1, 0);
2927 path.lineTo(2, 1);
2928 path.quadTo(2, 1, 2, 2);
2929 path.close();
2930 testSimplify(reporter, path);
2931}
2932
2933static void testQuadratic64(skiatest::Reporter* reporter) {
2934 SkPath path;
2935 path.moveTo(0, 0);
2936 path.quadTo(0, 0, 0, 0);
2937 path.lineTo(2, 3);
2938 path.close();
2939 path.moveTo(1, 2);
2940 path.lineTo(2, 2);
2941 path.quadTo(0, 3, 3, 3);
2942 path.close();
2943 testSimplify(reporter, path);
2944}
2945
2946static void testQuadratic65(skiatest::Reporter* reporter) {
2947 SkPath path;
2948 path.moveTo(0, 0);
2949 path.quadTo(0, 0, 0, 0);
2950 path.lineTo(3, 2);
2951 path.close();
2952 path.moveTo(2, 1);
2953 path.lineTo(2, 2);
2954 path.quadTo(0, 3, 1, 3);
2955 path.close();
2956 testSimplify(reporter, path);
2957}
2958
2959static void testQuadratic67x(skiatest::Reporter* reporter) {
2960 SkPath path;
2961 path.setFillType(SkPath::kEvenOdd_FillType);
2962 path.moveTo(0, 0);
2963 path.quadTo(0, 0, 2, 1);
2964 path.lineTo(2, 2);
2965 path.close();
2966 path.moveTo(0, 0);
2967 path.lineTo(2, 0);
2968 path.quadTo(1, 1, 3, 2);
2969 path.close();
2970 testSimplify(reporter, path);
2971}
2972
2973static void testQuadratic68(skiatest::Reporter* reporter) {
2974 SkPath path;
2975 path.moveTo(0, 0);
2976 path.quadTo(1, 0, 0, 1);
2977 path.lineTo(1, 2);
2978 path.close();
2979 path.moveTo(0, 0);
2980 path.lineTo(0, 0);
2981 path.quadTo(0, 1, 2, 1);
2982 path.close();
2983 testSimplify(reporter, path);
2984}
2985
2986static void testQuadratic69(skiatest::Reporter* reporter) {
2987 SkPath path;
2988 path.moveTo(0, 0);
2989 path.quadTo(0, 0, 0, 1);
2990 path.lineTo(3, 2);
2991 path.close();
2992 path.moveTo(2, 0);
2993 path.lineTo(1, 1);
2994 path.quadTo(3, 2, 2, 3);
2995 path.close();
2996 testSimplify(reporter, path);
2997}
2998
2999static void testQuadratic70x(skiatest::Reporter* reporter) {
3000 SkPath path;
3001 path.setFillType(SkPath::kEvenOdd_FillType);
3002 path.moveTo(0, 0);
3003 path.quadTo(1, 0, 0, 1);
3004 path.lineTo(1, 2);
3005 path.close();
3006 path.moveTo(0, 0);
3007 path.lineTo(0, 0);
3008 path.quadTo(0, 1, 2, 1);
3009 path.close();
3010 testSimplify(reporter, path);
3011}
3012
3013static void testQuadratic71(skiatest::Reporter* reporter) {
3014 SkPath path;
3015 path.moveTo(0, 0);
3016 path.quadTo(1, 0, 1, 1);
3017 path.lineTo(3, 2);
3018 path.close();
3019 path.moveTo(0, 0);
3020 path.lineTo(0, 0);
3021 path.quadTo(1, 1, 3, 1);
3022 path.close();
3023 testSimplify(reporter, path);
3024}
3025
3026static void testQuadratic72(skiatest::Reporter* reporter) {
3027 SkPath path;
3028 path.moveTo(0, 0);
3029 path.quadTo(1, 0, 1, 2);
3030 path.lineTo(1, 2);
3031 path.close();
3032 path.moveTo(0, 0);
3033 path.lineTo(1, 0);
3034 path.quadTo(0, 1, 3, 2);
3035 path.close();
3036 testSimplify(reporter, path);
3037}
3038
3039static void testQuadratic73(skiatest::Reporter* reporter) {
3040 SkPath path;
3041 path.moveTo(0, 0);
3042 path.quadTo(1, 0, 0, 3);
3043 path.lineTo(0, 3);
3044 path.close();
3045 path.moveTo(0, 0);
3046 path.lineTo(1, 0);
3047 path.quadTo(0, 1, 1, 1);
3048 path.close();
3049 testSimplify(reporter, path);
3050}
3051
3052static void testQuadratic74(skiatest::Reporter* reporter) {
3053 SkPath path;
3054 path.moveTo(0, 0);
3055 path.quadTo(1, 0, 1, 3);
3056 path.lineTo(1, 3);
3057 path.close();
3058 path.moveTo(0, 0);
3059 path.lineTo(0, 1);
3060 path.quadTo(3, 2, 2, 3);
3061 path.close();
3062 testSimplify(reporter, path);
3063}
3064
3065static void testQuadratic75(skiatest::Reporter* reporter) {
3066 SkPath path;
3067 path.moveTo(0, 0);
3068 path.quadTo(1, 0, 1, 3);
3069 path.lineTo(2, 3);
3070 path.close();
3071 path.moveTo(0, 0);
3072 path.lineTo(0, 1);
3073 path.quadTo(3, 2, 2, 3);
3074 path.close();
3075 testSimplify(reporter, path);
3076}
3077
3078static void testQuadratic76(skiatest::Reporter* reporter) {
3079 SkPath path;
3080 path.moveTo(0, 0);
3081 path.quadTo(0, 0, 0, 0);
3082 path.lineTo(2, 3);
3083 path.close();
3084 path.moveTo(1, 0);
3085 path.lineTo(1, 2);
3086 path.quadTo(1, 2, 2, 2);
3087 path.close();
3088 testSimplify(reporter, path);
3089}
3090
3091static void testQuadratic77(skiatest::Reporter* reporter) {
3092 SkPath path;
3093 path.moveTo(0, 0);
3094 path.quadTo(1, 0, 1, 1);
3095 path.lineTo(3, 1);
3096 path.close();
3097 path.moveTo(0, 0);
3098 path.lineTo(1, 0);
3099 path.quadTo(0, 1, 3, 2);
3100 path.close();
3101 testSimplify(reporter, path);
3102}
3103
3104static void testQuadratic78(skiatest::Reporter* reporter) {
3105 SkPath path;
3106 path.moveTo(0, 0);
3107 path.quadTo(1, 0, 1, 2);
3108 path.lineTo(3, 2);
3109 path.close();
3110 path.moveTo(0, 0);
3111 path.lineTo(0, 0);
3112 path.quadTo(2, 1, 0, 2);
3113 path.close();
3114 testSimplify(reporter, path);
3115}
3116
3117static void testQuadratic79(skiatest::Reporter* reporter) {
3118 SkPath path;
3119 path.moveTo(0, 0);
3120 path.quadTo(1, 0, 1, 2);
3121 path.lineTo(3, 2);
3122 path.close();
3123 path.moveTo(0, 0);
3124 path.lineTo(1, 0);
3125 path.quadTo(0, 1, 3, 2);
3126 path.close();
3127 testSimplify(reporter, path);
3128}
3129
3130static void testEight1(skiatest::Reporter* reporter) {
3131 SkPath path;
3132 path.moveTo(0, 0);
3133 path.lineTo(2, 2);
3134 path.lineTo(0, 2);
3135 path.lineTo(2, 0);
3136 path.close();
3137 testSimplify(reporter, path);
3138}
3139
3140static void testEight2(skiatest::Reporter* reporter) {
3141 SkPath path;
3142 path.moveTo(0, 0);
3143 path.lineTo(2, 0);
3144 path.lineTo(0, 2);
3145 path.lineTo(2, 2);
3146 path.close();
3147 testSimplify(reporter, path);
3148}
3149
3150static void testEight3(skiatest::Reporter* reporter) {
3151 SkPath path;
3152 path.moveTo(0, 0);
3153 path.lineTo(0, 2);
3154 path.lineTo(2, 0);
3155 path.lineTo(2, 2);
3156 path.close();
3157 testSimplify(reporter, path);
3158}
3159
3160static void testEight4(skiatest::Reporter* reporter) {
3161 SkPath path;
3162 path.moveTo(0, 0);
3163 path.lineTo(2, 2);
3164 path.lineTo(2, 0);
3165 path.lineTo(0, 2);
3166 path.close();
3167 testSimplify(reporter, path);
3168}
3169
3170static void testEight5(skiatest::Reporter* reporter) {
3171 SkPath path;
3172 path.moveTo(1, 0);
3173 path.lineTo(1, 2);
3174 path.lineTo(0, 2);
3175 path.lineTo(2, 0);
3176 path.close();
3177 testSimplify(reporter, path);
3178}
3179
3180static void testEight6(skiatest::Reporter* reporter) {
3181 SkPath path;
3182 path.moveTo(1, 0);
3183 path.lineTo(2, 0);
3184 path.lineTo(0, 2);
3185 path.lineTo(1, 2);
3186 path.close();
3187 testSimplify(reporter, path);
3188}
3189
3190static void testEight7(skiatest::Reporter* reporter) {
3191 SkPath path;
3192 path.moveTo(0, 0);
3193 path.lineTo(0, 1);
3194 path.lineTo(2, 1);
3195 path.lineTo(2, 2);
3196 path.close();
3197 testSimplify(reporter, path);
3198}
3199
3200static void testEight8(skiatest::Reporter* reporter) {
3201 SkPath path;
3202 path.moveTo(0, 0);
3203 path.lineTo(2, 2);
3204 path.lineTo(2, 1);
3205 path.lineTo(0, 1);
3206 path.close();
3207 testSimplify(reporter, path);
3208}
3209
3210static void testEight9(skiatest::Reporter* reporter) {
3211 SkPath path;
3212 path.moveTo(1, 0);
3213 path.lineTo(1, 2);
3214 path.lineTo(2, 1);
3215 path.lineTo(0, 1);
3216 path.close();
3217 testSimplify(reporter, path);
3218}
3219
3220static void testEight10(skiatest::Reporter* reporter) {
3221 SkPath path;
3222 path.moveTo(1, 0);
3223 path.lineTo(0, 1);
3224 path.lineTo(2, 1);
3225 path.lineTo(1, 2);
3226 path.close();
3227 testSimplify(reporter, path);
3228}
3229
3230static void testQuadratic80(skiatest::Reporter* reporter) {
3231 SkPath path;
3232 path.moveTo(0, 0);
3233 path.quadTo(1, 0, 2, 3);
3234 path.lineTo(2, 3);
3235 path.close();
3236 path.moveTo(1, 0);
3237 path.lineTo(3, 0);
3238 path.quadTo(0, 1, 1, 1);
3239 path.close();
3240 testSimplify(reporter, path);
3241}
3242
3243static void testQuadratic81(skiatest::Reporter* reporter) {
3244 SkPath path;
3245 path.moveTo(0, 0);
3246 path.quadTo(2, 0, 1, 1);
3247 path.lineTo(1, 1);
3248 path.close();
3249 path.moveTo(0, 0);
3250 path.lineTo(0, 0);
3251 path.quadTo(2, 1, 0, 2);
3252 path.close();
3253 testSimplify(reporter, path);
3254}
3255
3256static void testQuadratic82(skiatest::Reporter* reporter) {
3257 SkPath path;
3258 path.moveTo(0, 0);
3259 path.quadTo(2, 0, 1, 1);
3260 path.lineTo(0, 3);
3261 path.close();
3262 path.moveTo(0, 0);
3263 path.lineTo(0, 0);
3264 path.quadTo(2, 1, 0, 2);
3265 path.close();
3266 testSimplify(reporter, path);
3267}
3268
3269static void testQuadratic83(skiatest::Reporter* reporter) {
3270 SkPath path;
3271 path.moveTo(0, 0);
3272 path.quadTo(0, 0, 2, 0);
3273 path.lineTo(2, 2);
3274 path.close();
3275 path.moveTo(0, 1);
3276 path.lineTo(0, 2);
3277 path.quadTo(2, 2, 1, 3);
3278 path.close();
3279 testSimplify(reporter, path);
3280}
3281
3282static void testQuadratic84(skiatest::Reporter* reporter) {
3283 SkPath path;
3284 path.moveTo(0, 0);
3285 path.quadTo(2, 0, 1, 1);
3286 path.lineTo(2, 1);
3287 path.close();
3288 path.moveTo(1, 0);
3289 path.lineTo(2, 0);
3290 path.quadTo(0, 1, 2, 2);
3291 path.close();
3292 testSimplify(reporter, path);
3293}
3294
3295static void testQuadratic85(skiatest::Reporter* reporter) {
3296 SkPath path;
3297 path.moveTo(0, 0);
3298 path.quadTo(3, 0, 1, 1);
3299 path.lineTo(1, 1);
3300 path.close();
3301 path.moveTo(1, 0);
3302 path.lineTo(3, 0);
3303 path.quadTo(0, 1, 1, 2);
3304 path.close();
3305 testSimplify(reporter, path);
3306}
3307
3308static void testQuadratic86(skiatest::Reporter* reporter) {
3309 SkPath path;
3310 path.moveTo(0, 0);
3311 path.quadTo(0, 1, 1, 1);
3312 path.lineTo(2, 3);
3313 path.close();
3314 path.moveTo(0, 0);
3315 path.lineTo(0, 0);
3316 path.quadTo(1, 1, 1, 3);
3317 path.close();
3318 testSimplify(reporter, path);
3319}
3320
3321static void testQuadratic87(skiatest::Reporter* reporter) {
3322 SkPath path;
3323 path.moveTo(0, 0);
3324 path.quadTo(2, 1, 0, 2);
3325 path.lineTo(2, 3);
3326 path.close();
3327 path.moveTo(0, 0);
3328 path.lineTo(1, 1);
3329 path.quadTo(0, 2, 3, 2);
3330 path.close();
3331 testSimplify(reporter, path);
3332}
3333
3334static void testQuadratic88(skiatest::Reporter* reporter) {
3335 SkPath path;
3336 path.moveTo(0, 0);
3337 path.quadTo(2, 1, 0, 2);
3338 path.lineTo(2, 2);
3339 path.close();
3340 path.moveTo(1, 0);
3341 path.lineTo(1, 1);
3342 path.quadTo(0, 2, 2, 2);
3343 path.close();
3344 testSimplify(reporter, path);
3345}
3346
3347static void testQuadratic89x(skiatest::Reporter* reporter) {
3348 SkPath path;
3349 path.setFillType(SkPath::kEvenOdd_FillType);
3350 path.moveTo(0, 0);
3351 path.quadTo(3, 1, 2, 2);
3352 path.lineTo(0, 3);
3353 path.close();
3354 path.moveTo(0, 0);
3355 path.lineTo(2, 1);
3356 path.quadTo(3, 1, 3, 3);
3357 path.close();
3358 testSimplify(reporter, path);
3359}
3360
3361static void testQuadratic90x(skiatest::Reporter* reporter) {
3362 SkPath path;
3363 path.setFillType(SkPath::kEvenOdd_FillType);
3364 path.moveTo(0, 0);
3365 path.quadTo(3, 0, 2, 2);
3366 path.lineTo(1, 3);
3367 path.close();
3368 path.moveTo(0, 0);
3369 path.lineTo(0, 1);
3370 path.quadTo(3, 2, 2, 3);
3371 path.close();
3372 testSimplify(reporter, path);
3373}
3374
3375static void testQuadratic91(skiatest::Reporter* reporter) {
3376 SkPath path;
3377 path.moveTo(0, 0);
3378 path.quadTo(3, 2, 2, 3);
3379 path.lineTo(2, 3);
3380 path.close();
3381 path.moveTo(0, 0);
3382 path.lineTo(1, 1);
3383 path.quadTo(2, 1, 2, 3);
3384 path.close();
3385 testSimplify(reporter, path);
3386}
3387
3388static void testQuadratic92x(skiatest::Reporter* reporter) {
3389 SkPath path;
3390 path.setFillType(SkPath::kEvenOdd_FillType);
3391 path.moveTo(1, 0);
3392 path.quadTo(3, 0, 2, 2);
3393 path.lineTo(2, 2);
3394 path.close();
3395 path.moveTo(2, 0);
3396 path.lineTo(0, 1);
3397 path.quadTo(3, 2, 2, 3);
3398 path.close();
3399 testSimplify(reporter, path);
3400}
3401
3402static void testLine82(skiatest::Reporter* reporter) {
3403 SkPath path;
3404 path.addRect(20, 0, 40, 40, SkPath::kCCW_Direction);
3405 path.addRect(24, 20, 36, 30, SkPath::kCCW_Direction);
3406 path.addRect(24, 32, 33, 36, SkPath::kCCW_Direction);
3407 testSimplify(reporter, path);
3408}
3409
3410static void testLine82a(skiatest::Reporter* reporter) {
3411 SkPath path;
3412 path.addRect(0, 0, 6, 10, SkPath::kCW_Direction);
3413 path.addRect(2, 2, 4, 4, SkPath::kCW_Direction);
3414 path.addRect(2, 6, 4, 8, SkPath::kCW_Direction);
3415 testSimplify(reporter, path);
3416}
3417
3418static void testLine82b(skiatest::Reporter* reporter) {
3419 SkPath path;
3420 path.addRect(0, 0, 6, 10, SkPath::kCW_Direction);
3421 path.addRect(2, 2, 4, 4, SkPath::kCW_Direction);
3422 path.addRect(2, 6, 4, 8, SkPath::kCCW_Direction);
3423 testSimplify(reporter, path);
3424}
3425
3426static void testLine82c(skiatest::Reporter* reporter) {
3427 SkPath path;
3428 path.addRect(0, 0, 6, 10, SkPath::kCW_Direction);
3429 path.addRect(2, 2, 4, 4, SkPath::kCCW_Direction);
3430 path.addRect(2, 6, 4, 8, SkPath::kCW_Direction);
3431 testSimplify(reporter, path);
3432}
3433
3434static void testLine82d(skiatest::Reporter* reporter) {
3435 SkPath path;
3436 path.addRect(0, 0, 6, 10, SkPath::kCW_Direction);
3437 path.addRect(2, 2, 4, 4, SkPath::kCCW_Direction);
3438 path.addRect(2, 6, 4, 8, SkPath::kCCW_Direction);
3439 testSimplify(reporter, path);
3440}
3441
3442static void testLine82e(skiatest::Reporter* reporter) {
3443 SkPath path;
3444 path.addRect(0, 0, 6, 10, SkPath::kCCW_Direction);
3445 path.addRect(2, 2, 4, 4, SkPath::kCW_Direction);
3446 path.addRect(2, 6, 4, 8, SkPath::kCW_Direction);
3447 testSimplify(reporter, path);
3448}
3449
3450static void testLine82f(skiatest::Reporter* reporter) {
3451 SkPath path;
3452 path.addRect(0, 0, 6, 10, SkPath::kCCW_Direction);
3453 path.addRect(2, 2, 4, 4, SkPath::kCW_Direction);
3454 path.addRect(2, 6, 4, 8, SkPath::kCCW_Direction);
3455 testSimplify(reporter, path);
3456}
3457
3458static void testLine82g(skiatest::Reporter* reporter) {
3459 SkPath path;
3460 path.addRect(0, 0, 6, 10, SkPath::kCCW_Direction);
3461 path.addRect(2, 2, 4, 4, SkPath::kCCW_Direction);
3462 path.addRect(2, 6, 4, 8, SkPath::kCW_Direction);
3463 testSimplify(reporter, path);
3464}
3465
3466static void testLine82h(skiatest::Reporter* reporter) {
3467 SkPath path;
3468 path.addRect(0, 0, 6, 10, SkPath::kCCW_Direction);
3469 path.addRect(2, 2, 4, 4, SkPath::kCCW_Direction);
3470 path.addRect(2, 6, 4, 8, SkPath::kCCW_Direction);
3471 testSimplify(reporter, path);
3472}
3473
3474static void testLine83(skiatest::Reporter* reporter) {
3475 SkPath path;
3476path.addRect(10, 30, 30, 40, SkPath::kCCW_Direction);
3477path.addRect(0, 12, 12, 18, SkPath::kCCW_Direction);
3478path.addRect(4, 13, 13, 16, SkPath::kCCW_Direction);
3479 testSimplify(reporter, path);
3480}
3481
3482static void testLine84(skiatest::Reporter* reporter) {
3483 SkPath path;
3484 path.addRect(0, 12, 60, 30, SkPath::kCCW_Direction);
3485 path.addRect(10, 20, 40, 30, SkPath::kCW_Direction);
3486 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
3487 path.addRect(4, 12, 13, 13, SkPath::kCW_Direction);
3488 testSimplify(reporter, path);
3489}
3490
3491static void testLine84x(skiatest::Reporter* reporter) {
3492 SkPath path;
3493 path.setFillType(SkPath::kEvenOdd_FillType);
3494 path.addRect(0, 12, 60, 30, SkPath::kCCW_Direction);
3495 path.addRect(10, 20, 40, 30, SkPath::kCCW_Direction);
3496 path.addRect(0, 12, 12, 12, SkPath::kCCW_Direction);
3497 path.addRect(4, 12, 13, 13, SkPath::kCCW_Direction);
3498 testSimplify(reporter, path);
3499}
3500
3501static void testLine85(skiatest::Reporter* reporter) {
3502 SkPath path;
3503 path.addRect(36, 0, 66, 60, SkPath::kCCW_Direction);
3504 path.addRect(20, 0, 40, 40, SkPath::kCCW_Direction);
3505 path.addRect(12, 0, 24, 24, SkPath::kCCW_Direction);
3506 path.addRect(32, 0, 36, 41, SkPath::kCCW_Direction);
3507 testSimplify(reporter, path);
3508}
3509
3510static void testQuadralateral1(skiatest::Reporter* reporter) {
3511 SkPath path;
3512 path.moveTo(0, 0);
3513 path.lineTo(0, 0);
3514 path.lineTo(0, 0);
3515 path.lineTo(3, 2);
3516 path.close();
3517 path.moveTo(0, 0);
3518 path.lineTo(2, 1);
3519 path.lineTo(2, 2);
3520 path.lineTo(2, 3);
3521 path.close();
3522 testSimplify(reporter, path);
3523}
3524
3525static void testCubic1(skiatest::Reporter* reporter) {
3526 SkPath path;
3527 path.moveTo(0, 0);
3528 path.cubicTo(0, 1, 1, 1, 1, 0);
3529 path.close();
3530 path.moveTo(1, 0);
3531 path.cubicTo(0, 0, 0, 1, 1, 1);
3532 path.close();
3533 testSimplify(reporter, path);
3534}
3535
3536static void testQuadratic93(skiatest::Reporter* reporter) {
3537 SkPath path;
3538 path.moveTo(3, 0);
3539 path.quadTo(0, 1, 3, 2);
3540 path.lineTo(0, 3);
3541 path.close();
3542 path.moveTo(1, 0);
3543 path.lineTo(2, 0);
3544 path.quadTo(1, 1, 2, 2);
3545 path.close();
3546 testSimplify(reporter, path);
3547}
3548
3549static void testCubic2(skiatest::Reporter* reporter) {
3550 SkPath path;
3551 path.moveTo(0,2);
3552 path.cubicTo(0,3, 2,1, 4,0);
3553 path.close();
3554 path.moveTo(1,2);
3555 path.cubicTo(0,4, 2,0, 3,0);
3556 path.close();
3557 testSimplify(reporter, path);
3558}
3559
3560#if 01 // FIXME: enable and fix
3561static void testQuad1(skiatest::Reporter* reporter) {
3562 SkPath path;
3563 path.moveTo(0,0);
3564 path.quadTo(0,0, 0,1);
3565 path.lineTo(1,1);
3566 path.close();
3567 path.moveTo(0,0);
3568 path.quadTo(1,1, 0,2);
3569 path.close();
3570 testSimplify(reporter, path);
3571}
3572#endif
3573
caryclark@google.come942bc32013-04-10 18:53:01 +00003574static void testQuadralateral2(skiatest::Reporter* reporter) {
3575 SkPath path;
3576 path.moveTo(0, 0);
3577 path.lineTo(2, 2);
3578 path.lineTo(0, 3);
3579 path.lineTo(3, 3);
3580 path.close();
3581 path.moveTo(2, 0);
3582 path.lineTo(3, 0);
3583 path.lineTo(0, 1);
3584 path.lineTo(1, 2);
3585 path.close();
3586 testSimplify(reporter, path);
3587}
3588
caryclark@google.comad65a3e2013-04-15 19:13:59 +00003589static void testQuadratic94(skiatest::Reporter* reporter) {
3590 SkPath path;
3591 path.moveTo(0, 0);
3592 path.lineTo(8, 8);
3593 path.quadTo(8, 4, 4, 4);
3594 path.quadTo(4, 0, 0, 0);
3595 path.close();
3596 testSimplify(reporter, path);
3597}
3598
3599static void testQuadratic95(skiatest::Reporter* reporter) {
3600 SkPath path;
3601 path.moveTo(8, 8);
3602 path.lineTo(0, 0);
3603 path.quadTo(4, 0, 4, 4);
3604 path.quadTo(8, 4, 8, 8);
3605 path.close();
3606 testSimplify(reporter, path);
3607}
3608
3609static void testQuadratic96(skiatest::Reporter* reporter) {
3610 SkPath path;
3611 path.moveTo(8, 0);
3612 path.lineTo(0, 8);
3613 path.quadTo(0, 4, 4, 4);
3614 path.quadTo(4, 0, 8, 0);
3615 path.close();
3616 testSimplify(reporter, path);
3617}
3618
3619static void testQuadratic97(skiatest::Reporter* reporter) {
3620 SkPath path;
3621 path.moveTo(0, 8);
3622 path.lineTo(8, 0);
3623 path.quadTo(4, 0, 4, 4);
3624 path.quadTo(0, 4, 0, 8);
3625 path.close();
3626 testSimplify(reporter, path);
3627}
3628
caryclark@google.com03610322013-04-18 15:58:21 +00003629static void testTriangles1(skiatest::Reporter* reporter) {
3630 SkPath path;
3631 path.moveTo(0, 0);
3632 path.lineTo(1, 0);
3633 path.lineTo(3, 3);
3634 path.close();
3635 path.moveTo(0, 0);
3636 path.lineTo(1, 2);
3637 path.lineTo(1, 1);
3638 path.close();
3639 testSimplify(reporter, path);
3640}
3641
3642static void testTriangles2(skiatest::Reporter* reporter) {
3643 SkPath path;
3644 path.moveTo(0, 0);
3645 path.lineTo(1, 0);
3646 path.lineTo(3, 3);
3647 path.close();
3648 path.moveTo(1, 1);
3649 path.lineTo(2, 3);
3650 path.lineTo(1, 2);
3651 path.close();
3652 testSimplify(reporter, path);
3653}
3654
caryclark@google.com818b0cc2013-04-08 11:50:46 +00003655static void (*firstTest)(skiatest::Reporter* ) = 0;
3656
3657static TestDesc tests[] = {
caryclark@google.com03610322013-04-18 15:58:21 +00003658 TEST(testTriangles2),
3659 TEST(testTriangles1),
caryclark@google.comad65a3e2013-04-15 19:13:59 +00003660 TEST(testQuadratic97),
3661 TEST(testQuadratic96),
3662 TEST(testQuadratic95),
3663 TEST(testQuadratic94),
caryclark@google.come942bc32013-04-10 18:53:01 +00003664 TEST(testQuadralateral2),
caryclark@google.com818b0cc2013-04-08 11:50:46 +00003665 TEST(testQuad1), // FIXME: fails, need to investigate
3666 TEST(testCubic2),
3667 TEST(testCubic1),
3668 TEST(testQuadralateral1),
3669 TEST(testLine85),
3670 TEST(testLine84),
3671 TEST(testLine84x),
3672 TEST(testLine83),
3673 TEST(testLine82h),
3674 TEST(testLine82g),
3675 TEST(testLine82f),
3676 TEST(testLine82e),
3677 TEST(testLine82d),
3678 TEST(testLine82c),
3679 TEST(testLine82b),
3680 TEST(testLine82a),
3681 TEST(testLine82),
3682 TEST(testQuadratic93),
3683 TEST(testQuadratic92x),
3684 TEST(testQuadratic91),
3685 TEST(testQuadratic90x),
3686 TEST(testQuadratic89x),
3687 TEST(testQuadratic88),
3688 TEST(testQuadratic87),
3689 TEST(testQuadratic86),
3690 TEST(testQuadratic85),
3691 TEST(testQuadratic84),
3692 TEST(testQuadratic83),
3693 TEST(testQuadratic82),
3694 TEST(testQuadratic81),
3695 TEST(testQuadratic80),
3696 TEST(testEight1),
3697 TEST(testEight2),
3698 TEST(testEight3),
3699 TEST(testEight4),
3700 TEST(testEight5),
3701 TEST(testEight6),
3702 TEST(testEight7),
3703 TEST(testEight8),
3704 TEST(testEight9),
3705 TEST(testEight10),
3706 TEST(testQuadratic79),
3707 TEST(testQuadratic78),
3708 TEST(testQuadratic77),
3709 TEST(testQuadratic76),
3710 TEST(testQuadratic75),
3711 TEST(testQuadratic74),
3712 TEST(testQuadratic73),
3713 TEST(testQuadratic72),
3714 TEST(testQuadratic71),
3715 TEST(testQuadratic70x),
3716 TEST(testQuadratic69),
3717 TEST(testQuadratic68),
3718 TEST(testQuadratic67x),
3719 TEST(testQuadratic65),
3720 TEST(testQuadratic64),
3721 TEST(testQuadratic63),
3722 TEST(testLine1a),
3723 TEST(testLine1ax),
3724 TEST(testQuadratic59),
3725 TEST(testQuadratic59x),
3726 TEST(testQuadratic58),
3727 TEST(testQuadratic56),
3728 TEST(testQuadratic55),
3729 TEST(testQuadratic53),
3730 TEST(testQuadratic51),
3731 TEST(testQuadratic38),
3732 TEST(testQuadratic37),
3733 TEST(testQuadratic36),
3734 TEST(testQuadratic35),
3735 TEST(testQuadratic34),
3736 TEST(testQuadratic33),
3737 TEST(testQuadratic32),
3738 TEST(testQuadratic31),
3739 TEST(testQuadratic30),
3740 TEST(testQuadratic29),
3741 TEST(testQuadratic28),
3742 TEST(testQuadratic27),
3743 TEST(testQuadratic26),
3744 TEST(testQuadratic25),
3745 TEST(testQuadratic24),
3746 TEST(testQuadratic23),
3747 TEST(testQuadratic22),
3748 TEST(testQuadratic21),
3749 TEST(testQuadratic20),
3750 TEST(testQuadratic19),
3751 TEST(testQuadratic18),
3752 TEST(testQuadratic17x),
3753 TEST(testQuadratic15),
3754 TEST(testQuadratic14),
3755 TEST(testQuadratic9),
3756 TEST(testQuadratic8),
3757 TEST(testQuadratic7),
3758 TEST(testQuadratic6),
3759 TEST(testQuadratic5),
3760 TEST(testQuadratic4x),
3761 TEST(testQuadratic3x),
3762 TEST(testQuadratic2x),
3763 TEST(testQuadratic1x),
3764 TEST(testQuadratic4),
3765 TEST(testQuadratic3),
3766 TEST(testQuadratic2),
3767 TEST(testQuadratic1),
3768 TEST(testLine4ax),
3769 TEST(testLine3aax),
3770 TEST(testLine2ax),
3771 TEST(testLine1ax),
3772 TEST(testQuadralateral9x),
3773 TEST(testQuadralateral8x),
3774 TEST(testQuadralateral7x),
3775 TEST(testQuadralateral6x),
3776 TEST(testQuadralateral6ax),
3777 TEST(testQuadralateral9),
3778 TEST(testQuadralateral8),
3779 TEST(testQuadralateral7),
3780 TEST(testQuadralateral6),
3781 TEST(testQuadralateral6a),
3782 TEST(testFauxQuadralateral6dx),
3783 TEST(testFauxQuadralateral6cx),
3784 TEST(testFauxQuadralateral6bx),
3785 TEST(testFauxQuadralateral6ax),
3786 TEST(testFauxQuadralateral6x),
3787 TEST(testFauxQuadralateral6d),
3788 TEST(testFauxQuadralateral6c),
3789 TEST(testFauxQuadralateral6b),
3790 TEST(testFauxQuadralateral6a),
3791 TEST(testFauxQuadralateral6),
3792 TEST(testQuadralateral5x),
3793 TEST(testQuadralateral5),
3794 TEST(testNondegenerate4x),
3795 TEST(testNondegenerate3x),
3796 TEST(testNondegenerate2x),
3797 TEST(testNondegenerate1x),
3798 TEST(testNondegenerate4),
3799 TEST(testNondegenerate3),
3800 TEST(testNondegenerate2),
3801 TEST(testNondegenerate1),
3802 TEST(testDegenerate4x),
3803 TEST(testDegenerate3x),
3804 TEST(testDegenerate2x),
3805 TEST(testDegenerate1x),
3806 TEST(testDegenerate4),
3807 TEST(testDegenerate3),
3808 TEST(testDegenerate2),
3809 TEST(testDegenerate1),
3810 TEST(testLine79x),
3811 TEST(testLine78x),
3812 TEST(testLine77x),
3813 TEST(testLine76x),
3814 TEST(testLine75x),
3815 TEST(testLine74x),
3816 TEST(testLine73x),
3817 TEST(testLine72x),
3818 TEST(testLine71x),
3819 TEST(testLine70x),
3820 TEST(testLine69x),
3821 TEST(testLine68hx),
3822 TEST(testLine68gx),
3823 TEST(testLine68fx),
3824 TEST(testLine68ex),
3825 TEST(testLine68dx),
3826 TEST(testLine68cx),
3827 TEST(testLine68bx),
3828 TEST(testLine68ax),
3829 TEST(testLine67x),
3830 TEST(testLine66x),
3831 TEST(testLine65x),
3832 TEST(testLine64x),
3833 TEST(testLine63x),
3834 TEST(testLine62x),
3835 TEST(testLine61x),
3836 TEST(testLine60x),
3837 TEST(testLine59x),
3838 TEST(testLine58x),
3839 TEST(testLine57x),
3840 TEST(testLine56x),
3841 TEST(testLine55x),
3842 TEST(testLine54x),
3843 TEST(testLine53x),
3844 TEST(testLine52x),
3845 TEST(testLine51x),
3846 TEST(testLine50x),
3847 TEST(testLine49x),
3848 TEST(testLine48x),
3849 TEST(testLine47x),
3850 TEST(testLine46x),
3851 TEST(testLine45x),
3852 TEST(testLine44x),
3853 TEST(testLine43x),
3854 TEST(testLine42x),
3855 TEST(testLine41x),
3856 TEST(testLine40x),
3857 TEST(testLine38x),
3858 TEST(testLine37x),
3859 TEST(testLine36x),
3860 TEST(testLine35x),
3861 TEST(testLine34x),
3862 TEST(testLine33x),
3863 TEST(testLine32x),
3864 TEST(testLine31x),
3865 TEST(testLine30x),
3866 TEST(testLine29x),
3867 TEST(testLine28x),
3868 TEST(testLine27x),
3869 TEST(testLine26x),
3870 TEST(testLine25x),
3871 TEST(testLine24ax),
3872 TEST(testLine24x),
3873 TEST(testLine23x),
3874 TEST(testLine22x),
3875 TEST(testLine21x),
3876 TEST(testLine20x),
3877 TEST(testLine19x),
3878 TEST(testLine18x),
3879 TEST(testLine17x),
3880 TEST(testLine16x),
3881 TEST(testLine15x),
3882 TEST(testLine14x),
3883 TEST(testLine13x),
3884 TEST(testLine12x),
3885 TEST(testLine11x),
3886 TEST(testLine10ax),
3887 TEST(testLine10x),
3888 TEST(testLine9x),
3889 TEST(testLine8x),
3890 TEST(testLine7bx),
3891 TEST(testLine7ax),
3892 TEST(testLine7x),
3893 TEST(testLine6x),
3894 TEST(testLine5x),
3895 TEST(testLine4x),
3896 TEST(testLine3bx),
3897 TEST(testLine3ax),
3898 TEST(testLine3x),
3899 TEST(testLine2x),
3900 TEST(testLine1x),
3901 TEST(testLine81),
3902 TEST(testLine80),
3903 TEST(testLine79),
3904 TEST(testLine78),
3905 TEST(testLine77),
3906 TEST(testLine76),
3907 TEST(testLine75),
3908 TEST(testLine74),
3909 TEST(testLine73),
3910 TEST(testLine72),
3911 TEST(testLine71),
3912 TEST(testLine70),
3913 TEST(testLine69),
3914 TEST(testLine68h),
3915 TEST(testLine68g),
3916 TEST(testLine68f),
3917 TEST(testLine68e),
3918 TEST(testLine68d),
3919 TEST(testLine68c),
3920 TEST(testLine68b),
3921 TEST(testLine68a),
3922 TEST(testLine67),
3923 TEST(testLine66),
3924 TEST(testLine65),
3925 TEST(testLine64),
3926 TEST(testLine63),
3927 TEST(testLine62),
3928 TEST(testLine61),
3929 TEST(testLine60),
3930 TEST(testLine59),
3931 TEST(testLine58),
3932 TEST(testLine57),
3933 TEST(testLine56),
3934 TEST(testLine55),
3935 TEST(testLine54),
3936 TEST(testLine53),
3937 TEST(testLine52),
3938 TEST(testLine51),
3939 TEST(testLine50),
3940 TEST(testLine49),
3941 TEST(testLine48),
3942 TEST(testLine47),
3943 TEST(testLine46),
3944 TEST(testLine45),
3945 TEST(testLine44),
3946 TEST(testLine43),
3947 TEST(testLine42),
3948 TEST(testLine41),
3949 TEST(testLine40),
3950 TEST(testLine38),
3951 TEST(testLine37),
3952 TEST(testLine36),
3953 TEST(testLine35),
3954 TEST(testLine34),
3955 TEST(testLine33),
3956 TEST(testLine32),
3957 TEST(testLine31),
3958 TEST(testLine30),
3959 TEST(testLine29),
3960 TEST(testLine28),
3961 TEST(testLine27),
3962 TEST(testLine26),
3963 TEST(testLine25),
3964 TEST(testLine24a),
3965 TEST(testLine24),
3966 TEST(testLine23),
3967 TEST(testLine22),
3968 TEST(testLine21),
3969 TEST(testLine20),
3970 TEST(testLine19),
3971 TEST(testLine18),
3972 TEST(testLine17),
3973 TEST(testLine16),
3974 TEST(testLine15),
3975 TEST(testLine14),
3976 TEST(testLine13),
3977 TEST(testLine12),
3978 TEST(testLine11),
3979 TEST(testLine10a),
3980 TEST(testLine10),
3981 TEST(testLine9),
3982 TEST(testLine8),
3983 TEST(testLine7b),
3984 TEST(testLine7a),
3985 TEST(testLine7),
3986 TEST(testLine6),
3987 TEST(testLine5),
3988 TEST(testLine4),
3989 TEST(testLine3b),
3990 TEST(testLine3a),
3991 TEST(testLine3),
3992 TEST(testLine2),
3993 TEST(testLine1),
3994};
3995
caryclark@google.comad65a3e2013-04-15 19:13:59 +00003996static const size_t testCount = SK_ARRAY_COUNT(tests);
caryclark@google.com818b0cc2013-04-08 11:50:46 +00003997
3998static TestDesc subTests[] = {
3999 TEST(testLine3),
4000 TEST(testLine2),
4001 TEST(testLine1),
4002};
4003
caryclark@google.comad65a3e2013-04-15 19:13:59 +00004004static const size_t subTestCount = SK_ARRAY_COUNT(subTests);
caryclark@google.com818b0cc2013-04-08 11:50:46 +00004005
4006static void (*firstSubTest)(skiatest::Reporter* ) = 0;
4007
4008static bool runSubTestsFirst = false;
4009static bool runReverse = false;
4010static void (*stopTest)(skiatest::Reporter* ) = 0;
4011
caryclark@google.comad65a3e2013-04-15 19:13:59 +00004012static void PathOpsSimplifyTest(skiatest::Reporter* reporter) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +00004013#ifdef SK_DEBUG
4014 gDebugMaxWindSum = 4;
4015 gDebugMaxWindValue = 4;
4016#endif
4017 if (runSubTestsFirst) {
4018 RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, runReverse);
4019 }
4020 RunTestSet(reporter, tests, testCount, firstTest, stopTest, runReverse);
4021 if (!runSubTestsFirst) {
4022 RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, runReverse);
4023 }
4024#ifdef SK_DEBUG
4025 gDebugMaxWindSum = SK_MaxS32;
4026 gDebugMaxWindValue = SK_MaxS32;
4027#endif
4028}
4029
4030#include "TestClassDef.h"
caryclark@google.comad65a3e2013-04-15 19:13:59 +00004031DEFINE_TESTCLASS_SHORT(PathOpsSimplifyTest)