blob: da381353fef7ec0d105350bfc763a96d278866e1 [file] [log] [blame]
caryclark@google.comaf46cff2012-05-22 21:12:00 +00001/*
2 * Copyright 2012 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
caryclark@google.comaf46cff2012-05-22 21:12:00 +00008#include "EdgeWalker_Test.h"
9#include "Intersection_Tests.h"
caryclark@google.com8dcf1142012-07-02 20:27:02 +000010#include "ShapeOps.h"
caryclark@google.comaf46cff2012-05-22 21:12:00 +000011
caryclark@google.com47580692012-07-23 12:14:49 +000012#define TEST(name) { name, #name }
13
caryclark@google.comaf46cff2012-05-22 21:12:00 +000014static void testLine1() {
caryclark@google.com59823f72012-08-09 18:17:47 +000015 SkPath path;
caryclark@google.comaf46cff2012-05-22 21:12:00 +000016 path.moveTo(2,0);
17 path.lineTo(1,1);
18 path.lineTo(0,0);
19 path.close();
caryclark@google.com88f7d0c2012-06-07 21:09:20 +000020 testSimplifyx(path);
caryclark@google.comaf46cff2012-05-22 21:12:00 +000021}
22
caryclark@google.comc899ad92012-08-23 15:24:42 +000023static void testLine1x() {
24 SkPath path;
25 path.setFillType(SkPath::kEvenOdd_FillType);
26 path.moveTo(2,0);
27 path.lineTo(1,1);
28 path.lineTo(0,0);
29 path.close();
30 testSimplifyx(path);
31}
32
caryclark@google.comaf46cff2012-05-22 21:12:00 +000033static void addInnerCWTriangle(SkPath& path) {
34 path.moveTo(3,0);
35 path.lineTo(4,1);
36 path.lineTo(2,1);
37 path.close();
38}
39
40static void addInnerCCWTriangle(SkPath& path) {
41 path.moveTo(3,0);
42 path.lineTo(2,1);
43 path.lineTo(4,1);
44 path.close();
45}
46
47static void addOuterCWTriangle(SkPath& path) {
48 path.moveTo(3,0);
49 path.lineTo(6,2);
50 path.lineTo(0,2);
51 path.close();
52}
53
54static void addOuterCCWTriangle(SkPath& path) {
55 path.moveTo(3,0);
56 path.lineTo(0,2);
57 path.lineTo(6,2);
58 path.close();
59}
60
61static void testLine2() {
caryclark@google.com59823f72012-08-09 18:17:47 +000062 SkPath path;
caryclark@google.comc899ad92012-08-23 15:24:42 +000063 path.setFillType(SkPath::kEvenOdd_FillType);
64 addInnerCWTriangle(path);
65 addOuterCWTriangle(path);
66 testSimplifyx(path);
67}
68
69static void testLine2x() {
70 SkPath path;
71 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.comaf46cff2012-05-22 21:12:00 +000072 addInnerCWTriangle(path);
73 addOuterCWTriangle(path);
caryclark@google.com88f7d0c2012-06-07 21:09:20 +000074 testSimplifyx(path);
caryclark@google.comaf46cff2012-05-22 21:12:00 +000075}
76
caryclark@google.com495f8e42012-05-31 13:13:11 +000077static void testLine3() {
caryclark@google.com59823f72012-08-09 18:17:47 +000078 SkPath path;
caryclark@google.comc899ad92012-08-23 15:24:42 +000079 path.setFillType(SkPath::kEvenOdd_FillType);
80 addInnerCCWTriangle(path);
81 addOuterCWTriangle(path);
82 testSimplifyx(path);
83}
84
85static void testLine3x() {
86 SkPath path;
87 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com495f8e42012-05-31 13:13:11 +000088 addInnerCCWTriangle(path);
89 addOuterCWTriangle(path);
caryclark@google.com88f7d0c2012-06-07 21:09:20 +000090 testSimplifyx(path);
caryclark@google.com495f8e42012-05-31 13:13:11 +000091}
92
caryclark@google.com534aa5b2012-08-02 20:08:21 +000093static void testLine3a() {
caryclark@google.com59823f72012-08-09 18:17:47 +000094 SkPath path;
caryclark@google.com534aa5b2012-08-02 20:08:21 +000095 addInnerCWTriangle(path);
96 addOuterCCWTriangle(path);
97 testSimplifyx(path);
98}
99
caryclark@google.comc899ad92012-08-23 15:24:42 +0000100static void testLine3ax() {
101 SkPath path;
102 path.setFillType(SkPath::kEvenOdd_FillType);
103 addInnerCWTriangle(path);
104 addOuterCCWTriangle(path);
105 testSimplifyx(path);
106}
107
caryclark@google.com534aa5b2012-08-02 20:08:21 +0000108static void testLine3b() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000109 SkPath path;
caryclark@google.com534aa5b2012-08-02 20:08:21 +0000110 addInnerCCWTriangle(path);
111 addOuterCCWTriangle(path);
112 testSimplifyx(path);
113}
114
caryclark@google.comc899ad92012-08-23 15:24:42 +0000115static void testLine3bx() {
116 SkPath path;
117 path.setFillType(SkPath::kEvenOdd_FillType);
118 addInnerCCWTriangle(path);
119 addOuterCCWTriangle(path);
120 testSimplifyx(path);
121}
122
caryclark@google.com495f8e42012-05-31 13:13:11 +0000123static void testLine4() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000124 SkPath path;
caryclark@google.com495f8e42012-05-31 13:13:11 +0000125 addOuterCCWTriangle(path);
126 addOuterCWTriangle(path);
caryclark@google.com88f7d0c2012-06-07 21:09:20 +0000127 testSimplifyx(path);
caryclark@google.com495f8e42012-05-31 13:13:11 +0000128}
129
caryclark@google.comc899ad92012-08-23 15:24:42 +0000130static void testLine4x() {
131 SkPath path;
132 path.setFillType(SkPath::kEvenOdd_FillType);
133 addOuterCCWTriangle(path);
134 addOuterCWTriangle(path);
135 testSimplifyx(path);
136}
137
caryclark@google.com495f8e42012-05-31 13:13:11 +0000138static void testLine5() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000139 SkPath path;
caryclark@google.com495f8e42012-05-31 13:13:11 +0000140 addOuterCWTriangle(path);
141 addOuterCWTriangle(path);
caryclark@google.com88f7d0c2012-06-07 21:09:20 +0000142 testSimplifyx(path);
caryclark@google.com495f8e42012-05-31 13:13:11 +0000143}
caryclark@google.comaf46cff2012-05-22 21:12:00 +0000144
caryclark@google.comc899ad92012-08-23 15:24:42 +0000145static void testLine5x() {
146 SkPath path;
147 path.setFillType(SkPath::kEvenOdd_FillType);
148 addOuterCWTriangle(path);
149 addOuterCWTriangle(path);
150 testSimplifyx(path);
151}
152
caryclark@google.com88f7d0c2012-06-07 21:09:20 +0000153static void testLine6() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000154 SkPath path;
caryclark@google.com88f7d0c2012-06-07 21:09:20 +0000155 path.moveTo(0,0);
156 path.lineTo(4,0);
157 path.lineTo(2,2);
158 path.close();
159 path.moveTo(2,0);
160 path.lineTo(6,0);
161 path.lineTo(4,2);
162 path.close();
163 testSimplifyx(path);
164}
165
caryclark@google.comc899ad92012-08-23 15:24:42 +0000166static void testLine6x() {
167 SkPath path;
168 path.setFillType(SkPath::kEvenOdd_FillType);
169 path.moveTo(0,0);
170 path.lineTo(4,0);
171 path.lineTo(2,2);
172 path.close();
173 path.moveTo(2,0);
174 path.lineTo(6,0);
175 path.lineTo(4,2);
176 path.close();
177 testSimplifyx(path);
178}
179
caryclark@google.com88f7d0c2012-06-07 21:09:20 +0000180static void testLine7() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000181 SkPath path;
caryclark@google.com88f7d0c2012-06-07 21:09:20 +0000182 path.moveTo(0,0);
183 path.lineTo(4,0);
184 path.lineTo(2,2);
185 path.close();
186 path.moveTo(6,0);
187 path.lineTo(2,0);
188 path.lineTo(4,2);
189 path.close();
190 testSimplifyx(path);
191}
192
caryclark@google.comc899ad92012-08-23 15:24:42 +0000193static void testLine7x() {
194 SkPath path;
195 path.setFillType(SkPath::kEvenOdd_FillType);
196 path.moveTo(0,0);
197 path.lineTo(4,0);
198 path.lineTo(2,2);
199 path.close();
200 path.moveTo(6,0);
201 path.lineTo(2,0);
202 path.lineTo(4,2);
203 path.close();
204 testSimplifyx(path);
205}
206
caryclark@google.comfa4a6e92012-07-11 17:52:32 +0000207static void testLine7a() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000208 SkPath path;
caryclark@google.comfa4a6e92012-07-11 17:52:32 +0000209 path.moveTo(0,0);
210 path.lineTo(4,0);
211 path.lineTo(2,2);
212 path.close();
213 testSimplifyx(path);
214}
215
caryclark@google.comc899ad92012-08-23 15:24:42 +0000216static void testLine7ax() {
217 SkPath path;
218 path.setFillType(SkPath::kEvenOdd_FillType);
219 path.moveTo(0,0);
220 path.lineTo(4,0);
221 path.lineTo(2,2);
222 path.close();
223 testSimplifyx(path);
224}
225
caryclark@google.comfa4a6e92012-07-11 17:52:32 +0000226static void testLine7b() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000227 SkPath path;
caryclark@google.comfa4a6e92012-07-11 17:52:32 +0000228 path.moveTo(0,0);
229 path.lineTo(4,0);
230 path.close();
231 path.moveTo(6,0);
232 path.lineTo(2,0);
233 path.lineTo(4,2);
234 path.close();
235 testSimplifyx(path);
236}
237
caryclark@google.comc899ad92012-08-23 15:24:42 +0000238static void testLine7bx() {
239 SkPath path;
240 path.setFillType(SkPath::kEvenOdd_FillType);
241 path.moveTo(0,0);
242 path.lineTo(4,0);
243 path.close();
244 path.moveTo(6,0);
245 path.lineTo(2,0);
246 path.lineTo(4,2);
247 path.close();
248 testSimplifyx(path);
249}
250
caryclark@google.com88f7d0c2012-06-07 21:09:20 +0000251static void testLine8() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000252 SkPath path;
caryclark@google.com88f7d0c2012-06-07 21:09:20 +0000253 path.moveTo(0,4);
254 path.lineTo(4,4);
255 path.lineTo(2,2);
256 path.close();
257 path.moveTo(2,4);
258 path.lineTo(6,4);
259 path.lineTo(4,2);
260 path.close();
261 testSimplifyx(path);
262}
263
caryclark@google.comc899ad92012-08-23 15:24:42 +0000264static void testLine8x() {
265 SkPath path;
266 path.setFillType(SkPath::kEvenOdd_FillType);
267 path.moveTo(0,4);
268 path.lineTo(4,4);
269 path.lineTo(2,2);
270 path.close();
271 path.moveTo(2,4);
272 path.lineTo(6,4);
273 path.lineTo(4,2);
274 path.close();
275 testSimplifyx(path);
276}
277
caryclark@google.com88f7d0c2012-06-07 21:09:20 +0000278static void testLine9() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000279 SkPath path;
caryclark@google.com88f7d0c2012-06-07 21:09:20 +0000280 path.moveTo(0,4);
281 path.lineTo(4,4);
282 path.lineTo(2,2);
283 path.close();
284 path.moveTo(6,4);
285 path.lineTo(2,4);
286 path.lineTo(4,2);
287 path.close();
288 testSimplifyx(path);
289}
290
caryclark@google.comc899ad92012-08-23 15:24:42 +0000291static void testLine9x() {
292 SkPath path;
293 path.setFillType(SkPath::kEvenOdd_FillType);
294 path.moveTo(0,4);
295 path.lineTo(4,4);
296 path.lineTo(2,2);
297 path.close();
298 path.moveTo(6,4);
299 path.lineTo(2,4);
300 path.lineTo(4,2);
301 path.close();
302 testSimplifyx(path);
303}
304
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000305static void testLine10() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000306 SkPath path;
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000307 path.moveTo(0,4);
308 path.lineTo(4,4);
309 path.lineTo(2,2);
310 path.close();
311 path.moveTo(2,1);
312 path.lineTo(3,4);
313 path.lineTo(6,1);
314 path.close();
315 testSimplifyx(path);
316}
caryclark@google.com88f7d0c2012-06-07 21:09:20 +0000317
caryclark@google.comc899ad92012-08-23 15:24:42 +0000318static void testLine10x() {
319 SkPath path;
320 path.setFillType(SkPath::kEvenOdd_FillType);
321 path.moveTo(0,4);
322 path.lineTo(4,4);
323 path.lineTo(2,2);
324 path.close();
325 path.moveTo(2,1);
326 path.lineTo(3,4);
327 path.lineTo(6,1);
328 path.close();
329 testSimplifyx(path);
330}
331
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000332static void testLine10a() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000333 SkPath path;
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000334 path.moveTo(0,4);
335 path.lineTo(8,4);
336 path.lineTo(4,0);
337 path.close();
338 path.moveTo(2,2);
339 path.lineTo(3,3);
340 path.lineTo(4,2);
341 path.close();
342 testSimplifyx(path);
343}
344
caryclark@google.comc899ad92012-08-23 15:24:42 +0000345static void testLine10ax() {
346 SkPath path;
347 path.setFillType(SkPath::kEvenOdd_FillType);
348 path.moveTo(0,4);
349 path.lineTo(8,4);
350 path.lineTo(4,0);
351 path.close();
352 path.moveTo(2,2);
353 path.lineTo(3,3);
354 path.lineTo(4,2);
355 path.close();
356 testSimplifyx(path);
357}
358
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000359static void addCWContainer(SkPath& path) {
360 path.moveTo(6,4);
361 path.lineTo(0,4);
362 path.lineTo(3,1);
363 path.close();
364}
365
366static void addCCWContainer(SkPath& path) {
367 path.moveTo(0,4);
368 path.lineTo(6,4);
369 path.lineTo(3,1);
370 path.close();
371}
372
373static void addCWContents(SkPath& path) {
374 path.moveTo(2,3);
375 path.lineTo(3,2);
376 path.lineTo(4,3);
377 path.close();
378}
379
380static void addCCWContents(SkPath& path) {
381 path.moveTo(3,2);
382 path.lineTo(2,3);
383 path.lineTo(4,3);
384 path.close();
385}
386
387static void testLine11() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000388 SkPath path;
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000389 addCWContainer(path);
390 addCWContents(path);
391 testSimplifyx(path);
392}
393
caryclark@google.comc899ad92012-08-23 15:24:42 +0000394static void testLine11x() {
395 SkPath path;
396 path.setFillType(SkPath::kEvenOdd_FillType);
397 addCWContainer(path);
398 addCWContents(path);
399 testSimplifyx(path);
400}
401
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000402static void testLine12() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000403 SkPath path;
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000404 addCCWContainer(path);
405 addCWContents(path);
406 testSimplifyx(path);
407}
408
caryclark@google.comc899ad92012-08-23 15:24:42 +0000409static void testLine12x() {
410 SkPath path;
411 path.setFillType(SkPath::kEvenOdd_FillType);
412 addCCWContainer(path);
413 addCWContents(path);
414 testSimplifyx(path);
415}
416
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000417static void testLine13() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000418 SkPath path;
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000419 addCWContainer(path);
420 addCCWContents(path);
421 testSimplifyx(path);
422}
423
caryclark@google.comc899ad92012-08-23 15:24:42 +0000424static void testLine13x() {
425 SkPath path;
426 path.setFillType(SkPath::kEvenOdd_FillType);
427 addCWContainer(path);
428 addCCWContents(path);
429 testSimplifyx(path);
430}
431
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000432static void testLine14() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000433 SkPath path;
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000434 addCCWContainer(path);
435 addCCWContents(path);
436 testSimplifyx(path);
437}
438
caryclark@google.comc899ad92012-08-23 15:24:42 +0000439static void testLine14x() {
440 SkPath path;
441 path.setFillType(SkPath::kEvenOdd_FillType);
442 addCCWContainer(path);
443 addCCWContents(path);
444 testSimplifyx(path);
445}
446
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000447static void testLine15() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000448 SkPath path;
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000449 path.addRect(0, 0, 9, 9, (SkPath::Direction) 0);
450 testSimplifyx(path);
451}
452
caryclark@google.comc899ad92012-08-23 15:24:42 +0000453static void testLine15x() {
454 SkPath path;
455 path.setFillType(SkPath::kEvenOdd_FillType);
456 path.addRect(0, 0, 9, 9, (SkPath::Direction) 0);
457 testSimplifyx(path);
458}
459
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000460static void testLine16() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000461 SkPath path;
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000462 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
463 path.addRect(0, 4, 9, 9, (SkPath::Direction) 0);
464 testSimplifyx(path);
465}
466
caryclark@google.comc899ad92012-08-23 15:24:42 +0000467static void testLine16x() {
468 SkPath path;
469 path.setFillType(SkPath::kEvenOdd_FillType);
470 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
471 path.addRect(0, 4, 9, 9, (SkPath::Direction) 0);
472 testSimplifyx(path);
473}
474
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000475static void testLine17() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000476 SkPath path;
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000477 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
478 path.addRect(4, 12, 13, 13, (SkPath::Direction) 0);
479 testSimplifyx(path);
480}
481
caryclark@google.comc899ad92012-08-23 15:24:42 +0000482static void testLine17x() {
483 SkPath path;
484 path.setFillType(SkPath::kEvenOdd_FillType);
485 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
486 path.addRect(4, 12, 13, 13, (SkPath::Direction) 0);
487 testSimplifyx(path);
488}
489
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000490static void testLine18() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000491 SkPath path;
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000492 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
493 path.addRect(12, 4, 21, 21, (SkPath::Direction) 0);
494 testSimplifyx(path);
495}
496
caryclark@google.comc899ad92012-08-23 15:24:42 +0000497static void testLine18x() {
498 SkPath path;
499 path.setFillType(SkPath::kEvenOdd_FillType);
500 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
501 path.addRect(12, 4, 21, 21, (SkPath::Direction) 0);
502 testSimplifyx(path);
503}
504
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000505static void testLine19() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000506 SkPath path;
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000507 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
rmistry@google.comd6176b02012-08-23 18:14:13 +0000508 path.addRect(12, 16, 21, 21, (SkPath::Direction) 0);
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000509 testSimplifyx(path);
510}
511
caryclark@google.comc899ad92012-08-23 15:24:42 +0000512static void testLine19x() {
513 SkPath path;
514 path.setFillType(SkPath::kEvenOdd_FillType);
515 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
skia.committer@gmail.coma27096b2012-08-30 14:38:00 +0000516 path.addRect(12, 16, 21, 21, (SkPath::Direction) 0);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000517 testSimplifyx(path);
518}
519
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000520static void testLine20() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000521 SkPath path;
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000522 path.addRect(0, 12, 12, 12, (SkPath::Direction) 0);
523 path.addRect(0, 12, 9, 9, (SkPath::Direction) 0);
524 testSimplifyx(path);
525}
526
caryclark@google.comc899ad92012-08-23 15:24:42 +0000527static void testLine20x() {
528 SkPath path;
529 path.setFillType(SkPath::kEvenOdd_FillType);
530 path.addRect(0, 12, 12, 12, (SkPath::Direction) 0);
531 path.addRect(0, 12, 9, 9, (SkPath::Direction) 0);
532 testSimplifyx(path);
533}
534
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000535static void testLine21() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000536 SkPath path;
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000537 path.addRect(0, 12, 12, 12, (SkPath::Direction) 0);
538 path.addRect(0, 16, 9, 9, (SkPath::Direction) 0);
539 testSimplifyx(path);
540}
541
caryclark@google.comc899ad92012-08-23 15:24:42 +0000542static void testLine21x() {
543 SkPath path;
544 path.setFillType(SkPath::kEvenOdd_FillType);
545 path.addRect(0, 12, 12, 12, (SkPath::Direction) 0);
546 path.addRect(0, 16, 9, 9, (SkPath::Direction) 0);
547 testSimplifyx(path);
548}
549
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000550static void testLine22() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000551 SkPath path;
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000552 path.addRect(0, 12, 12, 12, (SkPath::Direction) 0);
553 path.addRect(4, 12, 13, 13, (SkPath::Direction) 0);
554 testSimplifyx(path);
555}
556
caryclark@google.comc899ad92012-08-23 15:24:42 +0000557static void testLine22x() {
558 SkPath path;
559 path.setFillType(SkPath::kEvenOdd_FillType);
560 path.addRect(0, 12, 12, 12, (SkPath::Direction) 0);
561 path.addRect(4, 12, 13, 13, (SkPath::Direction) 0);
562 testSimplifyx(path);
563}
564
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000565static void testLine23() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000566 SkPath path;
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000567 path.addRect(0, 12, 12, 12, (SkPath::Direction) 0);
568 path.addRect(12, 0, 21, 21, (SkPath::Direction) 0);
569 testSimplifyx(path);
570}
571
caryclark@google.comc899ad92012-08-23 15:24:42 +0000572static void testLine23x() {
573 SkPath path;
574 path.setFillType(SkPath::kEvenOdd_FillType);
575 path.addRect(0, 12, 12, 12, (SkPath::Direction) 0);
576 path.addRect(12, 0, 21, 21, (SkPath::Direction) 0);
577 testSimplifyx(path);
578}
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000579
580static void testLine24a() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000581 SkPath path;
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000582 path.moveTo(2,0);
583 path.lineTo(4,4);
584 path.lineTo(0,4);
585 path.close();
586 path.moveTo(2,0);
587 path.lineTo(1,2);
588 path.lineTo(2,2);
589 path.close();
590 testSimplifyx(path);
591}
592
caryclark@google.comc899ad92012-08-23 15:24:42 +0000593static void testLine24ax() {
594 SkPath path;
595 path.setFillType(SkPath::kEvenOdd_FillType);
596 path.moveTo(2,0);
597 path.lineTo(4,4);
598 path.lineTo(0,4);
599 path.close();
600 path.moveTo(2,0);
601 path.lineTo(1,2);
602 path.lineTo(2,2);
603 path.close();
604 testSimplifyx(path);
605}
606
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000607static void testLine24() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000608 SkPath path;
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000609 path.addRect(0, 18, 12, 12, (SkPath::Direction) 0);
610 path.addRect(4, 12, 13, 13, (SkPath::Direction) 0);
611 testSimplifyx(path);
612}
613
caryclark@google.comc899ad92012-08-23 15:24:42 +0000614static void testLine24x() {
615 SkPath path;
616 path.setFillType(SkPath::kEvenOdd_FillType);
617 path.addRect(0, 18, 12, 12, (SkPath::Direction) 0);
618 path.addRect(4, 12, 13, 13, (SkPath::Direction) 0);
619 testSimplifyx(path);
620}
621
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000622static void testLine25() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000623 SkPath path;
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000624 path.addRect(0, 6, 12, 12, (SkPath::Direction) 0);
625 path.addRect(12, 0, 21, 21, (SkPath::Direction) 0);
626 testSimplifyx(path);
627}
628
caryclark@google.comc899ad92012-08-23 15:24:42 +0000629static void testLine25x() {
630 SkPath path;
631 path.setFillType(SkPath::kEvenOdd_FillType);
632 path.addRect(0, 6, 12, 12, (SkPath::Direction) 0);
633 path.addRect(12, 0, 21, 21, (SkPath::Direction) 0);
634 testSimplifyx(path);
635}
636
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000637static void testLine26() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000638 SkPath path;
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000639 path.addRect(0, 18, 12, 12, (SkPath::Direction) 0);
640 path.addRect(0, 12, 9, 9, (SkPath::Direction) 0);
641 testSimplifyx(path);
642}
643
caryclark@google.comc899ad92012-08-23 15:24:42 +0000644static void testLine26x() {
645 SkPath path;
646 path.setFillType(SkPath::kEvenOdd_FillType);
647 path.addRect(0, 18, 12, 12, (SkPath::Direction) 0);
648 path.addRect(0, 12, 9, 9, (SkPath::Direction) 0);
649 testSimplifyx(path);
650}
651
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000652static void testLine27() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000653 SkPath path;
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000654 path.addRect(0, 18, 12, 12, (SkPath::Direction) 0);
655 path.addRect(12, 8, 21, 21, (SkPath::Direction) 0);
656 testSimplifyx(path);
657}
658
caryclark@google.comc899ad92012-08-23 15:24:42 +0000659static void testLine27x() {
660 SkPath path;
661 path.setFillType(SkPath::kEvenOdd_FillType);
662 path.addRect(0, 18, 12, 12, (SkPath::Direction) 0);
663 path.addRect(12, 8, 21, 21, (SkPath::Direction) 0);
664 testSimplifyx(path);
665}
666
caryclark@google.comfa4a6e92012-07-11 17:52:32 +0000667static void testLine28() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000668 SkPath path;
caryclark@google.comfa4a6e92012-07-11 17:52:32 +0000669 path.addRect(0, 6, 12, 12, (SkPath::Direction) 0);
670 path.addRect(0, 0, 9, 9, (SkPath::Direction) 0);
671 testSimplifyx(path);
672}
673
caryclark@google.comc899ad92012-08-23 15:24:42 +0000674static void testLine28x() {
675 SkPath path;
676 path.setFillType(SkPath::kEvenOdd_FillType);
677 path.addRect(0, 6, 12, 12, (SkPath::Direction) 0);
678 path.addRect(0, 0, 9, 9, (SkPath::Direction) 0);
679 testSimplifyx(path);
680}
681
caryclark@google.comfa4a6e92012-07-11 17:52:32 +0000682static void testLine29() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000683 SkPath path;
caryclark@google.comfa4a6e92012-07-11 17:52:32 +0000684 path.addRect(0, 18, 12, 12, (SkPath::Direction) 0);
685 path.addRect(12, 12, 21, 21, (SkPath::Direction) 0);
686 testSimplifyx(path);
687}
688
caryclark@google.comc899ad92012-08-23 15:24:42 +0000689static void testLine29x() {
690 SkPath path;
691 path.setFillType(SkPath::kEvenOdd_FillType);
692 path.addRect(0, 18, 12, 12, (SkPath::Direction) 0);
693 path.addRect(12, 12, 21, 21, (SkPath::Direction) 0);
694 testSimplifyx(path);
695}
696
caryclark@google.comfa4a6e92012-07-11 17:52:32 +0000697static void testLine30() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000698 SkPath path;
caryclark@google.comfa4a6e92012-07-11 17:52:32 +0000699 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
700 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
701 path.addRect(4, 4, 13, 13, (SkPath::Direction) 0);
702 testSimplifyx(path);
703}
704
caryclark@google.comc899ad92012-08-23 15:24:42 +0000705static void testLine30x() {
706 SkPath path;
707 path.setFillType(SkPath::kEvenOdd_FillType);
708 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
709 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
710 path.addRect(4, 4, 13, 13, (SkPath::Direction) 0);
711 testSimplifyx(path);
712}
713
caryclark@google.comfa4a6e92012-07-11 17:52:32 +0000714static void testLine31() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000715 SkPath path;
caryclark@google.comfa4a6e92012-07-11 17:52:32 +0000716 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
717 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
718 path.addRect(0, 4, 9, 9, (SkPath::Direction) 0);
719 testSimplifyx(path);
720}
721
caryclark@google.comc899ad92012-08-23 15:24:42 +0000722static void testLine31x() {
723 SkPath path;
724 path.setFillType(SkPath::kEvenOdd_FillType);
725 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
726 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
727 path.addRect(0, 4, 9, 9, (SkPath::Direction) 0);
728 testSimplifyx(path);
729}
730
caryclark@google.comfa4a6e92012-07-11 17:52:32 +0000731static void testLine32() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000732 SkPath path;
caryclark@google.comfa4a6e92012-07-11 17:52:32 +0000733 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
734 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
735 path.addRect(4, 12, 13, 13, (SkPath::Direction) 0);
736 testSimplifyx(path);
737}
738
caryclark@google.comc899ad92012-08-23 15:24:42 +0000739static void testLine32x() {
740 SkPath path;
741 path.setFillType(SkPath::kEvenOdd_FillType);
742 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
743 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
744 path.addRect(4, 12, 13, 13, (SkPath::Direction) 0);
745 testSimplifyx(path);
746}
747
caryclark@google.com210acaf2012-07-12 21:05:13 +0000748static void testLine33() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000749 SkPath path;
caryclark@google.com210acaf2012-07-12 21:05:13 +0000750 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
751 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
752 path.addRect(4, 16, 13, 13, (SkPath::Direction) 0);
753 testSimplifyx(path);
754}
755
caryclark@google.comc899ad92012-08-23 15:24:42 +0000756static void testLine33x() {
757 SkPath path;
758 path.setFillType(SkPath::kEvenOdd_FillType);
759 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
760 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
761 path.addRect(4, 16, 13, 13, (SkPath::Direction) 0);
762 testSimplifyx(path);
763}
764
caryclark@google.com210acaf2012-07-12 21:05:13 +0000765static void testLine34() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000766 SkPath path;
caryclark@google.com210acaf2012-07-12 21:05:13 +0000767 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
768 path.addRect(0, 6, 12, 12, (SkPath::Direction) 0);
769 path.addRect(4, 12, 13, 13, (SkPath::Direction) 0);
770 testSimplifyx(path);
771}
772
caryclark@google.comc899ad92012-08-23 15:24:42 +0000773static void testLine34x() {
774 SkPath path;
775 path.setFillType(SkPath::kEvenOdd_FillType);
776 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
777 path.addRect(0, 6, 12, 12, (SkPath::Direction) 0);
778 path.addRect(4, 12, 13, 13, (SkPath::Direction) 0);
779 testSimplifyx(path);
780}
781
caryclark@google.com210acaf2012-07-12 21:05:13 +0000782static void testLine35() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000783 SkPath path;
caryclark@google.com210acaf2012-07-12 21:05:13 +0000784 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
785 path.addRect(6, 0, 18, 18, (SkPath::Direction) 0);
786 path.addRect(4, 16, 13, 13, (SkPath::Direction) 0);
787 testSimplifyx(path);
788}
789
caryclark@google.comc899ad92012-08-23 15:24:42 +0000790static void testLine35x() {
791 SkPath path;
792 path.setFillType(SkPath::kEvenOdd_FillType);
793 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
794 path.addRect(6, 0, 18, 18, (SkPath::Direction) 0);
795 path.addRect(4, 16, 13, 13, (SkPath::Direction) 0);
796 testSimplifyx(path);
797}
798
caryclark@google.com0e08a192012-07-13 21:07:52 +0000799static void testLine36() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000800 SkPath path;
caryclark@google.com0e08a192012-07-13 21:07:52 +0000801 path.addRect(0, 10, 20, 20, (SkPath::Direction) 0);
802 path.addRect(6, 12, 18, 18, (SkPath::Direction) 0);
803 path.addRect(4, 16, 13, 13, (SkPath::Direction) 0);
804 testSimplifyx(path);
805}
806
caryclark@google.comc899ad92012-08-23 15:24:42 +0000807static void testLine36x() {
808 SkPath path;
809 path.setFillType(SkPath::kEvenOdd_FillType);
810 path.addRect(0, 10, 20, 20, (SkPath::Direction) 0);
811 path.addRect(6, 12, 18, 18, (SkPath::Direction) 0);
812 path.addRect(4, 16, 13, 13, (SkPath::Direction) 0);
813 testSimplifyx(path);
814}
815
caryclark@google.com47580692012-07-23 12:14:49 +0000816static void testLine37() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000817 SkPath path;
caryclark@google.com47580692012-07-23 12:14:49 +0000818 path.addRect(0, 20, 20, 20, (SkPath::Direction) 0);
819 path.addRect(18, 24, 30, 30, (SkPath::Direction) 0);
820 path.addRect(0, 0, 9, 9, (SkPath::Direction) 0);
821 testSimplifyx(path);
822}
823
caryclark@google.comc899ad92012-08-23 15:24:42 +0000824static void testLine37x() {
825 SkPath path;
826 path.setFillType(SkPath::kEvenOdd_FillType);
827 path.addRect(0, 20, 20, 20, (SkPath::Direction) 0);
828 path.addRect(18, 24, 30, 30, (SkPath::Direction) 0);
829 path.addRect(0, 0, 9, 9, (SkPath::Direction) 0);
830 testSimplifyx(path);
831}
832
caryclark@google.com47580692012-07-23 12:14:49 +0000833static void testLine38() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000834 SkPath path;
caryclark@google.com47580692012-07-23 12:14:49 +0000835 path.addRect(10, 0, 30, 30, (SkPath::Direction) 0);
836 path.addRect(6, 12, 18, 18, (SkPath::Direction) 0);
837 path.addRect(12, 12, 21, 21, (SkPath::Direction) 0);
838 testSimplifyx(path);
839}
840
caryclark@google.comc899ad92012-08-23 15:24:42 +0000841static void testLine38x() {
842 SkPath path;
843 path.setFillType(SkPath::kEvenOdd_FillType);
844 path.addRect(10, 0, 30, 30, (SkPath::Direction) 0);
845 path.addRect(6, 12, 18, 18, (SkPath::Direction) 0);
846 path.addRect(12, 12, 21, 21, (SkPath::Direction) 0);
847 testSimplifyx(path);
848}
849
caryclark@google.com47580692012-07-23 12:14:49 +0000850static void testLine40() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000851 SkPath path;
caryclark@google.com47580692012-07-23 12:14:49 +0000852 path.addRect(10, 0, 30, 30, (SkPath::Direction) 0);
853 path.addRect(12, 18, 24, 24, (SkPath::Direction) 0);
854 path.addRect(4, 16, 13, 13, (SkPath::Direction) 0);
855 testSimplifyx(path);
856}
857
caryclark@google.comc899ad92012-08-23 15:24:42 +0000858static void testLine40x() {
859 SkPath path;
860 path.setFillType(SkPath::kEvenOdd_FillType);
861 path.addRect(10, 0, 30, 30, (SkPath::Direction) 0);
862 path.addRect(12, 18, 24, 24, (SkPath::Direction) 0);
863 path.addRect(4, 16, 13, 13, (SkPath::Direction) 0);
864 testSimplifyx(path);
865}
866
caryclark@google.com47580692012-07-23 12:14:49 +0000867static void testLine41() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000868 SkPath path;
caryclark@google.com47580692012-07-23 12:14:49 +0000869 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
870 path.addRect(18, 24, 30, 30, (SkPath::Direction) 0);
871 path.addRect(12, 0, 21, 21, (SkPath::Direction) 0);
872 testSimplifyx(path);
873}
874
caryclark@google.comc899ad92012-08-23 15:24:42 +0000875static void testLine41x() {
876 SkPath path;
877 path.setFillType(SkPath::kEvenOdd_FillType);
878 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
879 path.addRect(18, 24, 30, 30, (SkPath::Direction) 0);
880 path.addRect(12, 0, 21, 21, (SkPath::Direction) 0);
881 testSimplifyx(path);
882}
883
caryclark@google.com47580692012-07-23 12:14:49 +0000884static void testLine42() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000885 SkPath path;
caryclark@google.com47580692012-07-23 12:14:49 +0000886 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
887 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
888 path.addRect(8, 16, 17, 17, (SkPath::Direction) 0);
889 testSimplifyx(path);
890}
891
caryclark@google.comc899ad92012-08-23 15:24:42 +0000892static void testLine42x() {
893 SkPath path;
894 path.setFillType(SkPath::kEvenOdd_FillType);
895 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
896 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
897 path.addRect(8, 16, 17, 17, (SkPath::Direction) 0);
898 testSimplifyx(path);
899}
900
caryclark@google.com47580692012-07-23 12:14:49 +0000901static void testLine43() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000902 SkPath path;
caryclark@google.com47580692012-07-23 12:14:49 +0000903 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
904 path.addRect(6, 24, 18, 18, (SkPath::Direction) 0);
905 path.addRect(0, 32, 9, 36, (SkPath::Direction) 1);
906 testSimplifyx(path);
907}
908
caryclark@google.comc899ad92012-08-23 15:24:42 +0000909static void testLine43x() {
910 SkPath path;
911 path.setFillType(SkPath::kEvenOdd_FillType);
912 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
913 path.addRect(6, 24, 18, 18, (SkPath::Direction) 0);
914 path.addRect(0, 32, 9, 36, (SkPath::Direction) 1);
915 testSimplifyx(path);
916}
917
caryclark@google.com47580692012-07-23 12:14:49 +0000918static void testLine44() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000919 SkPath path;
caryclark@google.com47580692012-07-23 12:14:49 +0000920 path.addRect(10, 40, 30, 30, (SkPath::Direction) 0);
921 path.addRect(18, 0, 30, 30, (SkPath::Direction) 0);
922 path.addRect(18, 32, 27, 36, (SkPath::Direction) 1);
923 testSimplifyx(path);
924}
925
caryclark@google.comc899ad92012-08-23 15:24:42 +0000926static void testLine44x() {
927 SkPath path;
928 path.setFillType(SkPath::kEvenOdd_FillType);
929 path.addRect(10, 40, 30, 30, (SkPath::Direction) 0);
930 path.addRect(18, 0, 30, 30, (SkPath::Direction) 0);
931 path.addRect(18, 32, 27, 36, (SkPath::Direction) 1);
932 testSimplifyx(path);
933}
934
caryclark@google.com47580692012-07-23 12:14:49 +0000935static void testLine45() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000936 SkPath path;
caryclark@google.com47580692012-07-23 12:14:49 +0000937 path.addRect(10, 0, 30, 30, (SkPath::Direction) 0);
938 path.addRect(18, 0, 30, 30, (SkPath::Direction) 0);
939 path.addRect(24, 32, 33, 36, (SkPath::Direction) 0);
940 testSimplifyx(path);
941}
942
caryclark@google.comc899ad92012-08-23 15:24:42 +0000943static void testLine45x() {
944 SkPath path;
945 path.setFillType(SkPath::kEvenOdd_FillType);
946 path.addRect(10, 0, 30, 30, (SkPath::Direction) 0);
947 path.addRect(18, 0, 30, 30, (SkPath::Direction) 0);
948 path.addRect(24, 32, 33, 36, (SkPath::Direction) 0);
949 testSimplifyx(path);
950}
951
caryclark@google.com47580692012-07-23 12:14:49 +0000952static void testLine46() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000953 SkPath path;
caryclark@google.com47580692012-07-23 12:14:49 +0000954 path.addRect(10, 40, 30, 30, (SkPath::Direction) 0);
955 path.addRect(24, 0, 36, 36, (SkPath::Direction) 0);
956 path.addRect(24, 32, 33, 36, (SkPath::Direction) 0);
957 testSimplifyx(path);
958}
959
caryclark@google.comc899ad92012-08-23 15:24:42 +0000960static void testLine46x() {
961 SkPath path;
962 path.setFillType(SkPath::kEvenOdd_FillType);
963 path.addRect(10, 40, 30, 30, (SkPath::Direction) 0);
964 path.addRect(24, 0, 36, 36, (SkPath::Direction) 0);
965 path.addRect(24, 32, 33, 36, (SkPath::Direction) 0);
966 testSimplifyx(path);
967}
968
caryclark@google.com47580692012-07-23 12:14:49 +0000969static void testLine47() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000970 SkPath path;
caryclark@google.com47580692012-07-23 12:14:49 +0000971 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
972 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
973 path.addRect(0, 0, 9, 9, (SkPath::Direction) 1);
974 testSimplifyx(path);
975}
976
caryclark@google.comc899ad92012-08-23 15:24:42 +0000977static void testLine47x() {
978 SkPath path;
979 path.setFillType(SkPath::kEvenOdd_FillType);
980 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
981 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
982 path.addRect(0, 0, 9, 9, (SkPath::Direction) 1);
983 testSimplifyx(path);
984}
985
caryclark@google.com47580692012-07-23 12:14:49 +0000986static void testLine48() {
caryclark@google.com59823f72012-08-09 18:17:47 +0000987 SkPath path;
caryclark@google.com47580692012-07-23 12:14:49 +0000988 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
989 path.addRect(0, 6, 12, 12, (SkPath::Direction) 0);
990 path.addRect(0, 0, 9, 9, (SkPath::Direction) 1);
991 testSimplifyx(path);
992}
993
caryclark@google.comc899ad92012-08-23 15:24:42 +0000994static void testLine48x() {
995 SkPath path;
996 path.setFillType(SkPath::kEvenOdd_FillType);
997 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
998 path.addRect(0, 6, 12, 12, (SkPath::Direction) 0);
999 path.addRect(0, 0, 9, 9, (SkPath::Direction) 1);
1000 testSimplifyx(path);
1001}
1002
caryclark@google.com47580692012-07-23 12:14:49 +00001003static void testLine49() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001004 SkPath path;
caryclark@google.com47580692012-07-23 12:14:49 +00001005 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
1006 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
1007 path.addRect(0, 0, 9, 9, (SkPath::Direction) 0);
1008 testSimplifyx(path);
1009}
1010
caryclark@google.comc899ad92012-08-23 15:24:42 +00001011static void testLine49x() {
1012 SkPath path;
1013 path.setFillType(SkPath::kEvenOdd_FillType);
1014 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
1015 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
1016 path.addRect(0, 0, 9, 9, (SkPath::Direction) 0);
1017 testSimplifyx(path);
1018}
1019
caryclark@google.com47580692012-07-23 12:14:49 +00001020static void testLine50() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001021 SkPath path;
caryclark@google.com47580692012-07-23 12:14:49 +00001022 path.addRect(10, 30, 30, 30, (SkPath::Direction) 0);
1023 path.addRect(24, 20, 36, 30, (SkPath::Direction) 0);
1024 testSimplifyx(path);
1025}
1026
caryclark@google.comc899ad92012-08-23 15:24:42 +00001027static void testLine50x() {
1028 SkPath path;
1029 path.setFillType(SkPath::kEvenOdd_FillType);
1030 path.addRect(10, 30, 30, 30, (SkPath::Direction) 0);
1031 path.addRect(24, 20, 36, 30, (SkPath::Direction) 0);
1032 testSimplifyx(path);
1033}
caryclark@google.com47580692012-07-23 12:14:49 +00001034
1035static void testLine51() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001036 SkPath path;
caryclark@google.com47580692012-07-23 12:14:49 +00001037 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
1038 path.addRect(0, 12, 12, 12, (SkPath::Direction) 0);
1039 path.addRect(4, 12, 13, 13, (SkPath::Direction) 1);
1040 testSimplifyx(path);
1041}
1042
caryclark@google.comc899ad92012-08-23 15:24:42 +00001043static void testLine51x() {
1044 SkPath path;
1045 path.setFillType(SkPath::kEvenOdd_FillType);
1046 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
1047 path.addRect(0, 12, 12, 12, (SkPath::Direction) 0);
1048 path.addRect(4, 12, 13, 13, (SkPath::Direction) 1);
1049 testSimplifyx(path);
1050}
1051
caryclark@google.come21cb182012-07-23 21:26:31 +00001052static void testLine52() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001053 SkPath path;
caryclark@google.come21cb182012-07-23 21:26:31 +00001054 path.addRect(0, 30, 20, 20, (SkPath::Direction) 0);
1055 path.addRect(6, 20, 18, 30, (SkPath::Direction) 0);
1056 path.addRect(32, 0, 36, 41, (SkPath::Direction) 0);
1057 testSimplifyx(path);
1058}
1059
caryclark@google.comc899ad92012-08-23 15:24:42 +00001060static void testLine52x() {
1061 SkPath path;
1062 path.setFillType(SkPath::kEvenOdd_FillType);
1063 path.addRect(0, 30, 20, 20, (SkPath::Direction) 0);
1064 path.addRect(6, 20, 18, 30, (SkPath::Direction) 0);
1065 path.addRect(32, 0, 36, 41, (SkPath::Direction) 0);
1066 testSimplifyx(path);
1067}
1068
caryclark@google.come21cb182012-07-23 21:26:31 +00001069static void testLine53() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001070 SkPath path;
caryclark@google.come21cb182012-07-23 21:26:31 +00001071 path.addRect(10, 30, 30, 30, (SkPath::Direction) 0);
1072 path.addRect(12, 20, 24, 30, (SkPath::Direction) 0);
1073 path.addRect(12, 32, 21, 36, (SkPath::Direction) 1);
1074 testSimplifyx(path);
1075}
1076
caryclark@google.comc899ad92012-08-23 15:24:42 +00001077static void testLine53x() {
1078 SkPath path;
1079 path.setFillType(SkPath::kEvenOdd_FillType);
1080 path.addRect(10, 30, 30, 30, (SkPath::Direction) 0);
1081 path.addRect(12, 20, 24, 30, (SkPath::Direction) 0);
1082 path.addRect(12, 32, 21, 36, (SkPath::Direction) 1);
1083 testSimplifyx(path);
1084}
1085
caryclark@google.come21cb182012-07-23 21:26:31 +00001086static void testLine54() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001087 SkPath path;
caryclark@google.come21cb182012-07-23 21:26:31 +00001088 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
1089 path.addRect(6, 0, 18, 18, (SkPath::Direction) 0);
1090 path.addRect(8, 4, 17, 17, (SkPath::Direction) 1);
1091 testSimplifyx(path);
1092}
1093
caryclark@google.comc899ad92012-08-23 15:24:42 +00001094static void testLine54x() {
1095 SkPath path;
1096 path.setFillType(SkPath::kEvenOdd_FillType);
1097 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
1098 path.addRect(6, 0, 18, 18, (SkPath::Direction) 0);
1099 path.addRect(8, 4, 17, 17, (SkPath::Direction) 1);
1100 testSimplifyx(path);
1101}
1102
caryclark@google.come21cb182012-07-23 21:26:31 +00001103static void testLine55() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001104 SkPath path;
caryclark@google.come21cb182012-07-23 21:26:31 +00001105 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
1106 path.addRect(6, 6, 18, 18, (SkPath::Direction) 0);
1107 path.addRect(4, 4, 13, 13, (SkPath::Direction) 1);
1108 testSimplifyx(path);
1109}
1110
caryclark@google.comc899ad92012-08-23 15:24:42 +00001111static void testLine55x() {
1112 SkPath path;
1113 path.setFillType(SkPath::kEvenOdd_FillType);
1114 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
1115 path.addRect(6, 6, 18, 18, (SkPath::Direction) 0);
1116 path.addRect(4, 4, 13, 13, (SkPath::Direction) 1);
1117 testSimplifyx(path);
1118}
1119
caryclark@google.com18063442012-07-25 12:05:18 +00001120static void testLine56() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001121 SkPath path;
caryclark@google.com18063442012-07-25 12:05:18 +00001122 path.addRect(0, 20, 20, 20, (SkPath::Direction) 0);
1123 path.addRect(18, 20, 30, 30, (SkPath::Direction) 0);
1124 path.addRect(12, 0, 21, 21, (SkPath::Direction) 1);
1125 testSimplifyx(path);
1126}
1127
caryclark@google.comc899ad92012-08-23 15:24:42 +00001128static void testLine56x() {
1129 SkPath path;
1130 path.setFillType(SkPath::kEvenOdd_FillType);
1131 path.addRect(0, 20, 20, 20, (SkPath::Direction) 0);
1132 path.addRect(18, 20, 30, 30, (SkPath::Direction) 0);
1133 path.addRect(12, 0, 21, 21, (SkPath::Direction) 1);
1134 testSimplifyx(path);
1135}
1136
caryclark@google.com18063442012-07-25 12:05:18 +00001137static void testLine57() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001138 SkPath path;
caryclark@google.com18063442012-07-25 12:05:18 +00001139 path.addRect(20, 0, 40, 40, (SkPath::Direction) 0);
1140 path.addRect(20, 0, 30, 40, (SkPath::Direction) 0);
1141 path.addRect(12, 0, 21, 21, (SkPath::Direction) 1);
1142 testSimplifyx(path);
1143}
1144
caryclark@google.comc899ad92012-08-23 15:24:42 +00001145static void testLine57x() {
1146 SkPath path;
1147 path.setFillType(SkPath::kEvenOdd_FillType);
1148 path.addRect(20, 0, 40, 40, (SkPath::Direction) 0);
1149 path.addRect(20, 0, 30, 40, (SkPath::Direction) 0);
1150 path.addRect(12, 0, 21, 21, (SkPath::Direction) 1);
1151 testSimplifyx(path);
1152}
1153
caryclark@google.comcc905052012-07-25 20:59:42 +00001154static void testLine58() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001155 SkPath path;
caryclark@google.comcc905052012-07-25 20:59:42 +00001156 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
1157 path.addRect(0, 0, 12, 12, (SkPath::Direction) 1);
1158 path.addRect(0, 12, 9, 9, (SkPath::Direction) 1);
1159 testSimplifyx(path);
1160}
1161
caryclark@google.comc899ad92012-08-23 15:24:42 +00001162static void testLine58x() {
1163 SkPath path;
1164 path.setFillType(SkPath::kEvenOdd_FillType);
1165 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
1166 path.addRect(0, 0, 12, 12, (SkPath::Direction) 1);
1167 path.addRect(0, 12, 9, 9, (SkPath::Direction) 1);
1168 testSimplifyx(path);
1169}
1170
caryclark@google.comcc905052012-07-25 20:59:42 +00001171static void testLine59() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001172 SkPath path;
caryclark@google.comcc905052012-07-25 20:59:42 +00001173 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
1174 path.addRect(6, 6, 18, 18, (SkPath::Direction) 1);
1175 path.addRect(4, 4, 13, 13, (SkPath::Direction) 1);
1176 testSimplifyx(path);
1177}
1178
caryclark@google.comc899ad92012-08-23 15:24:42 +00001179static void testLine59x() {
1180 SkPath path;
1181 path.setFillType(SkPath::kEvenOdd_FillType);
1182 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
1183 path.addRect(6, 6, 18, 18, (SkPath::Direction) 1);
1184 path.addRect(4, 4, 13, 13, (SkPath::Direction) 1);
1185 testSimplifyx(path);
1186}
1187
caryclark@google.com27c449a2012-07-27 18:26:38 +00001188static void testLine60() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001189 SkPath path;
caryclark@google.com27c449a2012-07-27 18:26:38 +00001190 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
1191 path.addRect(6, 12, 18, 18, (SkPath::Direction) 1);
1192 path.addRect(4, 12, 13, 13, (SkPath::Direction) 1);
1193 testSimplifyx(path);
1194}
1195
caryclark@google.comc899ad92012-08-23 15:24:42 +00001196static void testLine60x() {
1197 SkPath path;
1198 path.setFillType(SkPath::kEvenOdd_FillType);
1199 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
1200 path.addRect(6, 12, 18, 18, (SkPath::Direction) 1);
1201 path.addRect(4, 12, 13, 13, (SkPath::Direction) 1);
1202 testSimplifyx(path);
1203}
1204
caryclark@google.com27c449a2012-07-27 18:26:38 +00001205static void testLine61() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001206 SkPath path;
caryclark@google.com27c449a2012-07-27 18:26:38 +00001207 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
1208 path.addRect(12, 0, 24, 24, (SkPath::Direction) 1);
1209 path.addRect(12, 0, 21, 21, (SkPath::Direction) 1);
1210 testSimplifyx(path);
1211}
1212
caryclark@google.comc899ad92012-08-23 15:24:42 +00001213static void testLine61x() {
1214 SkPath path;
1215 path.setFillType(SkPath::kEvenOdd_FillType);
1216 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
1217 path.addRect(12, 0, 24, 24, (SkPath::Direction) 1);
1218 path.addRect(12, 0, 21, 21, (SkPath::Direction) 1);
1219 testSimplifyx(path);
1220}
1221
caryclark@google.com27c449a2012-07-27 18:26:38 +00001222static void testLine62() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001223 SkPath path;
caryclark@google.com27c449a2012-07-27 18:26:38 +00001224 path.addRect(0, 0, 60, 60, (SkPath::Direction) 0);
1225 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
1226 path.addRect(0, 12, 12, 12, (SkPath::Direction) 0);
1227 path.addRect(4, 12, 13, 13, (SkPath::Direction) 1);
1228 testSimplifyx(path);
1229}
1230
caryclark@google.comc899ad92012-08-23 15:24:42 +00001231static void testLine62x() {
1232 SkPath path;
1233 path.setFillType(SkPath::kEvenOdd_FillType);
1234 path.addRect(0, 0, 60, 60, (SkPath::Direction) 0);
1235 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
1236 path.addRect(0, 12, 12, 12, (SkPath::Direction) 0);
1237 path.addRect(4, 12, 13, 13, (SkPath::Direction) 1);
1238 testSimplifyx(path);
1239}
1240
caryclark@google.com27c449a2012-07-27 18:26:38 +00001241static void testLine63() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001242 SkPath path;
caryclark@google.com27c449a2012-07-27 18:26:38 +00001243 path.addRect(0, 0, 60, 60, (SkPath::Direction) 0);
1244 path.addRect(0, 10, 20, 20, (SkPath::Direction) 0);
1245 path.addRect(0, 6, 12, 12, (SkPath::Direction) 1);
1246 path.addRect(0, 32, 9, 36, (SkPath::Direction) 1);
1247 testSimplifyx(path);
1248}
1249
caryclark@google.comc899ad92012-08-23 15:24:42 +00001250static void testLine63x() {
1251 SkPath path;
1252 path.setFillType(SkPath::kEvenOdd_FillType);
1253 path.addRect(0, 0, 60, 60, (SkPath::Direction) 0);
1254 path.addRect(0, 10, 20, 20, (SkPath::Direction) 0);
1255 path.addRect(0, 6, 12, 12, (SkPath::Direction) 1);
1256 path.addRect(0, 32, 9, 36, (SkPath::Direction) 1);
1257 testSimplifyx(path);
1258}
1259
caryclark@google.com27c449a2012-07-27 18:26:38 +00001260static void testLine64() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001261 SkPath path;
caryclark@google.com27c449a2012-07-27 18:26:38 +00001262 path.addRect(0, 0, 60, 60, (SkPath::Direction) 0);
1263 path.addRect(10, 40, 30, 30, (SkPath::Direction) 0);
1264 path.addRect(18, 6, 30, 30, (SkPath::Direction) 0);
1265 testSimplifyx(path);
1266}
1267
caryclark@google.comc899ad92012-08-23 15:24:42 +00001268static void testLine64x() {
1269 SkPath path;
1270 path.setFillType(SkPath::kEvenOdd_FillType);
1271 path.addRect(0, 0, 60, 60, (SkPath::Direction) 0);
1272 path.addRect(10, 40, 30, 30, (SkPath::Direction) 0);
1273 path.addRect(18, 6, 30, 30, (SkPath::Direction) 0);
1274 testSimplifyx(path);
1275}
1276
caryclark@google.com27c449a2012-07-27 18:26:38 +00001277static void testLine65() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001278 SkPath path;
caryclark@google.com27c449a2012-07-27 18:26:38 +00001279 path.addRect(0, 0, 60, 60, (SkPath::Direction) 0);
1280 path.addRect(10, 0, 30, 30, (SkPath::Direction) 0);
1281 path.addRect(24, 0, 36, 36, (SkPath::Direction) 0);
1282 path.addRect(32, 6, 36, 41, (SkPath::Direction) 1);
1283 testSimplifyx(path);
1284}
1285
caryclark@google.comc899ad92012-08-23 15:24:42 +00001286static void testLine65x() {
1287 SkPath path;
1288 path.setFillType(SkPath::kEvenOdd_FillType);
1289 path.addRect(0, 0, 60, 60, (SkPath::Direction) 0);
1290 path.addRect(10, 0, 30, 30, (SkPath::Direction) 0);
1291 path.addRect(24, 0, 36, 36, (SkPath::Direction) 0);
1292 path.addRect(32, 6, 36, 41, (SkPath::Direction) 1);
1293 testSimplifyx(path);
1294}
1295
caryclark@google.com27c449a2012-07-27 18:26:38 +00001296static void testLine66() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001297 SkPath path;
caryclark@google.com27c449a2012-07-27 18:26:38 +00001298 path.addRect(0, 0, 60, 60, (SkPath::Direction) 0);
1299 path.addRect(0, 30, 20, 20, (SkPath::Direction) 0);
1300 path.addRect(12, 20, 24, 30, (SkPath::Direction) 0);
1301 testSimplifyx(path);
1302}
1303
caryclark@google.comc899ad92012-08-23 15:24:42 +00001304static void testLine66x() {
1305 SkPath path;
1306 path.setFillType(SkPath::kEvenOdd_FillType);
1307 path.addRect(0, 0, 60, 60, (SkPath::Direction) 0);
1308 path.addRect(0, 30, 20, 20, (SkPath::Direction) 0);
1309 path.addRect(12, 20, 24, 30, (SkPath::Direction) 0);
1310 testSimplifyx(path);
1311}
1312
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001313static void testLine67() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001314 SkPath path;
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001315 path.addRect(0, 0, 60, 60, (SkPath::Direction) 0);
1316 path.addRect(10, 40, 30, 30, (SkPath::Direction) 0);
1317 path.addRect(24, 20, 36, 30, (SkPath::Direction) 0);
1318 path.addRect(32, 0, 36, 41, (SkPath::Direction) 0);
1319 testSimplifyx(path);
1320}
1321
caryclark@google.comc899ad92012-08-23 15:24:42 +00001322static void testLine67x() {
1323 SkPath path;
1324 path.setFillType(SkPath::kEvenOdd_FillType);
1325 path.addRect(0, 0, 60, 60, (SkPath::Direction) 0);
1326 path.addRect(10, 40, 30, 30, (SkPath::Direction) 0);
1327 path.addRect(24, 20, 36, 30, (SkPath::Direction) 0);
1328 path.addRect(32, 0, 36, 41, (SkPath::Direction) 0);
1329 testSimplifyx(path);
1330}
1331
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001332static void testLine68a() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001333 SkPath path;
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001334 path.addRect(0, 0, 8, 8, (SkPath::Direction) 0);
1335 path.addRect(2, 2, 6, 6, (SkPath::Direction) 0);
1336 path.addRect(1, 2, 4, 2, (SkPath::Direction) 0);
1337 testSimplifyx(path);
1338}
1339
caryclark@google.comc899ad92012-08-23 15:24:42 +00001340static void testLine68ax() {
1341 SkPath path;
1342 path.setFillType(SkPath::kEvenOdd_FillType);
1343 path.addRect(0, 0, 8, 8, (SkPath::Direction) 0);
1344 path.addRect(2, 2, 6, 6, (SkPath::Direction) 0);
1345 path.addRect(1, 2, 4, 2, (SkPath::Direction) 0);
1346 testSimplifyx(path);
1347}
1348
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001349static void testLine68b() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001350 SkPath path;
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001351 path.addRect(0, 0, 8, 8, (SkPath::Direction) 0);
1352 path.addRect(2, 2, 6, 6, (SkPath::Direction) 1);
1353 path.addRect(1, 2, 2, 2, (SkPath::Direction) 0);
1354 testSimplifyx(path);
1355}
1356
caryclark@google.comc899ad92012-08-23 15:24:42 +00001357static void testLine68bx() {
1358 SkPath path;
1359 path.setFillType(SkPath::kEvenOdd_FillType);
1360 path.addRect(0, 0, 8, 8, (SkPath::Direction) 0);
1361 path.addRect(2, 2, 6, 6, (SkPath::Direction) 1);
1362 path.addRect(1, 2, 2, 2, (SkPath::Direction) 0);
1363 testSimplifyx(path);
1364}
1365
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001366static void testLine68c() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001367 SkPath path;
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001368 path.addRect(0, 0, 8, 8, (SkPath::Direction) 1);
1369 path.addRect(2, 2, 6, 6, (SkPath::Direction) 0);
1370 path.addRect(1, 2, 4, 2, (SkPath::Direction) 0);
1371 testSimplifyx(path);
1372}
1373
caryclark@google.comc899ad92012-08-23 15:24:42 +00001374static void testLine68cx() {
1375 SkPath path;
1376 path.setFillType(SkPath::kEvenOdd_FillType);
1377 path.addRect(0, 0, 8, 8, (SkPath::Direction) 1);
1378 path.addRect(2, 2, 6, 6, (SkPath::Direction) 0);
1379 path.addRect(1, 2, 4, 2, (SkPath::Direction) 0);
1380 testSimplifyx(path);
1381}
1382
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001383static void testLine68d() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001384 SkPath path;
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001385 path.addRect(0, 0, 8, 8, (SkPath::Direction) 1);
1386 path.addRect(2, 2, 6, 6, (SkPath::Direction) 1);
1387 path.addRect(1, 2, 4, 2, (SkPath::Direction) 0);
1388 testSimplifyx(path);
1389}
1390
caryclark@google.comc899ad92012-08-23 15:24:42 +00001391static void testLine68dx() {
1392 SkPath path;
1393 path.setFillType(SkPath::kEvenOdd_FillType);
1394 path.addRect(0, 0, 8, 8, (SkPath::Direction) 1);
1395 path.addRect(2, 2, 6, 6, (SkPath::Direction) 1);
1396 path.addRect(1, 2, 4, 2, (SkPath::Direction) 0);
1397 testSimplifyx(path);
1398}
1399
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001400static void testLine68e() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001401 SkPath path;
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001402 path.addRect(0, 0, 8, 8, (SkPath::Direction) 0);
1403 path.addRect(0, 0, 8, 8, (SkPath::Direction) 0);
1404 path.addRect(2, 2, 6, 6, (SkPath::Direction) 1);
1405 path.addRect(1, 2, 2, 2, (SkPath::Direction) 0);
1406 testSimplifyx(path);
1407}
1408
caryclark@google.comc899ad92012-08-23 15:24:42 +00001409static void testLine68ex() {
1410 SkPath path;
1411 path.setFillType(SkPath::kEvenOdd_FillType);
1412 path.addRect(0, 0, 8, 8, (SkPath::Direction) 0);
1413 path.addRect(0, 0, 8, 8, (SkPath::Direction) 0);
1414 path.addRect(2, 2, 6, 6, (SkPath::Direction) 1);
1415 path.addRect(1, 2, 2, 2, (SkPath::Direction) 0);
1416 testSimplifyx(path);
1417}
1418
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001419static void testLine68f() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001420 SkPath path;
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001421 path.addRect(0, 0, 8, 8, (SkPath::Direction) 0);
1422 path.addRect(2, 2, 6, 6, (SkPath::Direction) 1);
1423 path.addRect(2, 2, 6, 6, (SkPath::Direction) 1);
1424 path.addRect(1, 2, 2, 2, (SkPath::Direction) 0);
1425 testSimplifyx(path);
1426}
1427
caryclark@google.comc899ad92012-08-23 15:24:42 +00001428static void testLine68fx() {
1429 SkPath path;
1430 path.setFillType(SkPath::kEvenOdd_FillType);
1431 path.addRect(0, 0, 8, 8, (SkPath::Direction) 0);
1432 path.addRect(2, 2, 6, 6, (SkPath::Direction) 1);
1433 path.addRect(2, 2, 6, 6, (SkPath::Direction) 1);
1434 path.addRect(1, 2, 2, 2, (SkPath::Direction) 0);
1435 testSimplifyx(path);
1436}
1437
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001438static void testLine68g() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001439 SkPath path;
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001440 path.addRect(0, 0, 8, 8, (SkPath::Direction) 0);
1441 path.addRect(0, 0, 8, 8, (SkPath::Direction) 0);
1442 path.addRect(2, 2, 6, 6, (SkPath::Direction) 1);
1443 path.addRect(2, 2, 6, 6, (SkPath::Direction) 1);
1444 path.addRect(1, 2, 2, 2, (SkPath::Direction) 0);
1445 testSimplifyx(path);
1446}
1447
caryclark@google.comc899ad92012-08-23 15:24:42 +00001448static void testLine68gx() {
1449 SkPath path;
1450 path.setFillType(SkPath::kEvenOdd_FillType);
1451 path.addRect(0, 0, 8, 8, (SkPath::Direction) 0);
1452 path.addRect(0, 0, 8, 8, (SkPath::Direction) 0);
1453 path.addRect(2, 2, 6, 6, (SkPath::Direction) 1);
1454 path.addRect(2, 2, 6, 6, (SkPath::Direction) 1);
1455 path.addRect(1, 2, 2, 2, (SkPath::Direction) 0);
1456 testSimplifyx(path);
1457}
1458
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001459static void testLine68h() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001460 SkPath path;
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001461 path.addRect(0, 0, 8, 8, (SkPath::Direction) 0);
1462 path.addRect(2, 2, 6, 6, (SkPath::Direction) 1);
1463 path.addRect(2, 2, 6, 6, (SkPath::Direction) 1);
1464 path.addRect(2, 2, 6, 6, (SkPath::Direction) 1);
1465 path.addRect(1, 2, 2, 2, (SkPath::Direction) 0);
1466 testSimplifyx(path);
1467}
1468
caryclark@google.comc899ad92012-08-23 15:24:42 +00001469static void testLine68hx() {
1470 SkPath path;
1471 path.setFillType(SkPath::kEvenOdd_FillType);
1472 path.addRect(0, 0, 8, 8, (SkPath::Direction) 0);
1473 path.addRect(2, 2, 6, 6, (SkPath::Direction) 1);
1474 path.addRect(2, 2, 6, 6, (SkPath::Direction) 1);
1475 path.addRect(2, 2, 6, 6, (SkPath::Direction) 1);
1476 path.addRect(1, 2, 2, 2, (SkPath::Direction) 0);
1477 testSimplifyx(path);
1478}
1479
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001480static void testLine69() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001481 SkPath path;
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001482 path.addRect(0, 20, 20, 20, (SkPath::Direction) 0);
1483 path.addRect(0, 20, 12, 30, (SkPath::Direction) 0);
1484 path.addRect(12, 32, 21, 36, (SkPath::Direction) 0);
1485 testSimplifyx(path);
1486}
1487
caryclark@google.comc899ad92012-08-23 15:24:42 +00001488static void testLine69x() {
1489 SkPath path;
1490 path.setFillType(SkPath::kEvenOdd_FillType);
1491 path.addRect(0, 20, 20, 20, (SkPath::Direction) 0);
1492 path.addRect(0, 20, 12, 30, (SkPath::Direction) 0);
1493 path.addRect(12, 32, 21, 36, (SkPath::Direction) 0);
1494 testSimplifyx(path);
1495}
1496
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001497static void testLine70() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001498 SkPath path;
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001499 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
1500 path.addRect(0, 24, 12, 12, (SkPath::Direction) 0);
1501 path.addRect(12, 32, 21, 36, (SkPath::Direction) 1);
1502 testSimplifyx(path);
1503}
1504
caryclark@google.comc899ad92012-08-23 15:24:42 +00001505static void testLine70x() {
1506 SkPath path;
1507 path.setFillType(SkPath::kEvenOdd_FillType);
1508 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
1509 path.addRect(0, 24, 12, 12, (SkPath::Direction) 0);
1510 path.addRect(12, 32, 21, 36, (SkPath::Direction) 1);
1511 testSimplifyx(path);
1512}
1513
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001514static void testLine71() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001515 SkPath path;
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001516 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
1517 path.addRect(12, 0, 24, 24, (SkPath::Direction) 0);
1518 path.addRect(12, 32, 21, 36, (SkPath::Direction) 0);
1519 testSimplifyx(path);
1520}
1521
caryclark@google.comc899ad92012-08-23 15:24:42 +00001522static void testLine71x() {
1523 SkPath path;
1524 path.setFillType(SkPath::kEvenOdd_FillType);
1525 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
1526 path.addRect(12, 0, 24, 24, (SkPath::Direction) 0);
1527 path.addRect(12, 32, 21, 36, (SkPath::Direction) 0);
1528 testSimplifyx(path);
1529}
1530
caryclark@google.com200c2112012-08-03 15:05:04 +00001531static void testLine72() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001532 SkPath path;
caryclark@google.com200c2112012-08-03 15:05:04 +00001533 path.addRect(0, 0, 60, 60, (SkPath::Direction) 0);
1534 path.addRect(10, 40, 30, 30, (SkPath::Direction) 0);
1535 path.addRect(6, 20, 18, 30, (SkPath::Direction) 0);
1536 testSimplifyx(path);
1537}
1538
caryclark@google.comc899ad92012-08-23 15:24:42 +00001539static void testLine72x() {
1540 SkPath path;
1541 path.setFillType(SkPath::kEvenOdd_FillType);
1542 path.addRect(0, 0, 60, 60, (SkPath::Direction) 0);
1543 path.addRect(10, 40, 30, 30, (SkPath::Direction) 0);
1544 path.addRect(6, 20, 18, 30, (SkPath::Direction) 0);
1545 testSimplifyx(path);
1546}
1547
caryclark@google.com200c2112012-08-03 15:05:04 +00001548static void testLine73() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001549 SkPath path;
caryclark@google.com200c2112012-08-03 15:05:04 +00001550 path.addRect(0, 0, 60, 60, (SkPath::Direction) 0);
1551 path.addRect(0, 40, 20, 20, (SkPath::Direction) 0);
1552 path.addRect(0, 20, 12, 30, (SkPath::Direction) 0);
1553 path.addRect(0, 0, 9, 9, (SkPath::Direction) 1);
1554 testSimplifyx(path);
1555}
1556
caryclark@google.comc899ad92012-08-23 15:24:42 +00001557static void testLine73x() {
1558 SkPath path;
1559 path.setFillType(SkPath::kEvenOdd_FillType);
1560 path.addRect(0, 0, 60, 60, (SkPath::Direction) 0);
1561 path.addRect(0, 40, 20, 20, (SkPath::Direction) 0);
1562 path.addRect(0, 20, 12, 30, (SkPath::Direction) 0);
1563 path.addRect(0, 0, 9, 9, (SkPath::Direction) 1);
1564 testSimplifyx(path);
1565}
1566
caryclark@google.com0c803d02012-08-06 11:15:47 +00001567static void testLine74() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001568 SkPath path;
caryclark@google.com0c803d02012-08-06 11:15:47 +00001569 path.addRect(20, 30, 40, 40, (SkPath::Direction) 0);
1570 path.addRect(24, 20, 36, 30, (SkPath::Direction) 1);
1571 path.addRect(32, 24, 36, 41, (SkPath::Direction) 1);
1572 testSimplifyx(path);
1573}
1574
caryclark@google.comc899ad92012-08-23 15:24:42 +00001575static void testLine74x() {
1576 SkPath path;
1577 path.setFillType(SkPath::kEvenOdd_FillType);
1578 path.addRect(20, 30, 40, 40, (SkPath::Direction) 0);
1579 path.addRect(24, 20, 36, 30, (SkPath::Direction) 1);
1580 path.addRect(32, 24, 36, 41, (SkPath::Direction) 1);
1581 testSimplifyx(path);
1582}
1583
caryclark@google.com2ddff932012-08-07 21:25:27 +00001584static void testLine75() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001585 SkPath path;
caryclark@google.com2ddff932012-08-07 21:25:27 +00001586 path.addRect(0, 0, 60, 60, (SkPath::Direction) 0);
1587 path.addRect(10, 0, 30, 30, (SkPath::Direction) 1);
1588 path.addRect(18, 0, 30, 30, (SkPath::Direction) 1);
1589 path.addRect(12, 0, 21, 21, (SkPath::Direction) 1);
1590 testSimplifyx(path);
1591}
1592
caryclark@google.comc899ad92012-08-23 15:24:42 +00001593static void testLine75x() {
1594 SkPath path;
1595 path.setFillType(SkPath::kEvenOdd_FillType);
1596 path.addRect(0, 0, 60, 60, (SkPath::Direction) 0);
1597 path.addRect(10, 0, 30, 30, (SkPath::Direction) 1);
1598 path.addRect(18, 0, 30, 30, (SkPath::Direction) 1);
1599 path.addRect(12, 0, 21, 21, (SkPath::Direction) 1);
1600 testSimplifyx(path);
1601}
1602
caryclark@google.com2ddff932012-08-07 21:25:27 +00001603static void testLine76() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001604 SkPath path;
caryclark@google.com2ddff932012-08-07 21:25:27 +00001605 path.addRect(36, 0, 66, 60, (SkPath::Direction) 0);
1606 path.addRect(10, 20, 40, 30, (SkPath::Direction) 0);
1607 path.addRect(24, 20, 36, 30, (SkPath::Direction) 1);
1608 path.addRect(32, 6, 36, 41, (SkPath::Direction) 1);
1609 testSimplifyx(path);
1610}
1611
caryclark@google.comc899ad92012-08-23 15:24:42 +00001612static void testLine76x() {
1613 SkPath path;
1614 path.setFillType(SkPath::kEvenOdd_FillType);
1615 path.addRect(36, 0, 66, 60, (SkPath::Direction) 0);
1616 path.addRect(10, 20, 40, 30, (SkPath::Direction) 0);
1617 path.addRect(24, 20, 36, 30, (SkPath::Direction) 1);
1618 path.addRect(32, 6, 36, 41, (SkPath::Direction) 1);
1619 testSimplifyx(path);
1620}
1621
caryclark@google.com2ddff932012-08-07 21:25:27 +00001622static void testLine77() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001623 SkPath path;
caryclark@google.com2ddff932012-08-07 21:25:27 +00001624 path.addRect(20, 0, 40, 40, (SkPath::Direction) 0);
1625 path.addRect(24, 6, 36, 36, (SkPath::Direction) 1);
1626 path.addRect(24, 32, 33, 36, (SkPath::Direction) 1);
1627 testSimplifyx(path);
1628}
1629
caryclark@google.comc899ad92012-08-23 15:24:42 +00001630static void testLine77x() {
1631 SkPath path;
1632 path.setFillType(SkPath::kEvenOdd_FillType);
1633 path.addRect(20, 0, 40, 40, (SkPath::Direction) 0);
1634 path.addRect(24, 6, 36, 36, (SkPath::Direction) 1);
1635 path.addRect(24, 32, 33, 36, (SkPath::Direction) 1);
1636 testSimplifyx(path);
1637}
1638
caryclark@google.com2ddff932012-08-07 21:25:27 +00001639static void testLine78() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001640 SkPath path;
caryclark@google.com2ddff932012-08-07 21:25:27 +00001641 path.addRect(0, 0, 30, 60, (SkPath::Direction) 0);
1642 path.addRect(10, 20, 30, 30, (SkPath::Direction) 1);
1643 path.addRect(18, 20, 30, 30, (SkPath::Direction) 1);
1644 path.addRect(32, 0, 36, 41, (SkPath::Direction) 1);
1645 testSimplifyx(path);
1646}
1647
caryclark@google.comc899ad92012-08-23 15:24:42 +00001648static void testLine78x() {
1649 SkPath path;
1650 path.setFillType(SkPath::kEvenOdd_FillType);
1651 path.addRect(0, 0, 30, 60, (SkPath::Direction) 0);
1652 path.addRect(10, 20, 30, 30, (SkPath::Direction) 1);
1653 path.addRect(18, 20, 30, 30, (SkPath::Direction) 1);
1654 path.addRect(32, 0, 36, 41, (SkPath::Direction) 1);
1655 testSimplifyx(path);
1656}
1657
caryclark@google.com2ddff932012-08-07 21:25:27 +00001658static void testLine79() {
caryclark@google.com59823f72012-08-09 18:17:47 +00001659 SkPath path;
caryclark@google.com2ddff932012-08-07 21:25:27 +00001660 path.addRect(0, 36, 60, 30, (SkPath::Direction) 0);
1661 path.addRect(10, 30, 40, 30, (SkPath::Direction) 0);
1662 path.addRect(0, 20, 12, 30, (SkPath::Direction) 1);
1663 path.addRect(0, 32, 9, 36, (SkPath::Direction) 1);
1664 testSimplifyx(path);
1665}
1666
caryclark@google.comc899ad92012-08-23 15:24:42 +00001667static void testLine79x() {
1668 SkPath path;
1669 path.setFillType(SkPath::kEvenOdd_FillType);
1670 path.addRect(0, 36, 60, 30, (SkPath::Direction) 0);
1671 path.addRect(10, 30, 40, 30, (SkPath::Direction) 0);
1672 path.addRect(0, 20, 12, 30, (SkPath::Direction) 1);
1673 path.addRect(0, 32, 9, 36, (SkPath::Direction) 1);
1674 testSimplifyx(path);
1675}
1676
caryclark@google.com59823f72012-08-09 18:17:47 +00001677static void testDegenerate1() {
1678 SkPath path;
1679 path.moveTo(0, 0);
1680 path.lineTo(0, 0);
1681 path.lineTo(2, 0);
1682 path.close();
1683 path.moveTo(0, 0);
1684 path.lineTo(1, 0);
1685 path.lineTo(2, 0);
1686 path.close();
1687 testSimplifyx(path);
1688}
1689
caryclark@google.comc899ad92012-08-23 15:24:42 +00001690static void testDegenerate1x() {
1691 SkPath path;
1692 path.setFillType(SkPath::kEvenOdd_FillType);
1693 path.moveTo(0, 0);
1694 path.lineTo(0, 0);
1695 path.lineTo(2, 0);
1696 path.close();
1697 path.moveTo(0, 0);
1698 path.lineTo(1, 0);
1699 path.lineTo(2, 0);
1700 path.close();
1701 testSimplifyx(path);
1702}
1703
caryclark@google.com59823f72012-08-09 18:17:47 +00001704static void testDegenerate2() {
1705 SkPath path;
1706 path.moveTo(0, 0);
1707 path.lineTo(0, 0);
1708 path.lineTo(0, 0);
1709 path.close();
1710 path.moveTo(0, 0);
1711 path.lineTo(1, 0);
1712 path.lineTo(0, 1);
1713 path.close();
1714 testSimplifyx(path);
1715}
1716
caryclark@google.comc899ad92012-08-23 15:24:42 +00001717static void testDegenerate2x() {
1718 SkPath path;
1719 path.setFillType(SkPath::kEvenOdd_FillType);
1720 path.moveTo(0, 0);
1721 path.lineTo(0, 0);
1722 path.lineTo(0, 0);
1723 path.close();
1724 path.moveTo(0, 0);
1725 path.lineTo(1, 0);
1726 path.lineTo(0, 1);
1727 path.close();
1728 testSimplifyx(path);
1729}
1730
caryclark@google.com59823f72012-08-09 18:17:47 +00001731static void testDegenerate3() {
1732 SkPath path;
1733 path.moveTo(0, 0);
1734 path.lineTo(2, 0);
1735 path.lineTo(1, 0);
1736 path.close();
1737 path.moveTo(0, 0);
1738 path.lineTo(0, 0);
1739 path.lineTo(3, 0);
1740 path.close();
1741 testSimplifyx(path);
1742}
1743
caryclark@google.comc899ad92012-08-23 15:24:42 +00001744static void testDegenerate3x() {
1745 SkPath path;
1746 path.setFillType(SkPath::kEvenOdd_FillType);
1747 path.moveTo(0, 0);
1748 path.lineTo(2, 0);
1749 path.lineTo(1, 0);
1750 path.close();
1751 path.moveTo(0, 0);
1752 path.lineTo(0, 0);
1753 path.lineTo(3, 0);
1754 path.close();
1755 testSimplifyx(path);
1756}
1757
caryclark@google.com59823f72012-08-09 18:17:47 +00001758static void testDegenerate4() {
1759 SkPath path;
1760 path.moveTo(0, 0);
1761 path.lineTo(1, 0);
1762 path.lineTo(1, 3);
1763 path.close();
1764 path.moveTo(1, 0);
1765 path.lineTo(1, 1);
1766 path.lineTo(1, 2);
1767 path.close();
1768 testSimplifyx(path);
1769}
1770
caryclark@google.comc899ad92012-08-23 15:24:42 +00001771static void testDegenerate4x() {
1772 SkPath path;
1773 path.setFillType(SkPath::kEvenOdd_FillType);
1774 path.moveTo(0, 0);
1775 path.lineTo(1, 0);
1776 path.lineTo(1, 3);
1777 path.close();
1778 path.moveTo(1, 0);
1779 path.lineTo(1, 1);
1780 path.lineTo(1, 2);
1781 path.close();
1782 testSimplifyx(path);
1783}
1784
caryclark@google.com59823f72012-08-09 18:17:47 +00001785static void testNondegenerate1() {
1786 SkPath path;
1787 path.moveTo(0, 0);
1788 path.lineTo(3, 0);
1789 path.lineTo(1, 3);
1790 path.close();
1791 path.moveTo(1, 1);
1792 path.lineTo(2, 1);
1793 path.lineTo(1, 2);
1794 path.close();
1795 testSimplifyx(path);
1796}
1797
caryclark@google.comc899ad92012-08-23 15:24:42 +00001798static void testNondegenerate1x() {
1799 SkPath path;
1800 path.setFillType(SkPath::kEvenOdd_FillType);
1801 path.moveTo(0, 0);
1802 path.lineTo(3, 0);
1803 path.lineTo(1, 3);
1804 path.close();
1805 path.moveTo(1, 1);
1806 path.lineTo(2, 1);
1807 path.lineTo(1, 2);
1808 path.close();
1809 testSimplifyx(path);
1810}
1811
caryclark@google.com59823f72012-08-09 18:17:47 +00001812static void testNondegenerate2() {
1813 SkPath path;
1814 path.moveTo(1, 0);
1815 path.lineTo(0, 1);
1816 path.lineTo(1, 1);
1817 path.close();
1818 path.moveTo(0, 2);
1819 path.lineTo(0, 3);
1820 path.lineTo(1, 2);
1821 path.close();
1822 testSimplifyx(path);
1823}
1824
caryclark@google.comc899ad92012-08-23 15:24:42 +00001825static void testNondegenerate2x() {
1826 SkPath path;
1827 path.setFillType(SkPath::kEvenOdd_FillType);
1828 path.moveTo(1, 0);
1829 path.lineTo(0, 1);
1830 path.lineTo(1, 1);
1831 path.close();
1832 path.moveTo(0, 2);
1833 path.lineTo(0, 3);
1834 path.lineTo(1, 2);
1835 path.close();
1836 testSimplifyx(path);
1837}
1838
caryclark@google.com59823f72012-08-09 18:17:47 +00001839static void testNondegenerate3() {
1840 SkPath path;
1841 path.moveTo(0, 0);
1842 path.lineTo(1, 0);
1843 path.lineTo(2, 1);
1844 path.close();
1845 path.moveTo(0, 1);
1846 path.lineTo(1, 1);
1847 path.lineTo(0, 2);
1848 path.close();
1849 testSimplifyx(path);
1850}
1851
caryclark@google.comc899ad92012-08-23 15:24:42 +00001852static void testNondegenerate3x() {
1853 SkPath path;
1854 path.setFillType(SkPath::kEvenOdd_FillType);
1855 path.moveTo(0, 0);
1856 path.lineTo(1, 0);
1857 path.lineTo(2, 1);
1858 path.close();
1859 path.moveTo(0, 1);
1860 path.lineTo(1, 1);
1861 path.lineTo(0, 2);
1862 path.close();
1863 testSimplifyx(path);
1864}
1865
caryclark@google.com59823f72012-08-09 18:17:47 +00001866static void testNondegenerate4() {
1867 SkPath path;
1868 path.moveTo(1, 0);
1869 path.lineTo(0, 1);
1870 path.lineTo(1, 2);
1871 path.close();
1872 path.moveTo(0, 2);
1873 path.lineTo(0, 3);
1874 path.lineTo(1, 3);
1875 path.close();
1876 testSimplifyx(path);
1877}
1878
caryclark@google.comc899ad92012-08-23 15:24:42 +00001879static void testNondegenerate4x() {
1880 SkPath path;
1881 path.setFillType(SkPath::kEvenOdd_FillType);
1882 path.moveTo(1, 0);
1883 path.lineTo(0, 1);
1884 path.lineTo(1, 2);
1885 path.close();
1886 path.moveTo(0, 2);
1887 path.lineTo(0, 3);
1888 path.lineTo(1, 3);
1889 path.close();
1890 testSimplifyx(path);
1891}
1892
caryclark@google.com59823f72012-08-09 18:17:47 +00001893static void testQuadralateral5() {
1894 SkPath path;
1895 path.moveTo(0, 0);
1896 path.lineTo(0, 0);
1897 path.lineTo(1, 0);
1898 path.lineTo(1, 1);
1899 path.close();
1900 path.moveTo(0, 0);
1901 path.lineTo(2, 2);
1902 path.lineTo(3, 2);
1903 path.lineTo(3, 3);
1904 path.close();
1905 testSimplifyx(path);
1906}
1907
caryclark@google.comc899ad92012-08-23 15:24:42 +00001908static void testQuadralateral5x() {
1909 SkPath path;
1910 path.setFillType(SkPath::kEvenOdd_FillType);
1911 path.moveTo(0, 0);
1912 path.lineTo(0, 0);
1913 path.lineTo(1, 0);
1914 path.lineTo(1, 1);
1915 path.close();
1916 path.moveTo(0, 0);
1917 path.lineTo(2, 2);
1918 path.lineTo(3, 2);
1919 path.lineTo(3, 3);
1920 path.close();
1921 testSimplifyx(path);
1922}
1923
caryclark@google.com59823f72012-08-09 18:17:47 +00001924static void testQuadralateral6() {
1925 SkPath path;
1926 path.moveTo(0, 0);
1927 path.lineTo(0, 0);
1928 path.lineTo(1, 0);
1929 path.lineTo(1, 1);
1930 path.close();
1931 path.moveTo(1, 0);
1932 path.lineTo(2, 0);
1933 path.lineTo(0, 2);
1934 path.lineTo(2, 2);
1935 path.close();
1936 testSimplifyx(path);
1937}
1938
caryclark@google.comc899ad92012-08-23 15:24:42 +00001939static void testQuadralateral6x() {
1940 SkPath path;
1941 path.setFillType(SkPath::kEvenOdd_FillType);
1942 path.moveTo(0, 0);
1943 path.lineTo(0, 0);
1944 path.lineTo(1, 0);
1945 path.lineTo(1, 1);
1946 path.close();
1947 path.moveTo(1, 0);
1948 path.lineTo(2, 0);
1949 path.lineTo(0, 2);
1950 path.lineTo(2, 2);
1951 path.close();
1952 testSimplifyx(path);
1953}
1954
caryclark@google.com24bec792012-08-20 12:43:57 +00001955static void testFauxQuadralateral6() {
1956 SkPath path;
1957 path.moveTo(0, 0);
1958 path.lineTo(1, 0);
1959 path.lineTo(1, 1);
1960 path.close();
1961 path.moveTo(1, 0);
1962 path.lineTo(2, 0);
1963 path.lineTo(1 + 1.0f/3, 2.0f/3);
1964 path.close();
1965 path.moveTo(1 + 1.0f/3, 2.0f/3);
1966 path.lineTo(0, 2);
1967 path.lineTo(2, 2);
1968 path.close();
1969 testSimplifyx(path);
1970}
1971
caryclark@google.comc899ad92012-08-23 15:24:42 +00001972static void testFauxQuadralateral6x() {
1973 SkPath path;
1974 path.setFillType(SkPath::kEvenOdd_FillType);
1975 path.moveTo(0, 0);
1976 path.lineTo(1, 0);
1977 path.lineTo(1, 1);
1978 path.close();
1979 path.moveTo(1, 0);
1980 path.lineTo(2, 0);
1981 path.lineTo(1 + 1.0f/3, 2.0f/3);
1982 path.close();
1983 path.moveTo(1 + 1.0f/3, 2.0f/3);
1984 path.lineTo(0, 2);
1985 path.lineTo(2, 2);
1986 path.close();
1987 testSimplifyx(path);
1988}
1989
caryclark@google.com24bec792012-08-20 12:43:57 +00001990static void testFauxQuadralateral6a() {
1991 SkPath path;
1992 path.moveTo(0, 0);
1993 path.lineTo(3, 0);
1994 path.lineTo(3, 3);
1995 path.close();
1996 path.moveTo(3, 0);
1997 path.lineTo(6, 0);
1998 path.lineTo(4, 2);
1999 path.close();
2000 path.moveTo(4, 2);
2001 path.lineTo(0, 6);
2002 path.lineTo(6, 6);
2003 path.close();
2004 testSimplifyx(path);
2005}
2006
caryclark@google.comc899ad92012-08-23 15:24:42 +00002007static void testFauxQuadralateral6ax() {
2008 SkPath path;
2009 path.setFillType(SkPath::kEvenOdd_FillType);
2010 path.moveTo(0, 0);
2011 path.lineTo(3, 0);
2012 path.lineTo(3, 3);
2013 path.close();
2014 path.moveTo(3, 0);
2015 path.lineTo(6, 0);
2016 path.lineTo(4, 2);
2017 path.close();
2018 path.moveTo(4, 2);
2019 path.lineTo(0, 6);
2020 path.lineTo(6, 6);
2021 path.close();
2022 testSimplifyx(path);
2023}
2024
caryclark@google.com24bec792012-08-20 12:43:57 +00002025static void testFauxQuadralateral6b() {
2026 SkPath path;
2027 path.moveTo(0, 0);
2028 path.lineTo(3, 0);
2029 path.lineTo(3, 3);
2030 path.close();
2031 path.moveTo(3, 0);
2032 path.lineTo(6, 0);
2033 path.lineTo(4, 2);
2034 path.close();
2035 path.moveTo(4, 2);
2036 path.lineTo(6, 6);
2037 path.lineTo(0, 6);
2038 path.close();
2039 testSimplifyx(path);
2040}
2041
caryclark@google.comc899ad92012-08-23 15:24:42 +00002042static void testFauxQuadralateral6bx() {
2043 SkPath path;
2044 path.setFillType(SkPath::kEvenOdd_FillType);
2045 path.moveTo(0, 0);
2046 path.lineTo(3, 0);
2047 path.lineTo(3, 3);
2048 path.close();
2049 path.moveTo(3, 0);
2050 path.lineTo(6, 0);
2051 path.lineTo(4, 2);
2052 path.close();
2053 path.moveTo(4, 2);
2054 path.lineTo(6, 6);
2055 path.lineTo(0, 6);
2056 path.close();
2057 testSimplifyx(path);
2058}
2059
caryclark@google.com24bec792012-08-20 12:43:57 +00002060static void testFauxQuadralateral6c() {
2061 SkPath path;
2062 path.moveTo(0, 0);
2063 path.lineTo(3, 3);
2064 path.lineTo(3, 0);
2065 path.close();
2066 path.moveTo(3, 0);
2067 path.lineTo(6, 0);
2068 path.lineTo(4, 2);
2069 path.close();
2070 path.moveTo(4, 2);
2071 path.lineTo(0, 6);
2072 path.lineTo(6, 6);
2073 path.close();
2074 testSimplifyx(path);
2075}
2076
caryclark@google.comc899ad92012-08-23 15:24:42 +00002077static void testFauxQuadralateral6cx() {
2078 SkPath path;
2079 path.setFillType(SkPath::kEvenOdd_FillType);
2080 path.moveTo(0, 0);
2081 path.lineTo(3, 3);
2082 path.lineTo(3, 0);
2083 path.close();
2084 path.moveTo(3, 0);
2085 path.lineTo(6, 0);
2086 path.lineTo(4, 2);
2087 path.close();
2088 path.moveTo(4, 2);
2089 path.lineTo(0, 6);
2090 path.lineTo(6, 6);
2091 path.close();
2092 testSimplifyx(path);
2093}
2094
caryclark@google.com24bec792012-08-20 12:43:57 +00002095static void testFauxQuadralateral6d() {
2096 SkPath path;
2097 path.moveTo(0, 0);
2098 path.lineTo(3, 3);
2099 path.lineTo(3, 0);
2100 path.close();
2101 path.moveTo(3, 0);
2102 path.lineTo(6, 0);
2103 path.lineTo(4, 2);
2104 path.close();
2105 path.moveTo(4, 2);
2106 path.lineTo(6, 6);
2107 path.lineTo(0, 6);
2108 path.close();
2109 testSimplifyx(path);
2110}
2111
caryclark@google.comc899ad92012-08-23 15:24:42 +00002112static void testFauxQuadralateral6dx() {
2113 SkPath path;
2114 path.setFillType(SkPath::kEvenOdd_FillType);
2115 path.moveTo(0, 0);
2116 path.lineTo(3, 3);
2117 path.lineTo(3, 0);
2118 path.close();
2119 path.moveTo(3, 0);
2120 path.lineTo(6, 0);
2121 path.lineTo(4, 2);
2122 path.close();
2123 path.moveTo(4, 2);
2124 path.lineTo(6, 6);
2125 path.lineTo(0, 6);
2126 path.close();
2127 testSimplifyx(path);
2128}
2129
caryclark@google.com24bec792012-08-20 12:43:57 +00002130static void testQuadralateral6a() {
2131 SkPath path;
2132 path.moveTo(0, 0);
2133 path.lineTo(0, 0);
2134 path.lineTo(3, 0);
2135 path.lineTo(3, 3);
2136 path.close();
2137 path.moveTo(3, 0);
2138 path.lineTo(6, 0);
2139 path.lineTo(0, 6);
2140 path.lineTo(6, 6);
2141 path.close();
2142 testSimplifyx(path);
2143}
2144
caryclark@google.comc899ad92012-08-23 15:24:42 +00002145static void testQuadralateral6ax() {
2146 SkPath path;
2147 path.setFillType(SkPath::kEvenOdd_FillType);
2148 path.moveTo(0, 0);
2149 path.lineTo(0, 0);
2150 path.lineTo(3, 0);
2151 path.lineTo(3, 3);
2152 path.close();
2153 path.moveTo(3, 0);
2154 path.lineTo(6, 0);
2155 path.lineTo(0, 6);
2156 path.lineTo(6, 6);
2157 path.close();
2158 testSimplifyx(path);
2159}
2160
caryclark@google.com24bec792012-08-20 12:43:57 +00002161static void testQuadralateral7() {
2162 SkPath path;
2163 path.moveTo(0, 0);
2164 path.lineTo(0, 0);
2165 path.lineTo(1, 0);
2166 path.lineTo(2, 1);
2167 path.close();
2168 path.moveTo(1, 0);
2169 path.lineTo(1, 1);
2170 path.lineTo(2, 2);
2171 path.lineTo(1, 3);
2172 path.close();
2173 testSimplifyx(path);
2174}
2175
caryclark@google.comc899ad92012-08-23 15:24:42 +00002176static void testQuadralateral7x() {
2177 SkPath path;
2178 path.setFillType(SkPath::kEvenOdd_FillType);
2179 path.moveTo(0, 0);
2180 path.lineTo(0, 0);
2181 path.lineTo(1, 0);
2182 path.lineTo(2, 1);
2183 path.close();
2184 path.moveTo(1, 0);
2185 path.lineTo(1, 1);
2186 path.lineTo(2, 2);
2187 path.lineTo(1, 3);
2188 path.close();
2189 testSimplifyx(path);
2190}
2191
caryclark@google.com24bec792012-08-20 12:43:57 +00002192static void testQuadralateral8() {
2193 SkPath path;
2194 path.moveTo(0, 0);
2195 path.lineTo(3, 1);
2196 path.lineTo(1, 3);
2197 path.lineTo(3, 3);
2198 path.close();
2199 path.moveTo(2, 1);
2200 path.lineTo(0, 2);
2201 path.lineTo(3, 2);
2202 path.lineTo(2, 3);
2203 path.close();
2204 testSimplifyx(path);
2205}
2206
caryclark@google.comc899ad92012-08-23 15:24:42 +00002207static void testQuadralateral8x() {
2208 SkPath path;
2209 path.setFillType(SkPath::kEvenOdd_FillType);
2210 path.moveTo(0, 0);
2211 path.lineTo(3, 1);
2212 path.lineTo(1, 3);
2213 path.lineTo(3, 3);
2214 path.close();
2215 path.moveTo(2, 1);
2216 path.lineTo(0, 2);
2217 path.lineTo(3, 2);
2218 path.lineTo(2, 3);
2219 path.close();
2220 testSimplifyx(path);
2221}
2222
caryclark@google.com24bec792012-08-20 12:43:57 +00002223static void testQuadralateral9() {
2224 SkPath path;
2225 path.moveTo(0, 0);
2226 path.lineTo(1, 0);
2227 path.lineTo(1, 2);
2228 path.lineTo(2, 2);
2229 path.close();
2230 path.moveTo(1, 1);
2231 path.lineTo(2, 1);
2232 path.lineTo(1, 3);
2233 path.lineTo(2, 3);
2234 path.close();
2235 testSimplifyx(path);
2236}
2237
caryclark@google.comc899ad92012-08-23 15:24:42 +00002238static void testQuadralateral9x() {
2239 SkPath path;
2240 path.setFillType(SkPath::kEvenOdd_FillType);
2241 path.moveTo(0, 0);
2242 path.lineTo(1, 0);
2243 path.lineTo(1, 2);
2244 path.lineTo(2, 2);
2245 path.close();
2246 path.moveTo(1, 1);
2247 path.lineTo(2, 1);
2248 path.lineTo(1, 3);
2249 path.lineTo(2, 3);
2250 path.close();
2251 testSimplifyx(path);
2252}
2253
2254static void testLine1ax() {
caryclark@google.com24bec792012-08-20 12:43:57 +00002255 SkPath path;
2256 path.setFillType(SkPath::kEvenOdd_FillType);
2257 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
2258 path.addRect(4, 0, 13, 13, (SkPath::Direction) 0);
2259 testSimplifyx(path);
2260}
2261
caryclark@google.comc899ad92012-08-23 15:24:42 +00002262static void testLine2ax() {
caryclark@google.com24bec792012-08-20 12:43:57 +00002263 SkPath path;
2264 path.setFillType(SkPath::kEvenOdd_FillType);
2265 path.addRect(0, 20, 20, 20, (SkPath::Direction) 0);
2266 path.addRect(0, 20, 12, 30, (SkPath::Direction) 0);
2267 path.addRect(12, 0, 21, 21, (SkPath::Direction) 1);
2268 testSimplifyx(path);
2269}
2270
caryclark@google.comc899ad92012-08-23 15:24:42 +00002271static void testLine3aax() {
caryclark@google.com24bec792012-08-20 12:43:57 +00002272 SkPath path;
2273 path.setFillType(SkPath::kEvenOdd_FillType);
2274 path.addRect(10, 30, 30, 30, (SkPath::Direction) 0);
2275 path.addRect(18, 20, 30, 30, (SkPath::Direction) 1);
2276 path.addRect(0, 32, 9, 36, (SkPath::Direction) 1);
2277 testSimplifyx(path);
2278}
2279
caryclark@google.comc899ad92012-08-23 15:24:42 +00002280static void testLine4ax() {
caryclark@google.com24bec792012-08-20 12:43:57 +00002281 SkPath path;
2282 path.setFillType(SkPath::kEvenOdd_FillType);
2283 path.addRect(10, 30, 30, 30, (SkPath::Direction) 0);
2284 path.addRect(24, 20, 36, 30, (SkPath::Direction) 1);
2285 path.addRect(0, 32, 9, 36, (SkPath::Direction) 1);
2286 testSimplifyx(path);
2287}
2288
2289static void testQuadratic1() {
2290 SkPath path;
2291 path.moveTo(0, 0);
2292 path.quadTo(0, 0, 0, 0);
2293 path.lineTo(1, 0);
2294 path.close();
2295 path.moveTo(0, 0);
2296 path.lineTo(0, 0);
2297 path.quadTo(0, 0, 0, 0);
2298 path.close();
2299 testSimplifyx(path);
2300}
2301
caryclark@google.comc899ad92012-08-23 15:24:42 +00002302static void testQuadratic1x() {
2303 SkPath path;
2304 path.setFillType(SkPath::kEvenOdd_FillType);
2305 path.moveTo(0, 0);
2306 path.quadTo(0, 0, 0, 0);
2307 path.lineTo(1, 0);
2308 path.close();
2309 path.moveTo(0, 0);
2310 path.lineTo(0, 0);
2311 path.quadTo(0, 0, 0, 0);
2312 path.close();
2313 testSimplifyx(path);
2314}
2315
caryclark@google.com24bec792012-08-20 12:43:57 +00002316static void testQuadratic2() {
2317 SkPath path;
2318 path.moveTo(0, 0);
2319 path.quadTo(0, 0, 0, 0);
2320 path.lineTo(3, 0);
2321 path.close();
2322 path.moveTo(0, 0);
2323 path.lineTo(0, 0);
2324 path.quadTo(1, 0, 0, 1);
2325 path.close();
2326 testSimplifyx(path);
2327}
2328
caryclark@google.comc899ad92012-08-23 15:24:42 +00002329static void testQuadratic2x() {
2330 SkPath path;
2331 path.setFillType(SkPath::kEvenOdd_FillType);
2332 path.moveTo(0, 0);
2333 path.quadTo(0, 0, 0, 0);
2334 path.lineTo(3, 0);
2335 path.close();
2336 path.moveTo(0, 0);
2337 path.lineTo(0, 0);
2338 path.quadTo(1, 0, 0, 1);
2339 path.close();
2340 testSimplifyx(path);
2341}
2342
caryclark@google.com03f97062012-08-21 13:13:52 +00002343static void testQuadratic3() {
2344 SkPath path;
2345 path.moveTo(0, 0);
2346 path.quadTo(0, 0, 1, 0);
2347 path.lineTo(0, 2);
2348 path.close();
2349 path.moveTo(0, 0);
2350 path.lineTo(0, 0);
2351 path.quadTo(1, 0, 0, 1);
2352 path.close();
2353 testSimplifyx(path);
2354}
2355
caryclark@google.comc899ad92012-08-23 15:24:42 +00002356static void testQuadratic3x() {
2357 SkPath path;
2358 path.setFillType(SkPath::kEvenOdd_FillType);
2359 path.moveTo(0, 0);
2360 path.quadTo(0, 0, 1, 0);
2361 path.lineTo(0, 2);
2362 path.close();
2363 path.moveTo(0, 0);
2364 path.lineTo(0, 0);
2365 path.quadTo(1, 0, 0, 1);
2366 path.close();
2367 testSimplifyx(path);
2368}
2369
2370static void testQuadratic4() {
2371 SkPath path;
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, 2);
2379 path.close();
2380 testSimplifyx(path);
2381}
2382
2383static void testQuadratic4x() {
2384 SkPath path;
2385 path.setFillType(SkPath::kEvenOdd_FillType);
2386 path.moveTo(0, 0);
2387 path.quadTo(0, 0, 1, 0);
2388 path.lineTo(0, 2);
2389 path.close();
2390 path.moveTo(0, 0);
2391 path.lineTo(0, 0);
2392 path.quadTo(1, 0, 0, 2);
2393 path.close();
2394 testSimplifyx(path);
2395}
2396
2397static void testQuadratic5() {
2398 SkPath path;
2399 path.moveTo(0, 0);
2400 path.quadTo(0, 0, 0, 0);
2401 path.lineTo(0, 1);
2402 path.close();
2403 path.moveTo(0, 0);
2404 path.lineTo(1, 0);
2405 path.quadTo(0, 1, 0, 2);
2406 path.close();
2407 testSimplifyx(path);
2408}
2409
2410static void testQuadratic6() {
2411 SkPath path;
2412 path.moveTo(0, 0);
2413 path.quadTo(0, 0, 1, 0);
2414 path.lineTo(2, 1);
2415 path.close();
2416 path.moveTo(0, 0);
2417 path.lineTo(0, 0);
2418 path.quadTo(2, 0, 0, 1);
2419 path.close();
2420 testSimplifyx(path);
2421}
2422
2423static void testQuadratic7() {
2424 SkPath path;
2425 path.moveTo(0, 0);
2426 path.quadTo(0, 0, 1, 0);
2427 path.lineTo(3, 1);
2428 path.close();
2429 path.moveTo(0, 0);
2430 path.lineTo(0, 0);
2431 path.quadTo(3, 0, 1, 2);
2432 path.close();
2433 testSimplifyx(path);
2434}
2435
2436static void testQuadratic8() {
2437 SkPath path;
2438 path.moveTo(0, 0);
2439 path.quadTo(0, 0, 1, 0);
2440 path.lineTo(0, 2);
2441 path.close();
2442 path.moveTo(0, 0);
2443 path.lineTo(1, 0);
2444 path.quadTo(0, 1, 1, 2);
2445 path.close();
2446 testSimplifyx(path);
2447}
2448
2449static void testQuadratic9() {
2450 SkPath path;
2451 path.moveTo(0, 0);
2452 path.quadTo(0, 0, 1, 0);
2453 path.lineTo(3, 1);
2454 path.close();
2455 path.moveTo(0, 0);
2456 path.lineTo(1, 0);
2457 path.quadTo(1, 2, 3, 2);
2458 path.close();
2459 testSimplifyx(path);
2460}
2461
2462static void testQuadratic14() {
2463 SkPath path;
2464 path.moveTo(0, 0);
2465 path.quadTo(0, 0, 1, 0);
2466 path.lineTo(3, 2);
2467 path.close();
2468 path.moveTo(0, 0);
2469 path.lineTo(1, 0);
2470 path.quadTo(3, 2, 3, 3);
2471 path.close();
2472 testSimplifyx(path);
2473}
2474
caryclark@google.com3350c3c2012-08-24 15:24:36 +00002475static void testQuadratic15() {
2476 SkPath path;
2477 path.moveTo(0, 0);
2478 path.quadTo(0, 0, 1, 0);
2479 path.lineTo(1, 3);
2480 path.close();
2481 path.moveTo(1, 0);
2482 path.lineTo(0, 1);
2483 path.quadTo(1, 1, 0, 3);
2484 path.close();
2485 testSimplifyx(path);
2486}
2487
2488static void testQuadratic17x() {
2489 SkPath path;
2490 path.setFillType(SkPath::kEvenOdd_FillType);
2491 path.moveTo(0, 0);
2492 path.quadTo(0, 0, 3, 1);
2493 path.lineTo(0, 2);
2494 path.close();
2495 path.moveTo(0, 0);
2496 path.lineTo(1, 0);
2497 path.quadTo(3, 1, 0, 2);
2498 path.close();
2499 testSimplifyx(path);
2500}
2501
2502static void testQuadratic18() {
2503 SkPath path;
2504 path.moveTo(0, 0);
2505 path.quadTo(1, 0, 0, 1);
2506 path.lineTo(0, 1);
2507 path.close();
2508 path.moveTo(0, 0);
2509 path.lineTo(0, 0);
2510 path.quadTo(1, 0, 1, 1);
2511 path.close();
2512 testSimplifyx(path);
2513}
2514
caryclark@google.coma7e483d2012-08-28 20:44:43 +00002515static void testQuadratic19() {
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(2, 0, 0, 1);
2524 path.close();
2525 testSimplifyx(path);
2526}
2527
caryclark@google.com32546db2012-08-31 20:55:07 +00002528static void testQuadratic20() {
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(1, 0, 0, 1);
2537 path.close();
2538 testSimplifyx(path);
2539}
2540
2541static void (*firstTest)() = 0; // testQuadratic20;
caryclark@google.com8dcf1142012-07-02 20:27:02 +00002542
2543static struct {
2544 void (*fun)();
2545 const char* str;
2546} tests[] = {
caryclark@google.com32546db2012-08-31 20:55:07 +00002547 TEST(testQuadratic20),
caryclark@google.coma7e483d2012-08-28 20:44:43 +00002548 TEST(testQuadratic19),
caryclark@google.com3350c3c2012-08-24 15:24:36 +00002549 TEST(testQuadratic18),
2550 TEST(testQuadratic17x),
2551 TEST(testQuadratic15),
caryclark@google.comc899ad92012-08-23 15:24:42 +00002552 TEST(testQuadratic14),
2553 TEST(testQuadratic9),
2554 TEST(testQuadratic8),
2555 TEST(testQuadratic7),
2556 TEST(testQuadratic6),
2557 TEST(testQuadratic5),
2558 TEST(testQuadratic4x),
2559 TEST(testQuadratic3x),
2560 TEST(testQuadratic2x),
2561 TEST(testQuadratic1x),
2562 TEST(testQuadratic4),
caryclark@google.com03f97062012-08-21 13:13:52 +00002563 TEST(testQuadratic3),
caryclark@google.com24bec792012-08-20 12:43:57 +00002564 TEST(testQuadratic2),
2565 TEST(testQuadratic1),
caryclark@google.comc899ad92012-08-23 15:24:42 +00002566 TEST(testLine4ax),
2567 TEST(testLine3aax),
2568 TEST(testLine2ax),
2569 TEST(testLine1ax),
2570 TEST(testQuadralateral9x),
2571 TEST(testQuadralateral8x),
2572 TEST(testQuadralateral7x),
2573 TEST(testQuadralateral6x),
2574 TEST(testQuadralateral6ax),
caryclark@google.com24bec792012-08-20 12:43:57 +00002575 TEST(testQuadralateral9),
2576 TEST(testQuadralateral8),
2577 TEST(testQuadralateral7),
caryclark@google.com59823f72012-08-09 18:17:47 +00002578 TEST(testQuadralateral6),
caryclark@google.com24bec792012-08-20 12:43:57 +00002579 TEST(testQuadralateral6a),
caryclark@google.comc899ad92012-08-23 15:24:42 +00002580 TEST(testFauxQuadralateral6dx),
2581 TEST(testFauxQuadralateral6cx),
2582 TEST(testFauxQuadralateral6bx),
2583 TEST(testFauxQuadralateral6ax),
2584 TEST(testFauxQuadralateral6x),
caryclark@google.com24bec792012-08-20 12:43:57 +00002585 TEST(testFauxQuadralateral6d),
2586 TEST(testFauxQuadralateral6c),
2587 TEST(testFauxQuadralateral6b),
2588 TEST(testFauxQuadralateral6a),
2589 TEST(testFauxQuadralateral6),
caryclark@google.comc899ad92012-08-23 15:24:42 +00002590 TEST(testQuadralateral5x),
caryclark@google.com59823f72012-08-09 18:17:47 +00002591 TEST(testQuadralateral5),
caryclark@google.comc899ad92012-08-23 15:24:42 +00002592 TEST(testNondegenerate4x),
2593 TEST(testNondegenerate3x),
2594 TEST(testNondegenerate2x),
2595 TEST(testNondegenerate1x),
caryclark@google.com59823f72012-08-09 18:17:47 +00002596 TEST(testNondegenerate4),
2597 TEST(testNondegenerate3),
2598 TEST(testNondegenerate2),
2599 TEST(testNondegenerate1),
caryclark@google.comc899ad92012-08-23 15:24:42 +00002600 TEST(testDegenerate4x),
2601 TEST(testDegenerate3x),
2602 TEST(testDegenerate2x),
2603 TEST(testDegenerate1x),
caryclark@google.com59823f72012-08-09 18:17:47 +00002604 TEST(testDegenerate4),
2605 TEST(testDegenerate3),
2606 TEST(testDegenerate2),
2607 TEST(testDegenerate1),
caryclark@google.comc899ad92012-08-23 15:24:42 +00002608 TEST(testLine79x),
2609 TEST(testLine78x),
2610 TEST(testLine77x),
2611 TEST(testLine76x),
2612 TEST(testLine75x),
2613 TEST(testLine74x),
2614 TEST(testLine73x),
2615 TEST(testLine72x),
2616 TEST(testLine71x),
2617 TEST(testLine70x),
2618 TEST(testLine69x),
2619 TEST(testLine68hx),
2620 TEST(testLine68gx),
2621 TEST(testLine68fx),
2622 TEST(testLine68ex),
2623 TEST(testLine68dx),
2624 TEST(testLine68cx),
2625 TEST(testLine68bx),
2626 TEST(testLine68ax),
2627 TEST(testLine67x),
2628 TEST(testLine66x),
2629 TEST(testLine65x),
2630 TEST(testLine64x),
2631 TEST(testLine63x),
2632 TEST(testLine62x),
2633 TEST(testLine61x),
2634 TEST(testLine60x),
2635 TEST(testLine59x),
2636 TEST(testLine58x),
2637 TEST(testLine57x),
2638 TEST(testLine56x),
2639 TEST(testLine55x),
2640 TEST(testLine54x),
2641 TEST(testLine53x),
2642 TEST(testLine52x),
2643 TEST(testLine51x),
2644 TEST(testLine50x),
2645 TEST(testLine49x),
2646 TEST(testLine48x),
2647 TEST(testLine47x),
2648 TEST(testLine46x),
2649 TEST(testLine45x),
2650 TEST(testLine44x),
2651 TEST(testLine43x),
2652 TEST(testLine42x),
2653 TEST(testLine41x),
2654 TEST(testLine40x),
2655 TEST(testLine38x),
2656 TEST(testLine37x),
2657 TEST(testLine36x),
2658 TEST(testLine35x),
2659 TEST(testLine34x),
2660 TEST(testLine33x),
2661 TEST(testLine32x),
2662 TEST(testLine31x),
2663 TEST(testLine30x),
2664 TEST(testLine29x),
2665 TEST(testLine28x),
2666 TEST(testLine27x),
2667 TEST(testLine26x),
2668 TEST(testLine25x),
2669 TEST(testLine24ax),
2670 TEST(testLine24x),
2671 TEST(testLine23x),
2672 TEST(testLine22x),
2673 TEST(testLine21x),
2674 TEST(testLine20x),
2675 TEST(testLine19x),
2676 TEST(testLine18x),
2677 TEST(testLine17x),
2678 TEST(testLine16x),
2679 TEST(testLine15x),
2680 TEST(testLine14x),
2681 TEST(testLine13x),
2682 TEST(testLine12x),
2683 TEST(testLine11x),
2684 TEST(testLine10ax),
2685 TEST(testLine10x),
2686 TEST(testLine9x),
2687 TEST(testLine8x),
2688 TEST(testLine7bx),
2689 TEST(testLine7ax),
2690 TEST(testLine7x),
2691 TEST(testLine6x),
2692 TEST(testLine5x),
2693 TEST(testLine4x),
2694 TEST(testLine3bx),
2695 TEST(testLine3ax),
2696 TEST(testLine3x),
2697 TEST(testLine2x),
2698 TEST(testLine1x),
caryclark@google.com2ddff932012-08-07 21:25:27 +00002699 TEST(testLine79),
2700 TEST(testLine78),
2701 TEST(testLine77),
2702 TEST(testLine76),
2703 TEST(testLine75),
caryclark@google.com0c803d02012-08-06 11:15:47 +00002704 TEST(testLine74),
caryclark@google.com200c2112012-08-03 15:05:04 +00002705 TEST(testLine73),
2706 TEST(testLine72),
caryclark@google.com534aa5b2012-08-02 20:08:21 +00002707 TEST(testLine71),
2708 TEST(testLine70),
2709 TEST(testLine69),
2710 TEST(testLine68h),
2711 TEST(testLine68g),
2712 TEST(testLine68f),
2713 TEST(testLine68e),
2714 TEST(testLine68d),
2715 TEST(testLine68c),
2716 TEST(testLine68b),
2717 TEST(testLine68a),
2718 TEST(testLine67),
caryclark@google.com27c449a2012-07-27 18:26:38 +00002719 TEST(testLine66),
2720 TEST(testLine65),
2721 TEST(testLine64),
2722 TEST(testLine63),
2723 TEST(testLine62),
2724 TEST(testLine61),
2725 TEST(testLine60),
caryclark@google.comcc905052012-07-25 20:59:42 +00002726 TEST(testLine59),
2727 TEST(testLine58),
caryclark@google.com18063442012-07-25 12:05:18 +00002728 TEST(testLine57),
2729 TEST(testLine56),
caryclark@google.come21cb182012-07-23 21:26:31 +00002730 TEST(testLine55),
2731 TEST(testLine54),
2732 TEST(testLine53),
2733 TEST(testLine52),
caryclark@google.com47580692012-07-23 12:14:49 +00002734 TEST(testLine51),
2735 TEST(testLine50),
2736 TEST(testLine49),
2737 TEST(testLine48),
2738 TEST(testLine47),
2739 TEST(testLine46),
2740 TEST(testLine45),
2741 TEST(testLine44),
2742 TEST(testLine43),
2743 TEST(testLine42),
2744 TEST(testLine41),
2745 TEST(testLine40),
2746 TEST(testLine38),
2747 TEST(testLine37),
2748 TEST(testLine36),
2749 TEST(testLine35),
2750 TEST(testLine34),
2751 TEST(testLine33),
2752 TEST(testLine32),
2753 TEST(testLine31),
2754 TEST(testLine30),
2755 TEST(testLine29),
2756 TEST(testLine28),
2757 TEST(testLine27),
2758 TEST(testLine26),
2759 TEST(testLine25),
caryclark@google.com8dcf1142012-07-02 20:27:02 +00002760 TEST(testLine24a),
2761 TEST(testLine24),
caryclark@google.com47580692012-07-23 12:14:49 +00002762 TEST(testLine23),
2763 TEST(testLine22),
2764 TEST(testLine21),
2765 TEST(testLine20),
2766 TEST(testLine19),
2767 TEST(testLine18),
2768 TEST(testLine17),
2769 TEST(testLine16),
2770 TEST(testLine15),
2771 TEST(testLine14),
2772 TEST(testLine13),
2773 TEST(testLine12),
2774 TEST(testLine11),
2775 TEST(testLine10a),
2776 TEST(testLine10),
2777 TEST(testLine9),
2778 TEST(testLine8),
2779 TEST(testLine7b),
2780 TEST(testLine7a),
2781 TEST(testLine7),
2782 TEST(testLine6),
2783 TEST(testLine5),
2784 TEST(testLine4),
caryclark@google.com534aa5b2012-08-02 20:08:21 +00002785 TEST(testLine3b),
2786 TEST(testLine3a),
caryclark@google.com47580692012-07-23 12:14:49 +00002787 TEST(testLine3),
2788 TEST(testLine2),
2789 TEST(testLine1),
caryclark@google.comaf46cff2012-05-22 21:12:00 +00002790};
2791
2792static const size_t testCount = sizeof(tests) / sizeof(tests[0]);
2793
caryclark@google.com534aa5b2012-08-02 20:08:21 +00002794static struct {
2795 void (*fun)();
2796 const char* str;
2797} subTests[] = {
caryclark@google.com24bec792012-08-20 12:43:57 +00002798 TEST(testQuadralateral6),
2799 TEST(testQuadralateral6a),
2800 TEST(testFauxQuadralateral6d),
2801 TEST(testFauxQuadralateral6c),
2802 TEST(testFauxQuadralateral6b),
2803 TEST(testFauxQuadralateral6a),
2804 TEST(testFauxQuadralateral6),
caryclark@google.com534aa5b2012-08-02 20:08:21 +00002805};
2806
2807static const size_t subTestCount = sizeof(subTests) / sizeof(subTests[0]);
2808
caryclark@google.comaf46cff2012-05-22 21:12:00 +00002809static bool skipAll = false;
caryclark@google.com534aa5b2012-08-02 20:08:21 +00002810static bool runSubTests = false;
caryclark@google.comaf46cff2012-05-22 21:12:00 +00002811
2812void SimplifyNew_Test() {
2813 if (skipAll) {
2814 return;
2815 }
caryclark@google.com47580692012-07-23 12:14:49 +00002816#ifdef SK_DEBUG
caryclark@google.com27c449a2012-07-27 18:26:38 +00002817 gDebugMaxWindSum = 4;
2818 gDebugMaxWindValue = 4;
caryclark@google.com534aa5b2012-08-02 20:08:21 +00002819 size_t index;
caryclark@google.com47580692012-07-23 12:14:49 +00002820#endif
caryclark@google.com534aa5b2012-08-02 20:08:21 +00002821 if (runSubTests) {
2822 index = subTestCount - 1;
2823 do {
2824 SkDebugf(" %s [%s]\n", __FUNCTION__, subTests[index].str);
2825 (*subTests[index].fun)();
2826 } while (index--);
2827 }
2828 index = testCount - 1;
caryclark@google.comaf46cff2012-05-22 21:12:00 +00002829 if (firstTest) {
caryclark@google.come21cb182012-07-23 21:26:31 +00002830 while (index > 0 && tests[index].fun != firstTest) {
2831 --index;
caryclark@google.comaf46cff2012-05-22 21:12:00 +00002832 }
caryclark@google.com24bec792012-08-20 12:43:57 +00002833 SkDebugf(" %s [%s]\n", __FUNCTION__, tests[index].str);
caryclark@google.com59823f72012-08-09 18:17:47 +00002834 (*tests[index].fun)();
caryclark@google.comaf46cff2012-05-22 21:12:00 +00002835 }
caryclark@google.com59823f72012-08-09 18:17:47 +00002836 index = testCount - 1;
caryclark@google.comaf46cff2012-05-22 21:12:00 +00002837 bool firstTestComplete = false;
caryclark@google.come21cb182012-07-23 21:26:31 +00002838 do {
2839 SkDebugf(" %s [%s]\n", __FUNCTION__, tests[index].str);
caryclark@google.com8dcf1142012-07-02 20:27:02 +00002840 (*tests[index].fun)();
caryclark@google.comaf46cff2012-05-22 21:12:00 +00002841 firstTestComplete = true;
caryclark@google.come21cb182012-07-23 21:26:31 +00002842 } while (index--);
caryclark@google.com47580692012-07-23 12:14:49 +00002843#ifdef SK_DEBUG
2844 gDebugMaxWindSum = SK_MaxS32;
2845 gDebugMaxWindValue = SK_MaxS32;
2846#endif
caryclark@google.comaf46cff2012-05-22 21:12:00 +00002847}