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