blob: 5be846b1321f8f2ba2aea4b16bd011b2de936396 [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.com7fce0de2012-11-29 14:31:50 +0000449 path.addRect(0, 0, 9, 9, SkPath::kCW_Direction);
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000450 testSimplifyx(path);
451}
452
caryclark@google.comc899ad92012-08-23 15:24:42 +0000453static void testLine15x() {
454 SkPath path;
455 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000456 path.addRect(0, 0, 9, 9, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000457 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.com7fce0de2012-11-29 14:31:50 +0000462 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
463 path.addRect(0, 4, 9, 9, SkPath::kCW_Direction);
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000464 testSimplifyx(path);
465}
466
caryclark@google.comc899ad92012-08-23 15:24:42 +0000467static void testLine16x() {
468 SkPath path;
469 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000470 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
471 path.addRect(0, 4, 9, 9, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000472 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.com7fce0de2012-11-29 14:31:50 +0000477 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
478 path.addRect(4, 12, 13, 13, SkPath::kCW_Direction);
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000479 testSimplifyx(path);
480}
481
caryclark@google.comc899ad92012-08-23 15:24:42 +0000482static void testLine17x() {
483 SkPath path;
484 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000485 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
486 path.addRect(4, 12, 13, 13, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000487 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.com7fce0de2012-11-29 14:31:50 +0000492 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
493 path.addRect(12, 4, 21, 21, SkPath::kCW_Direction);
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000494 testSimplifyx(path);
495}
496
caryclark@google.comc899ad92012-08-23 15:24:42 +0000497static void testLine18x() {
498 SkPath path;
499 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000500 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
501 path.addRect(12, 4, 21, 21, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000502 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.com7fce0de2012-11-29 14:31:50 +0000507 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
508 path.addRect(12, 16, 21, 21, SkPath::kCW_Direction);
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);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000515 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
516 path.addRect(12, 16, 21, 21, SkPath::kCW_Direction);
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.com7fce0de2012-11-29 14:31:50 +0000522 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
523 path.addRect(0, 12, 9, 9, SkPath::kCW_Direction);
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000524 testSimplifyx(path);
525}
526
caryclark@google.comc899ad92012-08-23 15:24:42 +0000527static void testLine20x() {
528 SkPath path;
529 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000530 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
531 path.addRect(0, 12, 9, 9, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000532 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.com7fce0de2012-11-29 14:31:50 +0000537 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
538 path.addRect(0, 16, 9, 9, SkPath::kCW_Direction);
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000539 testSimplifyx(path);
540}
541
caryclark@google.comc899ad92012-08-23 15:24:42 +0000542static void testLine21x() {
543 SkPath path;
544 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000545 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
546 path.addRect(0, 16, 9, 9, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000547 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.com7fce0de2012-11-29 14:31:50 +0000552 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
553 path.addRect(4, 12, 13, 13, SkPath::kCW_Direction);
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000554 testSimplifyx(path);
555}
556
caryclark@google.comc899ad92012-08-23 15:24:42 +0000557static void testLine22x() {
558 SkPath path;
559 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000560 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
561 path.addRect(4, 12, 13, 13, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000562 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.com7fce0de2012-11-29 14:31:50 +0000567 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
568 path.addRect(12, 0, 21, 21, SkPath::kCW_Direction);
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000569 testSimplifyx(path);
570}
571
caryclark@google.comc899ad92012-08-23 15:24:42 +0000572static void testLine23x() {
573 SkPath path;
574 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000575 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
576 path.addRect(12, 0, 21, 21, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000577 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.com7fce0de2012-11-29 14:31:50 +0000609 path.addRect(0, 18, 12, 12, SkPath::kCW_Direction);
610 path.addRect(4, 12, 13, 13, SkPath::kCW_Direction);
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000611 testSimplifyx(path);
612}
613
caryclark@google.comc899ad92012-08-23 15:24:42 +0000614static void testLine24x() {
615 SkPath path;
616 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000617 path.addRect(0, 18, 12, 12, SkPath::kCW_Direction);
618 path.addRect(4, 12, 13, 13, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000619 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.com7fce0de2012-11-29 14:31:50 +0000624 path.addRect(0, 6, 12, 12, SkPath::kCW_Direction);
625 path.addRect(12, 0, 21, 21, SkPath::kCW_Direction);
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000626 testSimplifyx(path);
627}
628
caryclark@google.comc899ad92012-08-23 15:24:42 +0000629static void testLine25x() {
630 SkPath path;
631 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000632 path.addRect(0, 6, 12, 12, SkPath::kCW_Direction);
633 path.addRect(12, 0, 21, 21, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000634 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.com7fce0de2012-11-29 14:31:50 +0000639 path.addRect(0, 18, 12, 12, SkPath::kCW_Direction);
640 path.addRect(0, 12, 9, 9, SkPath::kCW_Direction);
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000641 testSimplifyx(path);
642}
643
caryclark@google.comc899ad92012-08-23 15:24:42 +0000644static void testLine26x() {
645 SkPath path;
646 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000647 path.addRect(0, 18, 12, 12, SkPath::kCW_Direction);
648 path.addRect(0, 12, 9, 9, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000649 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.com7fce0de2012-11-29 14:31:50 +0000654 path.addRect(0, 18, 12, 12, SkPath::kCW_Direction);
655 path.addRect(12, 8, 21, 21, SkPath::kCW_Direction);
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000656 testSimplifyx(path);
657}
658
caryclark@google.comc899ad92012-08-23 15:24:42 +0000659static void testLine27x() {
660 SkPath path;
661 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000662 path.addRect(0, 18, 12, 12, SkPath::kCW_Direction);
663 path.addRect(12, 8, 21, 21, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000664 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.com7fce0de2012-11-29 14:31:50 +0000669 path.addRect(0, 6, 12, 12, SkPath::kCW_Direction);
670 path.addRect(0, 0, 9, 9, SkPath::kCW_Direction);
caryclark@google.comfa4a6e92012-07-11 17:52:32 +0000671 testSimplifyx(path);
672}
673
caryclark@google.comc899ad92012-08-23 15:24:42 +0000674static void testLine28x() {
675 SkPath path;
676 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000677 path.addRect(0, 6, 12, 12, SkPath::kCW_Direction);
678 path.addRect(0, 0, 9, 9, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000679 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.com7fce0de2012-11-29 14:31:50 +0000684 path.addRect(0, 18, 12, 12, SkPath::kCW_Direction);
685 path.addRect(12, 12, 21, 21, SkPath::kCW_Direction);
caryclark@google.comfa4a6e92012-07-11 17:52:32 +0000686 testSimplifyx(path);
687}
688
caryclark@google.comc899ad92012-08-23 15:24:42 +0000689static void testLine29x() {
690 SkPath path;
691 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000692 path.addRect(0, 18, 12, 12, SkPath::kCW_Direction);
693 path.addRect(12, 12, 21, 21, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000694 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.com7fce0de2012-11-29 14:31:50 +0000699 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
700 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
701 path.addRect(4, 4, 13, 13, SkPath::kCW_Direction);
caryclark@google.comfa4a6e92012-07-11 17:52:32 +0000702 testSimplifyx(path);
703}
704
caryclark@google.comc899ad92012-08-23 15:24:42 +0000705static void testLine30x() {
706 SkPath path;
707 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000708 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
709 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
710 path.addRect(4, 4, 13, 13, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000711 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.com7fce0de2012-11-29 14:31:50 +0000716 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
717 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
718 path.addRect(0, 4, 9, 9, SkPath::kCW_Direction);
caryclark@google.comfa4a6e92012-07-11 17:52:32 +0000719 testSimplifyx(path);
720}
721
caryclark@google.comc899ad92012-08-23 15:24:42 +0000722static void testLine31x() {
723 SkPath path;
724 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000725 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
726 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
727 path.addRect(0, 4, 9, 9, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000728 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.com7fce0de2012-11-29 14:31:50 +0000733 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
734 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
735 path.addRect(4, 12, 13, 13, SkPath::kCW_Direction);
caryclark@google.comfa4a6e92012-07-11 17:52:32 +0000736 testSimplifyx(path);
737}
738
caryclark@google.comc899ad92012-08-23 15:24:42 +0000739static void testLine32x() {
740 SkPath path;
741 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000742 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
743 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
744 path.addRect(4, 12, 13, 13, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000745 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.com7fce0de2012-11-29 14:31:50 +0000750 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
751 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
752 path.addRect(4, 16, 13, 13, SkPath::kCW_Direction);
caryclark@google.com210acaf2012-07-12 21:05:13 +0000753 testSimplifyx(path);
754}
755
caryclark@google.comc899ad92012-08-23 15:24:42 +0000756static void testLine33x() {
757 SkPath path;
758 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000759 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
760 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
761 path.addRect(4, 16, 13, 13, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000762 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.com7fce0de2012-11-29 14:31:50 +0000767 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
768 path.addRect(0, 6, 12, 12, SkPath::kCW_Direction);
769 path.addRect(4, 12, 13, 13, SkPath::kCW_Direction);
caryclark@google.com210acaf2012-07-12 21:05:13 +0000770 testSimplifyx(path);
771}
772
caryclark@google.comc899ad92012-08-23 15:24:42 +0000773static void testLine34x() {
774 SkPath path;
775 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000776 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
777 path.addRect(0, 6, 12, 12, SkPath::kCW_Direction);
778 path.addRect(4, 12, 13, 13, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000779 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.com7fce0de2012-11-29 14:31:50 +0000784 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
785 path.addRect(6, 0, 18, 18, SkPath::kCW_Direction);
786 path.addRect(4, 16, 13, 13, SkPath::kCW_Direction);
caryclark@google.com210acaf2012-07-12 21:05:13 +0000787 testSimplifyx(path);
788}
789
caryclark@google.comc899ad92012-08-23 15:24:42 +0000790static void testLine35x() {
791 SkPath path;
792 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000793 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
794 path.addRect(6, 0, 18, 18, SkPath::kCW_Direction);
795 path.addRect(4, 16, 13, 13, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000796 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.com7fce0de2012-11-29 14:31:50 +0000801 path.addRect(0, 10, 20, 20, SkPath::kCW_Direction);
802 path.addRect(6, 12, 18, 18, SkPath::kCW_Direction);
803 path.addRect(4, 16, 13, 13, SkPath::kCW_Direction);
caryclark@google.com0e08a192012-07-13 21:07:52 +0000804 testSimplifyx(path);
805}
806
caryclark@google.comc899ad92012-08-23 15:24:42 +0000807static void testLine36x() {
808 SkPath path;
809 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000810 path.addRect(0, 10, 20, 20, SkPath::kCW_Direction);
811 path.addRect(6, 12, 18, 18, SkPath::kCW_Direction);
812 path.addRect(4, 16, 13, 13, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000813 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.com7fce0de2012-11-29 14:31:50 +0000818 path.addRect(0, 20, 20, 20, SkPath::kCW_Direction);
819 path.addRect(18, 24, 30, 30, SkPath::kCW_Direction);
820 path.addRect(0, 0, 9, 9, SkPath::kCW_Direction);
caryclark@google.com47580692012-07-23 12:14:49 +0000821 testSimplifyx(path);
822}
823
caryclark@google.comc899ad92012-08-23 15:24:42 +0000824static void testLine37x() {
825 SkPath path;
826 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000827 path.addRect(0, 20, 20, 20, SkPath::kCW_Direction);
828 path.addRect(18, 24, 30, 30, SkPath::kCW_Direction);
829 path.addRect(0, 0, 9, 9, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000830 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.com7fce0de2012-11-29 14:31:50 +0000835 path.addRect(10, 0, 30, 30, SkPath::kCW_Direction);
836 path.addRect(6, 12, 18, 18, SkPath::kCW_Direction);
837 path.addRect(12, 12, 21, 21, SkPath::kCW_Direction);
caryclark@google.com47580692012-07-23 12:14:49 +0000838 testSimplifyx(path);
839}
840
caryclark@google.comc899ad92012-08-23 15:24:42 +0000841static void testLine38x() {
842 SkPath path;
843 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000844 path.addRect(10, 0, 30, 30, SkPath::kCW_Direction);
845 path.addRect(6, 12, 18, 18, SkPath::kCW_Direction);
846 path.addRect(12, 12, 21, 21, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000847 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.com7fce0de2012-11-29 14:31:50 +0000852 path.addRect(10, 0, 30, 30, SkPath::kCW_Direction);
853 path.addRect(12, 18, 24, 24, SkPath::kCW_Direction);
854 path.addRect(4, 16, 13, 13, SkPath::kCW_Direction);
caryclark@google.com47580692012-07-23 12:14:49 +0000855 testSimplifyx(path);
856}
857
caryclark@google.comc899ad92012-08-23 15:24:42 +0000858static void testLine40x() {
859 SkPath path;
860 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000861 path.addRect(10, 0, 30, 30, SkPath::kCW_Direction);
862 path.addRect(12, 18, 24, 24, SkPath::kCW_Direction);
863 path.addRect(4, 16, 13, 13, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000864 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.com7fce0de2012-11-29 14:31:50 +0000869 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
870 path.addRect(18, 24, 30, 30, SkPath::kCW_Direction);
871 path.addRect(12, 0, 21, 21, SkPath::kCW_Direction);
caryclark@google.com47580692012-07-23 12:14:49 +0000872 testSimplifyx(path);
873}
874
caryclark@google.comc899ad92012-08-23 15:24:42 +0000875static void testLine41x() {
876 SkPath path;
877 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000878 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
879 path.addRect(18, 24, 30, 30, SkPath::kCW_Direction);
880 path.addRect(12, 0, 21, 21, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000881 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.com7fce0de2012-11-29 14:31:50 +0000886 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
887 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
888 path.addRect(8, 16, 17, 17, SkPath::kCW_Direction);
caryclark@google.com47580692012-07-23 12:14:49 +0000889 testSimplifyx(path);
890}
891
caryclark@google.comc899ad92012-08-23 15:24:42 +0000892static void testLine42x() {
893 SkPath path;
894 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000895 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
896 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
897 path.addRect(8, 16, 17, 17, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000898 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.com7fce0de2012-11-29 14:31:50 +0000903 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
904 path.addRect(6, 24, 18, 18, SkPath::kCW_Direction);
905 path.addRect(0, 32, 9, 36, SkPath::kCCW_Direction);
caryclark@google.com47580692012-07-23 12:14:49 +0000906 testSimplifyx(path);
907}
908
caryclark@google.comc899ad92012-08-23 15:24:42 +0000909static void testLine43x() {
910 SkPath path;
911 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000912 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
913 path.addRect(6, 24, 18, 18, SkPath::kCW_Direction);
914 path.addRect(0, 32, 9, 36, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000915 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.com7fce0de2012-11-29 14:31:50 +0000920 path.addRect(10, 40, 30, 30, SkPath::kCW_Direction);
921 path.addRect(18, 0, 30, 30, SkPath::kCW_Direction);
922 path.addRect(18, 32, 27, 36, SkPath::kCCW_Direction);
caryclark@google.com47580692012-07-23 12:14:49 +0000923 testSimplifyx(path);
924}
925
caryclark@google.comc899ad92012-08-23 15:24:42 +0000926static void testLine44x() {
927 SkPath path;
928 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000929 path.addRect(10, 40, 30, 30, SkPath::kCW_Direction);
930 path.addRect(18, 0, 30, 30, SkPath::kCW_Direction);
931 path.addRect(18, 32, 27, 36, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000932 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.com7fce0de2012-11-29 14:31:50 +0000937 path.addRect(10, 0, 30, 30, SkPath::kCW_Direction);
938 path.addRect(18, 0, 30, 30, SkPath::kCW_Direction);
939 path.addRect(24, 32, 33, 36, SkPath::kCW_Direction);
caryclark@google.com47580692012-07-23 12:14:49 +0000940 testSimplifyx(path);
941}
942
caryclark@google.comc899ad92012-08-23 15:24:42 +0000943static void testLine45x() {
944 SkPath path;
945 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000946 path.addRect(10, 0, 30, 30, SkPath::kCW_Direction);
947 path.addRect(18, 0, 30, 30, SkPath::kCW_Direction);
948 path.addRect(24, 32, 33, 36, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000949 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.com7fce0de2012-11-29 14:31:50 +0000954 path.addRect(10, 40, 30, 30, SkPath::kCW_Direction);
955 path.addRect(24, 0, 36, 36, SkPath::kCW_Direction);
956 path.addRect(24, 32, 33, 36, SkPath::kCW_Direction);
caryclark@google.com47580692012-07-23 12:14:49 +0000957 testSimplifyx(path);
958}
959
caryclark@google.comc899ad92012-08-23 15:24:42 +0000960static void testLine46x() {
961 SkPath path;
962 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000963 path.addRect(10, 40, 30, 30, SkPath::kCW_Direction);
964 path.addRect(24, 0, 36, 36, SkPath::kCW_Direction);
965 path.addRect(24, 32, 33, 36, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000966 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.com7fce0de2012-11-29 14:31:50 +0000971 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
972 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
973 path.addRect(0, 0, 9, 9, SkPath::kCCW_Direction);
caryclark@google.com47580692012-07-23 12:14:49 +0000974 testSimplifyx(path);
975}
976
caryclark@google.comc899ad92012-08-23 15:24:42 +0000977static void testLine47x() {
978 SkPath path;
979 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000980 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
981 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
982 path.addRect(0, 0, 9, 9, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +0000983 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.com7fce0de2012-11-29 14:31:50 +0000988 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
989 path.addRect(0, 6, 12, 12, SkPath::kCW_Direction);
990 path.addRect(0, 0, 9, 9, SkPath::kCCW_Direction);
caryclark@google.com47580692012-07-23 12:14:49 +0000991 testSimplifyx(path);
992}
993
caryclark@google.comc899ad92012-08-23 15:24:42 +0000994static void testLine48x() {
995 SkPath path;
996 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +0000997 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
998 path.addRect(0, 6, 12, 12, SkPath::kCW_Direction);
999 path.addRect(0, 0, 9, 9, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001000 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.com7fce0de2012-11-29 14:31:50 +00001005 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1006 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
1007 path.addRect(0, 0, 9, 9, SkPath::kCW_Direction);
caryclark@google.com47580692012-07-23 12:14:49 +00001008 testSimplifyx(path);
1009}
1010
caryclark@google.comc899ad92012-08-23 15:24:42 +00001011static void testLine49x() {
1012 SkPath path;
1013 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001014 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1015 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
1016 path.addRect(0, 0, 9, 9, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001017 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.com7fce0de2012-11-29 14:31:50 +00001022 path.addRect(10, 30, 30, 30, SkPath::kCW_Direction);
1023 path.addRect(24, 20, 36, 30, SkPath::kCW_Direction);
caryclark@google.com47580692012-07-23 12:14:49 +00001024 testSimplifyx(path);
1025}
1026
caryclark@google.comc899ad92012-08-23 15:24:42 +00001027static void testLine50x() {
1028 SkPath path;
1029 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001030 path.addRect(10, 30, 30, 30, SkPath::kCW_Direction);
1031 path.addRect(24, 20, 36, 30, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001032 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.com7fce0de2012-11-29 14:31:50 +00001037 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1038 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
1039 path.addRect(4, 12, 13, 13, SkPath::kCCW_Direction);
caryclark@google.com47580692012-07-23 12:14:49 +00001040 testSimplifyx(path);
1041}
1042
caryclark@google.comc899ad92012-08-23 15:24:42 +00001043static void testLine51x() {
1044 SkPath path;
1045 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001046 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1047 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
1048 path.addRect(4, 12, 13, 13, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001049 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.com7fce0de2012-11-29 14:31:50 +00001054 path.addRect(0, 30, 20, 20, SkPath::kCW_Direction);
1055 path.addRect(6, 20, 18, 30, SkPath::kCW_Direction);
1056 path.addRect(32, 0, 36, 41, SkPath::kCW_Direction);
caryclark@google.come21cb182012-07-23 21:26:31 +00001057 testSimplifyx(path);
1058}
1059
caryclark@google.comc899ad92012-08-23 15:24:42 +00001060static void testLine52x() {
1061 SkPath path;
1062 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001063 path.addRect(0, 30, 20, 20, SkPath::kCW_Direction);
1064 path.addRect(6, 20, 18, 30, SkPath::kCW_Direction);
1065 path.addRect(32, 0, 36, 41, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001066 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.com7fce0de2012-11-29 14:31:50 +00001071 path.addRect(10, 30, 30, 30, SkPath::kCW_Direction);
1072 path.addRect(12, 20, 24, 30, SkPath::kCW_Direction);
1073 path.addRect(12, 32, 21, 36, SkPath::kCCW_Direction);
caryclark@google.come21cb182012-07-23 21:26:31 +00001074 testSimplifyx(path);
1075}
1076
caryclark@google.comc899ad92012-08-23 15:24:42 +00001077static void testLine53x() {
1078 SkPath path;
1079 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001080 path.addRect(10, 30, 30, 30, SkPath::kCW_Direction);
1081 path.addRect(12, 20, 24, 30, SkPath::kCW_Direction);
1082 path.addRect(12, 32, 21, 36, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001083 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.com7fce0de2012-11-29 14:31:50 +00001088 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1089 path.addRect(6, 0, 18, 18, SkPath::kCW_Direction);
1090 path.addRect(8, 4, 17, 17, SkPath::kCCW_Direction);
caryclark@google.come21cb182012-07-23 21:26:31 +00001091 testSimplifyx(path);
1092}
1093
caryclark@google.comc899ad92012-08-23 15:24:42 +00001094static void testLine54x() {
1095 SkPath path;
1096 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001097 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1098 path.addRect(6, 0, 18, 18, SkPath::kCW_Direction);
1099 path.addRect(8, 4, 17, 17, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001100 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.com7fce0de2012-11-29 14:31:50 +00001105 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1106 path.addRect(6, 6, 18, 18, SkPath::kCW_Direction);
1107 path.addRect(4, 4, 13, 13, SkPath::kCCW_Direction);
caryclark@google.come21cb182012-07-23 21:26:31 +00001108 testSimplifyx(path);
1109}
1110
caryclark@google.comc899ad92012-08-23 15:24:42 +00001111static void testLine55x() {
1112 SkPath path;
1113 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001114 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1115 path.addRect(6, 6, 18, 18, SkPath::kCW_Direction);
1116 path.addRect(4, 4, 13, 13, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001117 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.com7fce0de2012-11-29 14:31:50 +00001122 path.addRect(0, 20, 20, 20, SkPath::kCW_Direction);
1123 path.addRect(18, 20, 30, 30, SkPath::kCW_Direction);
1124 path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction);
caryclark@google.com18063442012-07-25 12:05:18 +00001125 testSimplifyx(path);
1126}
1127
caryclark@google.comc899ad92012-08-23 15:24:42 +00001128static void testLine56x() {
1129 SkPath path;
1130 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001131 path.addRect(0, 20, 20, 20, SkPath::kCW_Direction);
1132 path.addRect(18, 20, 30, 30, SkPath::kCW_Direction);
1133 path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001134 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.com7fce0de2012-11-29 14:31:50 +00001139 path.addRect(20, 0, 40, 40, SkPath::kCW_Direction);
1140 path.addRect(20, 0, 30, 40, SkPath::kCW_Direction);
1141 path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction);
caryclark@google.com18063442012-07-25 12:05:18 +00001142 testSimplifyx(path);
1143}
1144
caryclark@google.comc899ad92012-08-23 15:24:42 +00001145static void testLine57x() {
1146 SkPath path;
1147 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001148 path.addRect(20, 0, 40, 40, SkPath::kCW_Direction);
1149 path.addRect(20, 0, 30, 40, SkPath::kCW_Direction);
1150 path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001151 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.com7fce0de2012-11-29 14:31:50 +00001156 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1157 path.addRect(0, 0, 12, 12, SkPath::kCCW_Direction);
1158 path.addRect(0, 12, 9, 9, SkPath::kCCW_Direction);
caryclark@google.comcc905052012-07-25 20:59:42 +00001159 testSimplifyx(path);
1160}
1161
caryclark@google.comc899ad92012-08-23 15:24:42 +00001162static void testLine58x() {
1163 SkPath path;
1164 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001165 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1166 path.addRect(0, 0, 12, 12, SkPath::kCCW_Direction);
1167 path.addRect(0, 12, 9, 9, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001168 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.com7fce0de2012-11-29 14:31:50 +00001173 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1174 path.addRect(6, 6, 18, 18, SkPath::kCCW_Direction);
1175 path.addRect(4, 4, 13, 13, SkPath::kCCW_Direction);
caryclark@google.comcc905052012-07-25 20:59:42 +00001176 testSimplifyx(path);
1177}
1178
caryclark@google.comc899ad92012-08-23 15:24:42 +00001179static void testLine59x() {
1180 SkPath path;
1181 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001182 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1183 path.addRect(6, 6, 18, 18, SkPath::kCCW_Direction);
1184 path.addRect(4, 4, 13, 13, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001185 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.com7fce0de2012-11-29 14:31:50 +00001190 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1191 path.addRect(6, 12, 18, 18, SkPath::kCCW_Direction);
1192 path.addRect(4, 12, 13, 13, SkPath::kCCW_Direction);
caryclark@google.com27c449a2012-07-27 18:26:38 +00001193 testSimplifyx(path);
1194}
1195
caryclark@google.comc899ad92012-08-23 15:24:42 +00001196static void testLine60x() {
1197 SkPath path;
1198 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001199 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1200 path.addRect(6, 12, 18, 18, SkPath::kCCW_Direction);
1201 path.addRect(4, 12, 13, 13, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001202 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.com7fce0de2012-11-29 14:31:50 +00001207 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1208 path.addRect(12, 0, 24, 24, SkPath::kCCW_Direction);
1209 path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction);
caryclark@google.com27c449a2012-07-27 18:26:38 +00001210 testSimplifyx(path);
1211}
1212
caryclark@google.comc899ad92012-08-23 15:24:42 +00001213static void testLine61x() {
1214 SkPath path;
1215 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001216 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1217 path.addRect(12, 0, 24, 24, SkPath::kCCW_Direction);
1218 path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001219 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.com7fce0de2012-11-29 14:31:50 +00001224 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1225 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1226 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
1227 path.addRect(4, 12, 13, 13, SkPath::kCCW_Direction);
caryclark@google.com27c449a2012-07-27 18:26:38 +00001228 testSimplifyx(path);
1229}
1230
caryclark@google.comc899ad92012-08-23 15:24:42 +00001231static void testLine62x() {
1232 SkPath path;
1233 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001234 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1235 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1236 path.addRect(0, 12, 12, 12, SkPath::kCW_Direction);
1237 path.addRect(4, 12, 13, 13, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001238 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.com7fce0de2012-11-29 14:31:50 +00001243 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1244 path.addRect(0, 10, 20, 20, SkPath::kCW_Direction);
1245 path.addRect(0, 6, 12, 12, SkPath::kCCW_Direction);
1246 path.addRect(0, 32, 9, 36, SkPath::kCCW_Direction);
caryclark@google.com27c449a2012-07-27 18:26:38 +00001247 testSimplifyx(path);
1248}
1249
caryclark@google.comc899ad92012-08-23 15:24:42 +00001250static void testLine63x() {
1251 SkPath path;
1252 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001253 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1254 path.addRect(0, 10, 20, 20, SkPath::kCW_Direction);
1255 path.addRect(0, 6, 12, 12, SkPath::kCCW_Direction);
1256 path.addRect(0, 32, 9, 36, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001257 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.com7fce0de2012-11-29 14:31:50 +00001262 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1263 path.addRect(10, 40, 30, 30, SkPath::kCW_Direction);
1264 path.addRect(18, 6, 30, 30, SkPath::kCW_Direction);
caryclark@google.com27c449a2012-07-27 18:26:38 +00001265 testSimplifyx(path);
1266}
1267
caryclark@google.comc899ad92012-08-23 15:24:42 +00001268static void testLine64x() {
1269 SkPath path;
1270 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001271 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1272 path.addRect(10, 40, 30, 30, SkPath::kCW_Direction);
1273 path.addRect(18, 6, 30, 30, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001274 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.com7fce0de2012-11-29 14:31:50 +00001279 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1280 path.addRect(10, 0, 30, 30, SkPath::kCW_Direction);
1281 path.addRect(24, 0, 36, 36, SkPath::kCW_Direction);
1282 path.addRect(32, 6, 36, 41, SkPath::kCCW_Direction);
caryclark@google.com27c449a2012-07-27 18:26:38 +00001283 testSimplifyx(path);
1284}
1285
caryclark@google.comc899ad92012-08-23 15:24:42 +00001286static void testLine65x() {
1287 SkPath path;
1288 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001289 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1290 path.addRect(10, 0, 30, 30, SkPath::kCW_Direction);
1291 path.addRect(24, 0, 36, 36, SkPath::kCW_Direction);
1292 path.addRect(32, 6, 36, 41, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001293 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.com7fce0de2012-11-29 14:31:50 +00001298 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1299 path.addRect(0, 30, 20, 20, SkPath::kCW_Direction);
1300 path.addRect(12, 20, 24, 30, SkPath::kCW_Direction);
caryclark@google.com27c449a2012-07-27 18:26:38 +00001301 testSimplifyx(path);
1302}
1303
caryclark@google.comc899ad92012-08-23 15:24:42 +00001304static void testLine66x() {
1305 SkPath path;
1306 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001307 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1308 path.addRect(0, 30, 20, 20, SkPath::kCW_Direction);
1309 path.addRect(12, 20, 24, 30, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001310 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.com7fce0de2012-11-29 14:31:50 +00001315 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1316 path.addRect(10, 40, 30, 30, SkPath::kCW_Direction);
1317 path.addRect(24, 20, 36, 30, SkPath::kCW_Direction);
1318 path.addRect(32, 0, 36, 41, SkPath::kCW_Direction);
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001319 testSimplifyx(path);
1320}
1321
caryclark@google.comc899ad92012-08-23 15:24:42 +00001322static void testLine67x() {
1323 SkPath path;
1324 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001325 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1326 path.addRect(10, 40, 30, 30, SkPath::kCW_Direction);
1327 path.addRect(24, 20, 36, 30, SkPath::kCW_Direction);
1328 path.addRect(32, 0, 36, 41, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001329 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.com7fce0de2012-11-29 14:31:50 +00001334 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1335 path.addRect(2, 2, 6, 6, SkPath::kCW_Direction);
1336 path.addRect(1, 2, 4, 2, SkPath::kCW_Direction);
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001337 testSimplifyx(path);
1338}
1339
caryclark@google.comc899ad92012-08-23 15:24:42 +00001340static void testLine68ax() {
1341 SkPath path;
1342 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001343 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1344 path.addRect(2, 2, 6, 6, SkPath::kCW_Direction);
1345 path.addRect(1, 2, 4, 2, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001346 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.com7fce0de2012-11-29 14:31:50 +00001351 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1352 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1353 path.addRect(1, 2, 2, 2, SkPath::kCW_Direction);
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001354 testSimplifyx(path);
1355}
1356
caryclark@google.comc899ad92012-08-23 15:24:42 +00001357static void testLine68bx() {
1358 SkPath path;
1359 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001360 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1361 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1362 path.addRect(1, 2, 2, 2, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001363 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.com7fce0de2012-11-29 14:31:50 +00001368 path.addRect(0, 0, 8, 8, SkPath::kCCW_Direction);
1369 path.addRect(2, 2, 6, 6, SkPath::kCW_Direction);
1370 path.addRect(1, 2, 4, 2, SkPath::kCW_Direction);
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001371 testSimplifyx(path);
1372}
1373
caryclark@google.comc899ad92012-08-23 15:24:42 +00001374static void testLine68cx() {
1375 SkPath path;
1376 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001377 path.addRect(0, 0, 8, 8, SkPath::kCCW_Direction);
1378 path.addRect(2, 2, 6, 6, SkPath::kCW_Direction);
1379 path.addRect(1, 2, 4, 2, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001380 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.com7fce0de2012-11-29 14:31:50 +00001385 path.addRect(0, 0, 8, 8, SkPath::kCCW_Direction);
1386 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1387 path.addRect(1, 2, 4, 2, SkPath::kCW_Direction);
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001388 testSimplifyx(path);
1389}
1390
caryclark@google.comc899ad92012-08-23 15:24:42 +00001391static void testLine68dx() {
1392 SkPath path;
1393 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001394 path.addRect(0, 0, 8, 8, SkPath::kCCW_Direction);
1395 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1396 path.addRect(1, 2, 4, 2, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001397 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.com7fce0de2012-11-29 14:31:50 +00001402 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1403 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1404 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1405 path.addRect(1, 2, 2, 2, SkPath::kCW_Direction);
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001406 testSimplifyx(path);
1407}
1408
caryclark@google.comc899ad92012-08-23 15:24:42 +00001409static void testLine68ex() {
1410 SkPath path;
1411 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001412 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1413 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1414 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1415 path.addRect(1, 2, 2, 2, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001416 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.com7fce0de2012-11-29 14:31:50 +00001421 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1422 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1423 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1424 path.addRect(1, 2, 2, 2, SkPath::kCW_Direction);
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001425 testSimplifyx(path);
1426}
1427
caryclark@google.comc899ad92012-08-23 15:24:42 +00001428static void testLine68fx() {
1429 SkPath path;
1430 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001431 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1432 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1433 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1434 path.addRect(1, 2, 2, 2, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001435 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.com7fce0de2012-11-29 14:31:50 +00001440 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1441 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1442 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1443 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1444 path.addRect(1, 2, 2, 2, SkPath::kCW_Direction);
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001445 testSimplifyx(path);
1446}
1447
caryclark@google.comc899ad92012-08-23 15:24:42 +00001448static void testLine68gx() {
1449 SkPath path;
1450 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001451 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1452 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1453 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1454 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1455 path.addRect(1, 2, 2, 2, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001456 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.com7fce0de2012-11-29 14:31:50 +00001461 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1462 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1463 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1464 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1465 path.addRect(1, 2, 2, 2, SkPath::kCW_Direction);
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001466 testSimplifyx(path);
1467}
1468
caryclark@google.comc899ad92012-08-23 15:24:42 +00001469static void testLine68hx() {
1470 SkPath path;
1471 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001472 path.addRect(0, 0, 8, 8, SkPath::kCW_Direction);
1473 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1474 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1475 path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction);
1476 path.addRect(1, 2, 2, 2, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001477 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.com7fce0de2012-11-29 14:31:50 +00001482 path.addRect(0, 20, 20, 20, SkPath::kCW_Direction);
1483 path.addRect(0, 20, 12, 30, SkPath::kCW_Direction);
1484 path.addRect(12, 32, 21, 36, SkPath::kCW_Direction);
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001485 testSimplifyx(path);
1486}
1487
caryclark@google.comc899ad92012-08-23 15:24:42 +00001488static void testLine69x() {
1489 SkPath path;
1490 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001491 path.addRect(0, 20, 20, 20, SkPath::kCW_Direction);
1492 path.addRect(0, 20, 12, 30, SkPath::kCW_Direction);
1493 path.addRect(12, 32, 21, 36, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001494 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.com7fce0de2012-11-29 14:31:50 +00001499 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1500 path.addRect(0, 24, 12, 12, SkPath::kCW_Direction);
1501 path.addRect(12, 32, 21, 36, SkPath::kCCW_Direction);
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001502 testSimplifyx(path);
1503}
1504
caryclark@google.comc899ad92012-08-23 15:24:42 +00001505static void testLine70x() {
1506 SkPath path;
1507 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001508 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1509 path.addRect(0, 24, 12, 12, SkPath::kCW_Direction);
1510 path.addRect(12, 32, 21, 36, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001511 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.com7fce0de2012-11-29 14:31:50 +00001516 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1517 path.addRect(12, 0, 24, 24, SkPath::kCW_Direction);
1518 path.addRect(12, 32, 21, 36, SkPath::kCW_Direction);
caryclark@google.com534aa5b2012-08-02 20:08:21 +00001519 testSimplifyx(path);
1520}
1521
caryclark@google.comc899ad92012-08-23 15:24:42 +00001522static void testLine71x() {
1523 SkPath path;
1524 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001525 path.addRect(0, 0, 20, 20, SkPath::kCW_Direction);
1526 path.addRect(12, 0, 24, 24, SkPath::kCW_Direction);
1527 path.addRect(12, 32, 21, 36, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001528 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.com7fce0de2012-11-29 14:31:50 +00001533 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1534 path.addRect(10, 40, 30, 30, SkPath::kCW_Direction);
1535 path.addRect(6, 20, 18, 30, SkPath::kCW_Direction);
caryclark@google.com200c2112012-08-03 15:05:04 +00001536 testSimplifyx(path);
1537}
1538
caryclark@google.comc899ad92012-08-23 15:24:42 +00001539static void testLine72x() {
1540 SkPath path;
1541 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001542 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1543 path.addRect(10, 40, 30, 30, SkPath::kCW_Direction);
1544 path.addRect(6, 20, 18, 30, SkPath::kCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001545 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.com7fce0de2012-11-29 14:31:50 +00001550 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1551 path.addRect(0, 40, 20, 20, SkPath::kCW_Direction);
1552 path.addRect(0, 20, 12, 30, SkPath::kCW_Direction);
1553 path.addRect(0, 0, 9, 9, SkPath::kCCW_Direction);
caryclark@google.com200c2112012-08-03 15:05:04 +00001554 testSimplifyx(path);
1555}
1556
caryclark@google.comc899ad92012-08-23 15:24:42 +00001557static void testLine73x() {
1558 SkPath path;
1559 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001560 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1561 path.addRect(0, 40, 20, 20, SkPath::kCW_Direction);
1562 path.addRect(0, 20, 12, 30, SkPath::kCW_Direction);
1563 path.addRect(0, 0, 9, 9, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001564 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.com7fce0de2012-11-29 14:31:50 +00001569 path.addRect(20, 30, 40, 40, SkPath::kCW_Direction);
1570 path.addRect(24, 20, 36, 30, SkPath::kCCW_Direction);
1571 path.addRect(32, 24, 36, 41, SkPath::kCCW_Direction);
caryclark@google.com0c803d02012-08-06 11:15:47 +00001572 testSimplifyx(path);
1573}
1574
caryclark@google.comc899ad92012-08-23 15:24:42 +00001575static void testLine74x() {
1576 SkPath path;
1577 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001578 path.addRect(20, 30, 40, 40, SkPath::kCW_Direction);
1579 path.addRect(24, 20, 36, 30, SkPath::kCCW_Direction);
1580 path.addRect(32, 24, 36, 41, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001581 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.com7fce0de2012-11-29 14:31:50 +00001586 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1587 path.addRect(10, 0, 30, 30, SkPath::kCCW_Direction);
1588 path.addRect(18, 0, 30, 30, SkPath::kCCW_Direction);
1589 path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction);
caryclark@google.com2ddff932012-08-07 21:25:27 +00001590 testSimplifyx(path);
1591}
1592
caryclark@google.comc899ad92012-08-23 15:24:42 +00001593static void testLine75x() {
1594 SkPath path;
1595 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001596 path.addRect(0, 0, 60, 60, SkPath::kCW_Direction);
1597 path.addRect(10, 0, 30, 30, SkPath::kCCW_Direction);
1598 path.addRect(18, 0, 30, 30, SkPath::kCCW_Direction);
1599 path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001600 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.com7fce0de2012-11-29 14:31:50 +00001605 path.addRect(36, 0, 66, 60, SkPath::kCW_Direction);
1606 path.addRect(10, 20, 40, 30, SkPath::kCW_Direction);
1607 path.addRect(24, 20, 36, 30, SkPath::kCCW_Direction);
1608 path.addRect(32, 6, 36, 41, SkPath::kCCW_Direction);
caryclark@google.com2ddff932012-08-07 21:25:27 +00001609 testSimplifyx(path);
1610}
1611
caryclark@google.comc899ad92012-08-23 15:24:42 +00001612static void testLine76x() {
1613 SkPath path;
1614 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001615 path.addRect(36, 0, 66, 60, SkPath::kCW_Direction);
1616 path.addRect(10, 20, 40, 30, SkPath::kCW_Direction);
1617 path.addRect(24, 20, 36, 30, SkPath::kCCW_Direction);
1618 path.addRect(32, 6, 36, 41, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001619 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.com7fce0de2012-11-29 14:31:50 +00001624 path.addRect(20, 0, 40, 40, SkPath::kCW_Direction);
1625 path.addRect(24, 6, 36, 36, SkPath::kCCW_Direction);
1626 path.addRect(24, 32, 33, 36, SkPath::kCCW_Direction);
caryclark@google.com2ddff932012-08-07 21:25:27 +00001627 testSimplifyx(path);
1628}
1629
caryclark@google.comc899ad92012-08-23 15:24:42 +00001630static void testLine77x() {
1631 SkPath path;
1632 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001633 path.addRect(20, 0, 40, 40, SkPath::kCW_Direction);
1634 path.addRect(24, 6, 36, 36, SkPath::kCCW_Direction);
1635 path.addRect(24, 32, 33, 36, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001636 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.com7fce0de2012-11-29 14:31:50 +00001641 path.addRect(0, 0, 30, 60, SkPath::kCW_Direction);
1642 path.addRect(10, 20, 30, 30, SkPath::kCCW_Direction);
1643 path.addRect(18, 20, 30, 30, SkPath::kCCW_Direction);
1644 path.addRect(32, 0, 36, 41, SkPath::kCCW_Direction);
caryclark@google.com2ddff932012-08-07 21:25:27 +00001645 testSimplifyx(path);
1646}
1647
caryclark@google.comc899ad92012-08-23 15:24:42 +00001648static void testLine78x() {
1649 SkPath path;
1650 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001651 path.addRect(0, 0, 30, 60, SkPath::kCW_Direction);
1652 path.addRect(10, 20, 30, 30, SkPath::kCCW_Direction);
1653 path.addRect(18, 20, 30, 30, SkPath::kCCW_Direction);
1654 path.addRect(32, 0, 36, 41, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001655 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.com7fce0de2012-11-29 14:31:50 +00001660 path.addRect(0, 36, 60, 30, SkPath::kCW_Direction);
1661 path.addRect(10, 30, 40, 30, SkPath::kCW_Direction);
1662 path.addRect(0, 20, 12, 30, SkPath::kCCW_Direction);
1663 path.addRect(0, 32, 9, 36, SkPath::kCCW_Direction);
caryclark@google.com2ddff932012-08-07 21:25:27 +00001664 testSimplifyx(path);
1665}
1666
caryclark@google.comc899ad92012-08-23 15:24:42 +00001667static void testLine79x() {
1668 SkPath path;
1669 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00001670 path.addRect(0, 36, 60, 30, SkPath::kCW_Direction);
1671 path.addRect(10, 30, 40, 30, SkPath::kCW_Direction);
1672 path.addRect(0, 20, 12, 30, SkPath::kCCW_Direction);
1673 path.addRect(0, 32, 9, 36, SkPath::kCCW_Direction);
1674 testSimplifyx(path);
1675}
1676
1677static void testLine81() {
1678 SkPath path;
1679 path.addRect(-1, -1, 3, 3, SkPath::kCW_Direction);
1680 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
1681 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
1682 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
1683 path.addRect(1, 1, 2, 2, SkPath::kCCW_Direction);
caryclark@google.comc899ad92012-08-23 15:24:42 +00001684 testSimplifyx(path);
1685}
1686
caryclark@google.com59823f72012-08-09 18:17:47 +00001687static void testDegenerate1() {
1688 SkPath path;
1689 path.moveTo(0, 0);
1690 path.lineTo(0, 0);
1691 path.lineTo(2, 0);
1692 path.close();
1693 path.moveTo(0, 0);
1694 path.lineTo(1, 0);
1695 path.lineTo(2, 0);
1696 path.close();
1697 testSimplifyx(path);
1698}
1699
caryclark@google.comc899ad92012-08-23 15:24:42 +00001700static void testDegenerate1x() {
1701 SkPath path;
1702 path.setFillType(SkPath::kEvenOdd_FillType);
1703 path.moveTo(0, 0);
1704 path.lineTo(0, 0);
1705 path.lineTo(2, 0);
1706 path.close();
1707 path.moveTo(0, 0);
1708 path.lineTo(1, 0);
1709 path.lineTo(2, 0);
1710 path.close();
1711 testSimplifyx(path);
1712}
1713
caryclark@google.com59823f72012-08-09 18:17:47 +00001714static void testDegenerate2() {
1715 SkPath path;
1716 path.moveTo(0, 0);
1717 path.lineTo(0, 0);
1718 path.lineTo(0, 0);
1719 path.close();
1720 path.moveTo(0, 0);
1721 path.lineTo(1, 0);
1722 path.lineTo(0, 1);
1723 path.close();
1724 testSimplifyx(path);
1725}
1726
caryclark@google.comc899ad92012-08-23 15:24:42 +00001727static void testDegenerate2x() {
1728 SkPath path;
1729 path.setFillType(SkPath::kEvenOdd_FillType);
1730 path.moveTo(0, 0);
1731 path.lineTo(0, 0);
1732 path.lineTo(0, 0);
1733 path.close();
1734 path.moveTo(0, 0);
1735 path.lineTo(1, 0);
1736 path.lineTo(0, 1);
1737 path.close();
1738 testSimplifyx(path);
1739}
1740
caryclark@google.com59823f72012-08-09 18:17:47 +00001741static void testDegenerate3() {
1742 SkPath path;
1743 path.moveTo(0, 0);
1744 path.lineTo(2, 0);
1745 path.lineTo(1, 0);
1746 path.close();
1747 path.moveTo(0, 0);
1748 path.lineTo(0, 0);
1749 path.lineTo(3, 0);
1750 path.close();
1751 testSimplifyx(path);
1752}
1753
caryclark@google.comc899ad92012-08-23 15:24:42 +00001754static void testDegenerate3x() {
1755 SkPath path;
1756 path.setFillType(SkPath::kEvenOdd_FillType);
1757 path.moveTo(0, 0);
1758 path.lineTo(2, 0);
1759 path.lineTo(1, 0);
1760 path.close();
1761 path.moveTo(0, 0);
1762 path.lineTo(0, 0);
1763 path.lineTo(3, 0);
1764 path.close();
1765 testSimplifyx(path);
1766}
1767
caryclark@google.com59823f72012-08-09 18:17:47 +00001768static void testDegenerate4() {
1769 SkPath path;
1770 path.moveTo(0, 0);
1771 path.lineTo(1, 0);
1772 path.lineTo(1, 3);
1773 path.close();
1774 path.moveTo(1, 0);
1775 path.lineTo(1, 1);
1776 path.lineTo(1, 2);
1777 path.close();
1778 testSimplifyx(path);
1779}
1780
caryclark@google.comc899ad92012-08-23 15:24:42 +00001781static void testDegenerate4x() {
1782 SkPath path;
1783 path.setFillType(SkPath::kEvenOdd_FillType);
1784 path.moveTo(0, 0);
1785 path.lineTo(1, 0);
1786 path.lineTo(1, 3);
1787 path.close();
1788 path.moveTo(1, 0);
1789 path.lineTo(1, 1);
1790 path.lineTo(1, 2);
1791 path.close();
1792 testSimplifyx(path);
1793}
1794
caryclark@google.com59823f72012-08-09 18:17:47 +00001795static void testNondegenerate1() {
1796 SkPath path;
1797 path.moveTo(0, 0);
1798 path.lineTo(3, 0);
1799 path.lineTo(1, 3);
1800 path.close();
1801 path.moveTo(1, 1);
1802 path.lineTo(2, 1);
1803 path.lineTo(1, 2);
1804 path.close();
1805 testSimplifyx(path);
1806}
1807
caryclark@google.comc899ad92012-08-23 15:24:42 +00001808static void testNondegenerate1x() {
1809 SkPath path;
1810 path.setFillType(SkPath::kEvenOdd_FillType);
1811 path.moveTo(0, 0);
1812 path.lineTo(3, 0);
1813 path.lineTo(1, 3);
1814 path.close();
1815 path.moveTo(1, 1);
1816 path.lineTo(2, 1);
1817 path.lineTo(1, 2);
1818 path.close();
1819 testSimplifyx(path);
1820}
1821
caryclark@google.com59823f72012-08-09 18:17:47 +00001822static void testNondegenerate2() {
1823 SkPath path;
1824 path.moveTo(1, 0);
1825 path.lineTo(0, 1);
1826 path.lineTo(1, 1);
1827 path.close();
1828 path.moveTo(0, 2);
1829 path.lineTo(0, 3);
1830 path.lineTo(1, 2);
1831 path.close();
1832 testSimplifyx(path);
1833}
1834
caryclark@google.comc899ad92012-08-23 15:24:42 +00001835static void testNondegenerate2x() {
1836 SkPath path;
1837 path.setFillType(SkPath::kEvenOdd_FillType);
1838 path.moveTo(1, 0);
1839 path.lineTo(0, 1);
1840 path.lineTo(1, 1);
1841 path.close();
1842 path.moveTo(0, 2);
1843 path.lineTo(0, 3);
1844 path.lineTo(1, 2);
1845 path.close();
1846 testSimplifyx(path);
1847}
1848
caryclark@google.com59823f72012-08-09 18:17:47 +00001849static void testNondegenerate3() {
1850 SkPath path;
1851 path.moveTo(0, 0);
1852 path.lineTo(1, 0);
1853 path.lineTo(2, 1);
1854 path.close();
1855 path.moveTo(0, 1);
1856 path.lineTo(1, 1);
1857 path.lineTo(0, 2);
1858 path.close();
1859 testSimplifyx(path);
1860}
1861
caryclark@google.comc899ad92012-08-23 15:24:42 +00001862static void testNondegenerate3x() {
1863 SkPath path;
1864 path.setFillType(SkPath::kEvenOdd_FillType);
1865 path.moveTo(0, 0);
1866 path.lineTo(1, 0);
1867 path.lineTo(2, 1);
1868 path.close();
1869 path.moveTo(0, 1);
1870 path.lineTo(1, 1);
1871 path.lineTo(0, 2);
1872 path.close();
1873 testSimplifyx(path);
1874}
1875
caryclark@google.com59823f72012-08-09 18:17:47 +00001876static void testNondegenerate4() {
1877 SkPath path;
1878 path.moveTo(1, 0);
1879 path.lineTo(0, 1);
1880 path.lineTo(1, 2);
1881 path.close();
1882 path.moveTo(0, 2);
1883 path.lineTo(0, 3);
1884 path.lineTo(1, 3);
1885 path.close();
1886 testSimplifyx(path);
1887}
1888
caryclark@google.comc899ad92012-08-23 15:24:42 +00001889static void testNondegenerate4x() {
1890 SkPath path;
1891 path.setFillType(SkPath::kEvenOdd_FillType);
1892 path.moveTo(1, 0);
1893 path.lineTo(0, 1);
1894 path.lineTo(1, 2);
1895 path.close();
1896 path.moveTo(0, 2);
1897 path.lineTo(0, 3);
1898 path.lineTo(1, 3);
1899 path.close();
1900 testSimplifyx(path);
1901}
1902
caryclark@google.com59823f72012-08-09 18:17:47 +00001903static void testQuadralateral5() {
1904 SkPath path;
1905 path.moveTo(0, 0);
1906 path.lineTo(0, 0);
1907 path.lineTo(1, 0);
1908 path.lineTo(1, 1);
1909 path.close();
1910 path.moveTo(0, 0);
1911 path.lineTo(2, 2);
1912 path.lineTo(3, 2);
1913 path.lineTo(3, 3);
1914 path.close();
1915 testSimplifyx(path);
1916}
1917
caryclark@google.comc899ad92012-08-23 15:24:42 +00001918static void testQuadralateral5x() {
1919 SkPath path;
1920 path.setFillType(SkPath::kEvenOdd_FillType);
1921 path.moveTo(0, 0);
1922 path.lineTo(0, 0);
1923 path.lineTo(1, 0);
1924 path.lineTo(1, 1);
1925 path.close();
1926 path.moveTo(0, 0);
1927 path.lineTo(2, 2);
1928 path.lineTo(3, 2);
1929 path.lineTo(3, 3);
1930 path.close();
1931 testSimplifyx(path);
1932}
1933
caryclark@google.com59823f72012-08-09 18:17:47 +00001934static void testQuadralateral6() {
1935 SkPath path;
1936 path.moveTo(0, 0);
1937 path.lineTo(0, 0);
1938 path.lineTo(1, 0);
1939 path.lineTo(1, 1);
1940 path.close();
1941 path.moveTo(1, 0);
1942 path.lineTo(2, 0);
1943 path.lineTo(0, 2);
1944 path.lineTo(2, 2);
1945 path.close();
1946 testSimplifyx(path);
1947}
1948
caryclark@google.comc899ad92012-08-23 15:24:42 +00001949static void testQuadralateral6x() {
1950 SkPath path;
1951 path.setFillType(SkPath::kEvenOdd_FillType);
1952 path.moveTo(0, 0);
1953 path.lineTo(0, 0);
1954 path.lineTo(1, 0);
1955 path.lineTo(1, 1);
1956 path.close();
1957 path.moveTo(1, 0);
1958 path.lineTo(2, 0);
1959 path.lineTo(0, 2);
1960 path.lineTo(2, 2);
1961 path.close();
1962 testSimplifyx(path);
1963}
1964
caryclark@google.com24bec792012-08-20 12:43:57 +00001965static void testFauxQuadralateral6() {
1966 SkPath path;
1967 path.moveTo(0, 0);
1968 path.lineTo(1, 0);
1969 path.lineTo(1, 1);
1970 path.close();
1971 path.moveTo(1, 0);
1972 path.lineTo(2, 0);
1973 path.lineTo(1 + 1.0f/3, 2.0f/3);
1974 path.close();
1975 path.moveTo(1 + 1.0f/3, 2.0f/3);
1976 path.lineTo(0, 2);
1977 path.lineTo(2, 2);
1978 path.close();
1979 testSimplifyx(path);
1980}
1981
caryclark@google.comc899ad92012-08-23 15:24:42 +00001982static void testFauxQuadralateral6x() {
1983 SkPath path;
1984 path.setFillType(SkPath::kEvenOdd_FillType);
1985 path.moveTo(0, 0);
1986 path.lineTo(1, 0);
1987 path.lineTo(1, 1);
1988 path.close();
1989 path.moveTo(1, 0);
1990 path.lineTo(2, 0);
1991 path.lineTo(1 + 1.0f/3, 2.0f/3);
1992 path.close();
1993 path.moveTo(1 + 1.0f/3, 2.0f/3);
1994 path.lineTo(0, 2);
1995 path.lineTo(2, 2);
1996 path.close();
1997 testSimplifyx(path);
1998}
1999
caryclark@google.com24bec792012-08-20 12:43:57 +00002000static void testFauxQuadralateral6a() {
2001 SkPath path;
2002 path.moveTo(0, 0);
2003 path.lineTo(3, 0);
2004 path.lineTo(3, 3);
2005 path.close();
2006 path.moveTo(3, 0);
2007 path.lineTo(6, 0);
2008 path.lineTo(4, 2);
2009 path.close();
2010 path.moveTo(4, 2);
2011 path.lineTo(0, 6);
2012 path.lineTo(6, 6);
2013 path.close();
2014 testSimplifyx(path);
2015}
2016
caryclark@google.comc899ad92012-08-23 15:24:42 +00002017static void testFauxQuadralateral6ax() {
2018 SkPath path;
2019 path.setFillType(SkPath::kEvenOdd_FillType);
2020 path.moveTo(0, 0);
2021 path.lineTo(3, 0);
2022 path.lineTo(3, 3);
2023 path.close();
2024 path.moveTo(3, 0);
2025 path.lineTo(6, 0);
2026 path.lineTo(4, 2);
2027 path.close();
2028 path.moveTo(4, 2);
2029 path.lineTo(0, 6);
2030 path.lineTo(6, 6);
2031 path.close();
2032 testSimplifyx(path);
2033}
2034
caryclark@google.com24bec792012-08-20 12:43:57 +00002035static void testFauxQuadralateral6b() {
2036 SkPath path;
2037 path.moveTo(0, 0);
2038 path.lineTo(3, 0);
2039 path.lineTo(3, 3);
2040 path.close();
2041 path.moveTo(3, 0);
2042 path.lineTo(6, 0);
2043 path.lineTo(4, 2);
2044 path.close();
2045 path.moveTo(4, 2);
2046 path.lineTo(6, 6);
2047 path.lineTo(0, 6);
2048 path.close();
2049 testSimplifyx(path);
2050}
2051
caryclark@google.comc899ad92012-08-23 15:24:42 +00002052static void testFauxQuadralateral6bx() {
2053 SkPath path;
2054 path.setFillType(SkPath::kEvenOdd_FillType);
2055 path.moveTo(0, 0);
2056 path.lineTo(3, 0);
2057 path.lineTo(3, 3);
2058 path.close();
2059 path.moveTo(3, 0);
2060 path.lineTo(6, 0);
2061 path.lineTo(4, 2);
2062 path.close();
2063 path.moveTo(4, 2);
2064 path.lineTo(6, 6);
2065 path.lineTo(0, 6);
2066 path.close();
2067 testSimplifyx(path);
2068}
2069
caryclark@google.com24bec792012-08-20 12:43:57 +00002070static void testFauxQuadralateral6c() {
2071 SkPath path;
2072 path.moveTo(0, 0);
2073 path.lineTo(3, 3);
2074 path.lineTo(3, 0);
2075 path.close();
2076 path.moveTo(3, 0);
2077 path.lineTo(6, 0);
2078 path.lineTo(4, 2);
2079 path.close();
2080 path.moveTo(4, 2);
2081 path.lineTo(0, 6);
2082 path.lineTo(6, 6);
2083 path.close();
2084 testSimplifyx(path);
2085}
2086
caryclark@google.comc899ad92012-08-23 15:24:42 +00002087static void testFauxQuadralateral6cx() {
2088 SkPath path;
2089 path.setFillType(SkPath::kEvenOdd_FillType);
2090 path.moveTo(0, 0);
2091 path.lineTo(3, 3);
2092 path.lineTo(3, 0);
2093 path.close();
2094 path.moveTo(3, 0);
2095 path.lineTo(6, 0);
2096 path.lineTo(4, 2);
2097 path.close();
2098 path.moveTo(4, 2);
2099 path.lineTo(0, 6);
2100 path.lineTo(6, 6);
2101 path.close();
2102 testSimplifyx(path);
2103}
2104
caryclark@google.com24bec792012-08-20 12:43:57 +00002105static void testFauxQuadralateral6d() {
2106 SkPath path;
2107 path.moveTo(0, 0);
2108 path.lineTo(3, 3);
2109 path.lineTo(3, 0);
2110 path.close();
2111 path.moveTo(3, 0);
2112 path.lineTo(6, 0);
2113 path.lineTo(4, 2);
2114 path.close();
2115 path.moveTo(4, 2);
2116 path.lineTo(6, 6);
2117 path.lineTo(0, 6);
2118 path.close();
2119 testSimplifyx(path);
2120}
2121
caryclark@google.comc899ad92012-08-23 15:24:42 +00002122static void testFauxQuadralateral6dx() {
2123 SkPath path;
2124 path.setFillType(SkPath::kEvenOdd_FillType);
2125 path.moveTo(0, 0);
2126 path.lineTo(3, 3);
2127 path.lineTo(3, 0);
2128 path.close();
2129 path.moveTo(3, 0);
2130 path.lineTo(6, 0);
2131 path.lineTo(4, 2);
2132 path.close();
2133 path.moveTo(4, 2);
2134 path.lineTo(6, 6);
2135 path.lineTo(0, 6);
2136 path.close();
2137 testSimplifyx(path);
2138}
2139
caryclark@google.com24bec792012-08-20 12:43:57 +00002140static void testQuadralateral6a() {
2141 SkPath path;
2142 path.moveTo(0, 0);
2143 path.lineTo(0, 0);
2144 path.lineTo(3, 0);
2145 path.lineTo(3, 3);
2146 path.close();
2147 path.moveTo(3, 0);
2148 path.lineTo(6, 0);
2149 path.lineTo(0, 6);
2150 path.lineTo(6, 6);
2151 path.close();
2152 testSimplifyx(path);
2153}
2154
caryclark@google.comc899ad92012-08-23 15:24:42 +00002155static void testQuadralateral6ax() {
2156 SkPath path;
2157 path.setFillType(SkPath::kEvenOdd_FillType);
2158 path.moveTo(0, 0);
2159 path.lineTo(0, 0);
2160 path.lineTo(3, 0);
2161 path.lineTo(3, 3);
2162 path.close();
2163 path.moveTo(3, 0);
2164 path.lineTo(6, 0);
2165 path.lineTo(0, 6);
2166 path.lineTo(6, 6);
2167 path.close();
2168 testSimplifyx(path);
2169}
2170
caryclark@google.com24bec792012-08-20 12:43:57 +00002171static void testQuadralateral7() {
2172 SkPath path;
2173 path.moveTo(0, 0);
2174 path.lineTo(0, 0);
2175 path.lineTo(1, 0);
2176 path.lineTo(2, 1);
2177 path.close();
2178 path.moveTo(1, 0);
2179 path.lineTo(1, 1);
2180 path.lineTo(2, 2);
2181 path.lineTo(1, 3);
2182 path.close();
2183 testSimplifyx(path);
2184}
2185
caryclark@google.comc899ad92012-08-23 15:24:42 +00002186static void testQuadralateral7x() {
2187 SkPath path;
2188 path.setFillType(SkPath::kEvenOdd_FillType);
2189 path.moveTo(0, 0);
2190 path.lineTo(0, 0);
2191 path.lineTo(1, 0);
2192 path.lineTo(2, 1);
2193 path.close();
2194 path.moveTo(1, 0);
2195 path.lineTo(1, 1);
2196 path.lineTo(2, 2);
2197 path.lineTo(1, 3);
2198 path.close();
2199 testSimplifyx(path);
2200}
2201
caryclark@google.com24bec792012-08-20 12:43:57 +00002202static void testQuadralateral8() {
2203 SkPath path;
2204 path.moveTo(0, 0);
2205 path.lineTo(3, 1);
2206 path.lineTo(1, 3);
2207 path.lineTo(3, 3);
2208 path.close();
2209 path.moveTo(2, 1);
2210 path.lineTo(0, 2);
2211 path.lineTo(3, 2);
2212 path.lineTo(2, 3);
2213 path.close();
2214 testSimplifyx(path);
2215}
2216
caryclark@google.comc899ad92012-08-23 15:24:42 +00002217static void testQuadralateral8x() {
2218 SkPath path;
2219 path.setFillType(SkPath::kEvenOdd_FillType);
2220 path.moveTo(0, 0);
2221 path.lineTo(3, 1);
2222 path.lineTo(1, 3);
2223 path.lineTo(3, 3);
2224 path.close();
2225 path.moveTo(2, 1);
2226 path.lineTo(0, 2);
2227 path.lineTo(3, 2);
2228 path.lineTo(2, 3);
2229 path.close();
2230 testSimplifyx(path);
2231}
2232
caryclark@google.com24bec792012-08-20 12:43:57 +00002233static void testQuadralateral9() {
2234 SkPath path;
2235 path.moveTo(0, 0);
2236 path.lineTo(1, 0);
2237 path.lineTo(1, 2);
2238 path.lineTo(2, 2);
2239 path.close();
2240 path.moveTo(1, 1);
2241 path.lineTo(2, 1);
2242 path.lineTo(1, 3);
2243 path.lineTo(2, 3);
2244 path.close();
2245 testSimplifyx(path);
2246}
2247
caryclark@google.comc899ad92012-08-23 15:24:42 +00002248static void testQuadralateral9x() {
2249 SkPath path;
2250 path.setFillType(SkPath::kEvenOdd_FillType);
2251 path.moveTo(0, 0);
2252 path.lineTo(1, 0);
2253 path.lineTo(1, 2);
2254 path.lineTo(2, 2);
2255 path.close();
2256 path.moveTo(1, 1);
2257 path.lineTo(2, 1);
2258 path.lineTo(1, 3);
2259 path.lineTo(2, 3);
2260 path.close();
2261 testSimplifyx(path);
2262}
2263
2264static void testLine1ax() {
caryclark@google.com24bec792012-08-20 12:43:57 +00002265 SkPath path;
2266 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00002267 path.addRect(0, 0, 12, 12, SkPath::kCW_Direction);
2268 path.addRect(4, 0, 13, 13, SkPath::kCW_Direction);
caryclark@google.com24bec792012-08-20 12:43:57 +00002269 testSimplifyx(path);
2270}
2271
caryclark@google.comc899ad92012-08-23 15:24:42 +00002272static void testLine2ax() {
caryclark@google.com24bec792012-08-20 12:43:57 +00002273 SkPath path;
2274 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00002275 path.addRect(0, 20, 20, 20, SkPath::kCW_Direction);
2276 path.addRect(0, 20, 12, 30, SkPath::kCW_Direction);
2277 path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction);
caryclark@google.com24bec792012-08-20 12:43:57 +00002278 testSimplifyx(path);
2279}
2280
caryclark@google.comc899ad92012-08-23 15:24:42 +00002281static void testLine3aax() {
caryclark@google.com24bec792012-08-20 12:43:57 +00002282 SkPath path;
2283 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00002284 path.addRect(10, 30, 30, 30, SkPath::kCW_Direction);
2285 path.addRect(18, 20, 30, 30, SkPath::kCCW_Direction);
2286 path.addRect(0, 32, 9, 36, SkPath::kCCW_Direction);
caryclark@google.com24bec792012-08-20 12:43:57 +00002287 testSimplifyx(path);
2288}
2289
caryclark@google.comc899ad92012-08-23 15:24:42 +00002290static void testLine4ax() {
caryclark@google.com24bec792012-08-20 12:43:57 +00002291 SkPath path;
2292 path.setFillType(SkPath::kEvenOdd_FillType);
caryclark@google.com7fce0de2012-11-29 14:31:50 +00002293 path.addRect(10, 30, 30, 30, SkPath::kCW_Direction);
2294 path.addRect(24, 20, 36, 30, SkPath::kCCW_Direction);
2295 path.addRect(0, 32, 9, 36, SkPath::kCCW_Direction);
caryclark@google.com24bec792012-08-20 12:43:57 +00002296 testSimplifyx(path);
2297}
2298
2299static void testQuadratic1() {
2300 SkPath path;
2301 path.moveTo(0, 0);
2302 path.quadTo(0, 0, 0, 0);
2303 path.lineTo(1, 0);
2304 path.close();
2305 path.moveTo(0, 0);
2306 path.lineTo(0, 0);
2307 path.quadTo(0, 0, 0, 0);
2308 path.close();
2309 testSimplifyx(path);
2310}
2311
caryclark@google.comc899ad92012-08-23 15:24:42 +00002312static void testQuadratic1x() {
2313 SkPath path;
2314 path.setFillType(SkPath::kEvenOdd_FillType);
2315 path.moveTo(0, 0);
2316 path.quadTo(0, 0, 0, 0);
2317 path.lineTo(1, 0);
2318 path.close();
2319 path.moveTo(0, 0);
2320 path.lineTo(0, 0);
2321 path.quadTo(0, 0, 0, 0);
2322 path.close();
2323 testSimplifyx(path);
2324}
2325
caryclark@google.com24bec792012-08-20 12:43:57 +00002326static void testQuadratic2() {
2327 SkPath path;
2328 path.moveTo(0, 0);
2329 path.quadTo(0, 0, 0, 0);
2330 path.lineTo(3, 0);
2331 path.close();
2332 path.moveTo(0, 0);
2333 path.lineTo(0, 0);
2334 path.quadTo(1, 0, 0, 1);
2335 path.close();
2336 testSimplifyx(path);
2337}
2338
caryclark@google.comc899ad92012-08-23 15:24:42 +00002339static void testQuadratic2x() {
2340 SkPath path;
2341 path.setFillType(SkPath::kEvenOdd_FillType);
2342 path.moveTo(0, 0);
2343 path.quadTo(0, 0, 0, 0);
2344 path.lineTo(3, 0);
2345 path.close();
2346 path.moveTo(0, 0);
2347 path.lineTo(0, 0);
2348 path.quadTo(1, 0, 0, 1);
2349 path.close();
2350 testSimplifyx(path);
2351}
2352
caryclark@google.com03f97062012-08-21 13:13:52 +00002353static void testQuadratic3() {
2354 SkPath path;
2355 path.moveTo(0, 0);
2356 path.quadTo(0, 0, 1, 0);
2357 path.lineTo(0, 2);
2358 path.close();
2359 path.moveTo(0, 0);
2360 path.lineTo(0, 0);
2361 path.quadTo(1, 0, 0, 1);
2362 path.close();
2363 testSimplifyx(path);
2364}
2365
caryclark@google.comc899ad92012-08-23 15:24:42 +00002366static void testQuadratic3x() {
2367 SkPath path;
2368 path.setFillType(SkPath::kEvenOdd_FillType);
2369 path.moveTo(0, 0);
2370 path.quadTo(0, 0, 1, 0);
2371 path.lineTo(0, 2);
2372 path.close();
2373 path.moveTo(0, 0);
2374 path.lineTo(0, 0);
2375 path.quadTo(1, 0, 0, 1);
2376 path.close();
2377 testSimplifyx(path);
2378}
2379
2380static void testQuadratic4() {
2381 SkPath path;
2382 path.moveTo(0, 0);
2383 path.quadTo(0, 0, 1, 0);
2384 path.lineTo(0, 2);
2385 path.close();
2386 path.moveTo(0, 0);
2387 path.lineTo(0, 0);
2388 path.quadTo(1, 0, 0, 2);
2389 path.close();
2390 testSimplifyx(path);
2391}
2392
2393static void testQuadratic4x() {
2394 SkPath path;
2395 path.setFillType(SkPath::kEvenOdd_FillType);
2396 path.moveTo(0, 0);
2397 path.quadTo(0, 0, 1, 0);
2398 path.lineTo(0, 2);
2399 path.close();
2400 path.moveTo(0, 0);
2401 path.lineTo(0, 0);
2402 path.quadTo(1, 0, 0, 2);
2403 path.close();
2404 testSimplifyx(path);
2405}
2406
2407static void testQuadratic5() {
2408 SkPath path;
2409 path.moveTo(0, 0);
2410 path.quadTo(0, 0, 0, 0);
2411 path.lineTo(0, 1);
2412 path.close();
2413 path.moveTo(0, 0);
2414 path.lineTo(1, 0);
2415 path.quadTo(0, 1, 0, 2);
2416 path.close();
2417 testSimplifyx(path);
2418}
2419
2420static void testQuadratic6() {
2421 SkPath path;
2422 path.moveTo(0, 0);
2423 path.quadTo(0, 0, 1, 0);
2424 path.lineTo(2, 1);
2425 path.close();
2426 path.moveTo(0, 0);
2427 path.lineTo(0, 0);
2428 path.quadTo(2, 0, 0, 1);
2429 path.close();
2430 testSimplifyx(path);
2431}
2432
2433static void testQuadratic7() {
2434 SkPath path;
2435 path.moveTo(0, 0);
2436 path.quadTo(0, 0, 1, 0);
2437 path.lineTo(3, 1);
2438 path.close();
2439 path.moveTo(0, 0);
2440 path.lineTo(0, 0);
2441 path.quadTo(3, 0, 1, 2);
2442 path.close();
2443 testSimplifyx(path);
2444}
2445
2446static void testQuadratic8() {
2447 SkPath path;
2448 path.moveTo(0, 0);
2449 path.quadTo(0, 0, 1, 0);
2450 path.lineTo(0, 2);
2451 path.close();
2452 path.moveTo(0, 0);
2453 path.lineTo(1, 0);
2454 path.quadTo(0, 1, 1, 2);
2455 path.close();
2456 testSimplifyx(path);
2457}
2458
2459static void testQuadratic9() {
2460 SkPath path;
2461 path.moveTo(0, 0);
2462 path.quadTo(0, 0, 1, 0);
2463 path.lineTo(3, 1);
2464 path.close();
2465 path.moveTo(0, 0);
2466 path.lineTo(1, 0);
2467 path.quadTo(1, 2, 3, 2);
2468 path.close();
2469 testSimplifyx(path);
2470}
2471
2472static void testQuadratic14() {
2473 SkPath path;
2474 path.moveTo(0, 0);
2475 path.quadTo(0, 0, 1, 0);
2476 path.lineTo(3, 2);
2477 path.close();
2478 path.moveTo(0, 0);
2479 path.lineTo(1, 0);
2480 path.quadTo(3, 2, 3, 3);
2481 path.close();
2482 testSimplifyx(path);
2483}
2484
caryclark@google.com3350c3c2012-08-24 15:24:36 +00002485static void testQuadratic15() {
2486 SkPath path;
2487 path.moveTo(0, 0);
2488 path.quadTo(0, 0, 1, 0);
2489 path.lineTo(1, 3);
2490 path.close();
2491 path.moveTo(1, 0);
2492 path.lineTo(0, 1);
2493 path.quadTo(1, 1, 0, 3);
2494 path.close();
2495 testSimplifyx(path);
2496}
2497
2498static void testQuadratic17x() {
2499 SkPath path;
2500 path.setFillType(SkPath::kEvenOdd_FillType);
2501 path.moveTo(0, 0);
2502 path.quadTo(0, 0, 3, 1);
2503 path.lineTo(0, 2);
2504 path.close();
2505 path.moveTo(0, 0);
2506 path.lineTo(1, 0);
2507 path.quadTo(3, 1, 0, 2);
2508 path.close();
2509 testSimplifyx(path);
2510}
2511
2512static void testQuadratic18() {
2513 SkPath path;
2514 path.moveTo(0, 0);
2515 path.quadTo(1, 0, 0, 1);
2516 path.lineTo(0, 1);
2517 path.close();
2518 path.moveTo(0, 0);
2519 path.lineTo(0, 0);
2520 path.quadTo(1, 0, 1, 1);
2521 path.close();
2522 testSimplifyx(path);
2523}
2524
caryclark@google.coma7e483d2012-08-28 20:44:43 +00002525static void testQuadratic19() {
2526 SkPath path;
2527 path.moveTo(0, 0);
2528 path.quadTo(1, 0, 0, 1);
2529 path.lineTo(0, 1);
2530 path.close();
2531 path.moveTo(0, 0);
2532 path.lineTo(0, 0);
2533 path.quadTo(2, 0, 0, 1);
2534 path.close();
2535 testSimplifyx(path);
2536}
2537
caryclark@google.com32546db2012-08-31 20:55:07 +00002538static void testQuadratic20() {
2539 SkPath path;
2540 path.moveTo(0, 0);
2541 path.quadTo(1, 0, 0, 1);
2542 path.lineTo(0, 1);
2543 path.close();
2544 path.moveTo(0, 0);
2545 path.lineTo(0, 0);
2546 path.quadTo(1, 0, 0, 1);
2547 path.close();
2548 testSimplifyx(path);
2549}
2550
caryclark@google.com235f56a2012-09-14 14:19:30 +00002551static void testQuadratic21() {
2552 SkPath path;
2553 path.moveTo(0, 0);
2554 path.quadTo(1, 0, 0, 1);
2555 path.lineTo(0, 1);
2556 path.close();
2557 path.moveTo(0, 0);
2558 path.lineTo(0, 0);
2559 path.quadTo(1, 0, 0, 2);
2560 path.close();
2561 testSimplifyx(path);
2562}
2563
caryclark@google.com235f56a2012-09-14 14:19:30 +00002564static void testQuadratic22() {
2565 SkPath path;
2566 path.moveTo(0, 0);
2567 path.quadTo(1, 0, 0, 1);
2568 path.lineTo(0, 1);
2569 path.close();
2570 path.moveTo(0, 0);
2571 path.lineTo(0, 0);
2572 path.quadTo(0, 1, 2, 1);
2573 path.close();
2574 testSimplifyx(path);
2575}
2576
2577static void testQuadratic23() {
2578 SkPath path;
2579 path.moveTo(0, 0);
2580 path.quadTo(1, 0, 0, 1);
2581 path.lineTo(0, 1);
2582 path.close();
2583 path.moveTo(0, 0);
2584 path.lineTo(0, 0);
2585 path.quadTo(0, 2, 1, 2);
2586 path.close();
2587 testSimplifyx(path);
2588}
2589
2590static void testQuadratic24() {
2591 SkPath path;
2592 path.moveTo(0, 0);
2593 path.quadTo(1, 0, 0, 1);
2594 path.lineTo(0, 1);
2595 path.close();
2596 path.moveTo(0, 0);
2597 path.lineTo(1, 0);
2598 path.quadTo(2, 0, 0, 1);
2599 path.close();
2600 testSimplifyx(path);
2601}
2602
2603static void testQuadratic25() {
2604 SkPath path;
2605 path.moveTo(0, 0);
2606 path.quadTo(1, 0, 1, 1);
2607 path.lineTo(1, 1);
2608 path.close();
2609 path.moveTo(0, 0);
2610 path.lineTo(0, 0);
2611 path.quadTo(2, 1, 0, 2);
2612 path.close();
2613 testSimplifyx(path);
2614}
2615
2616static void testQuadratic26() {
2617 SkPath path;
2618 path.moveTo(0, 0);
2619 path.quadTo(1, 0, 1, 1);
2620 path.lineTo(0, 2);
2621 path.close();
2622 path.moveTo(0, 0);
2623 path.lineTo(0, 0);
2624 path.quadTo(1, 0, 0, 1);
2625 path.close();
2626 testSimplifyx(path);
2627}
2628
2629static void testQuadratic27() {
2630 SkPath path;
2631 path.moveTo(0, 0);
2632 path.quadTo(1, 0, 1, 1);
2633 path.lineTo(2, 1);
2634 path.close();
2635 path.moveTo(0, 0);
2636 path.lineTo(0, 0);
2637 path.quadTo(2, 1, 0, 2);
2638 path.close();
2639 testSimplifyx(path);
2640}
2641
2642static void testQuadratic28() {
2643 SkPath path;
2644 path.moveTo(0, 0);
2645 path.quadTo(1, 0, 0, 1);
2646 path.lineTo(0, 1);
2647 path.close();
2648 path.moveTo(0, 0);
2649 path.lineTo(0, 2);
2650 path.quadTo(1, 2, 0, 3);
2651 path.close();
2652 testSimplifyx(path);
2653}
2654
caryclark@google.comd1688742012-09-18 20:08:37 +00002655static void testQuadratic29() {
2656 SkPath path;
2657 path.moveTo(0, 0);
2658 path.quadTo(1, 0, 2, 1);
2659 path.lineTo(0, 2);
2660 path.close();
2661 path.moveTo(0, 0);
2662 path.lineTo(0, 0);
2663 path.quadTo(1, 0, 0, 1);
2664 path.close();
2665 testSimplifyx(path);
2666}
2667
2668static void testQuadratic30() {
2669 SkPath path;
2670 path.moveTo(0, 0);
2671 path.quadTo(1, 0, 1, 2);
2672 path.lineTo(1, 2);
2673 path.close();
2674 path.moveTo(0, 0);
2675 path.lineTo(1, 0);
2676 path.quadTo(0, 1, 1, 2);
2677 path.close();
2678 testSimplifyx(path);
2679}
2680
2681static void testQuadratic31() {
2682 SkPath path;
2683 path.moveTo(0, 0);
2684 path.quadTo(1, 0, 1, 2);
2685 path.lineTo(1, 2);
2686 path.close();
2687 path.moveTo(0, 0);
2688 path.lineTo(1, 0);
2689 path.quadTo(0, 1, 1, 3);
2690 path.close();
2691 testSimplifyx(path);
2692}
2693
2694static void testQuadratic32() {
2695 SkPath path;
2696 path.moveTo(0, 0);
2697 path.quadTo(1, 0, 2, 3);
2698 path.lineTo(2, 3);
2699 path.close();
2700 path.moveTo(0, 0);
2701 path.lineTo(0, 0);
2702 path.quadTo(3, 1, 0, 2);
2703 path.close();
2704 testSimplifyx(path);
2705}
2706
2707static void testQuadratic33() {
2708 SkPath path;
2709 path.moveTo(0, 0);
2710 path.quadTo(2, 0, 0, 1);
2711 path.lineTo(0, 1);
2712 path.close();
2713 path.moveTo(0, 0);
2714 path.lineTo(1, 1);
2715 path.quadTo(2, 1, 2, 2);
2716 path.close();
2717 testSimplifyx(path);
2718}
2719
2720static void testQuadratic34() {
2721 SkPath path;
2722 path.moveTo(0, 0);
2723 path.quadTo(2, 0, 0, 1);
2724 path.lineTo(0, 1);
2725 path.close();
2726 path.moveTo(1, 0);
2727 path.lineTo(1, 1);
2728 path.quadTo(2, 1, 1, 2);
2729 path.close();
2730 testSimplifyx(path);
2731}
2732
2733static void testQuadratic35() {
2734 SkPath path;
2735 path.moveTo(0, 0);
2736 path.quadTo(0, 1, 1, 1);
2737 path.lineTo(1, 3);
2738 path.close();
2739 path.moveTo(2, 0);
2740 path.lineTo(3, 0);
2741 path.quadTo(0, 1, 1, 1);
2742 path.close();
2743 testSimplifyx(path);
2744}
2745
2746static void testQuadratic36() {
2747 SkPath path;
2748 path.moveTo(0, 0);
2749 path.quadTo(2, 1, 2, 3);
2750 path.lineTo(2, 3);
2751 path.close();
2752 path.moveTo(3, 1);
2753 path.lineTo(1, 2);
2754 path.quadTo(3, 2, 1, 3);
2755 path.close();
2756 testSimplifyx(path);
2757}
2758
2759static void testQuadratic37() {
2760 SkPath path;
2761 path.moveTo(0, 0);
2762 path.quadTo(0, 2, 1, 2);
2763 path.lineTo(1, 2);
2764 path.close();
2765 path.moveTo(0, 0);
2766 path.lineTo(3, 1);
2767 path.quadTo(0, 2, 1, 2);
2768 path.close();
2769 testSimplifyx(path);
2770}
2771
2772static void testQuadratic38() {
2773 SkPath path;
2774 path.moveTo(1, 0);
2775 path.quadTo(0, 1, 1, 1);
2776 path.lineTo(1, 1);
2777 path.close();
2778 path.moveTo(1, 0);
2779 path.lineTo(1, 2);
2780 path.quadTo(2, 2, 1, 3);
2781 path.close();
2782 testSimplifyx(path);
2783}
2784
caryclark@google.comfb51afb2012-10-19 15:54:16 +00002785static void testQuadratic51() {
2786 SkPath path;
2787 path.moveTo(369.863983f, 145.645813f);
2788 path.quadTo(382.380371f, 121.254936f, 406.236359f, 121.254936f);
2789 path.lineTo(369.863983f, 145.645813f);
2790 path.close();
2791 path.moveTo(369.970581f, 137.94342f);
2792 path.quadTo(383.98465f, 121.254936f, 406.235992f, 121.254936f);
2793 path.lineTo(369.970581f, 137.94342f);
2794 path.close();
2795 testSimplifyx(path);
2796}
2797
caryclark@google.comf839c032012-10-26 21:03:50 +00002798static void testQuadratic53() {
2799 SkPath path;
2800 path.moveTo(303.12088f, 141.299606f);
2801 path.lineTo(330.463562f, 217.659027f);
2802 path.lineTo(303.12088f, 141.299606f);
2803 path.close();
2804 path.moveTo(371.919067f, 205.854996f);
2805 path.lineTo(326.236786f, 205.854996f);
2806 path.quadTo(329.104431f, 231.663818f, 351.512085f, 231.663818f);
2807 path.lineTo(371.919067f, 205.854996f);
2808 path.close();
2809 testSimplifyx(path);
2810}
2811static void testQuadratic55() {
2812 SkPath path;
2813path.moveTo(303.12088f, 141.299606f);
2814path.lineTo(330.463562f, 217.659027f);
2815path.lineTo(358.606506f, 141.299606f);
2816path.lineTo(303.12088f, 141.299606f);
2817path.close();
2818path.moveTo(326.236786f, 205.854996f);
2819path.quadTo(329.104431f, 231.663818f, 351.512085f, 231.663818f);
2820path.lineTo(326.236786f, 205.854996f);
2821path.close();
2822 testSimplifyx(path);
2823}
2824
2825static void testQuadratic56() {
2826 SkPath path;
2827path.moveTo(366.608826f, 151.196014f);
2828path.quadTo(378.803101f, 136.674606f, 398.164948f, 136.674606f);
2829path.lineTo(354.009216f, 208.816208f);
2830path.lineTo(393.291473f, 102.232819f);
2831path.lineTo(359.978058f, 136.581512f);
2832path.quadTo(378.315979f, 136.581512f, 388.322723f, 149.613556f);
2833path.lineTo(364.390686f, 157.898193f);
2834path.quadTo(375.281769f, 136.674606f, 396.039917f, 136.674606f);
2835path.lineTo(350, 120);
2836path.lineTo(366.608826f, 151.196014f);
2837path.close();
2838 testSimplifyx(path);
2839}
2840
2841static void testLine80() {
2842 SkPath path;
2843path.moveTo(4, 0);
2844path.lineTo(3, 7);
2845path.lineTo(7, 5);
2846path.lineTo(2, 2);
2847path.close();
2848path.moveTo(0, 6);
2849path.lineTo(6, 12);
2850path.lineTo(8, 3);
2851path.close();
2852 testSimplifyx(path);
2853}
2854
2855static void testQuadratic58() {
2856 SkPath path;
2857path.moveTo(283.714233f, 240);
2858path.lineTo(283.714233f, 141.299606f);
2859path.lineTo(303.12088f, 141.299606f);
2860path.lineTo(330.463562f, 217.659027f);
2861path.lineTo(358.606506f, 141.299606f);
2862path.lineTo(362.874634f, 159.705902f);
2863path.lineTo(335.665344f, 233.397751f);
2864path.lineTo(322.12738f, 233.397751f);
2865path.lineTo(295.718353f, 159.505829f);
2866path.lineTo(295.718353f, 240);
2867path.lineTo(283.714233f, 240);
2868path.close();
2869path.moveTo(322.935669f, 231.030273f);
2870path.quadTo(312.832214f, 220.393295f, 312.832214f, 203.454178f);
2871path.quadTo(312.832214f, 186.981888f, 321.73526f, 176.444946f);
2872path.quadTo(330.638306f, 165.90802f, 344.509705f, 165.90802f);
2873path.quadTo(357.647522f, 165.90802f, 364.81665f, 175.244537f);
2874path.lineTo(371.919067f, 205.854996f);
2875path.lineTo(326.236786f, 205.854996f);
2876path.quadTo(329.104431f, 231.663818f, 351.512085f, 231.663818f);
2877path.lineTo(322.935669f, 231.030273f);
2878path.close();
2879path.moveTo(326.837006f, 195.984955f);
2880path.lineTo(358.78125f, 195.984955f);
2881path.quadTo(358.78125f, 175.778046f, 343.709442f, 175.778046f);
2882path.quadTo(328.570923f, 175.778046f, 326.837006f, 195.984955f);
2883path.close();
2884 testSimplifyx(path);
2885}
2886
caryclark@google.com7fce0de2012-11-29 14:31:50 +00002887static void (*firstTest)() = testLine81;
caryclark@google.com8dcf1142012-07-02 20:27:02 +00002888
2889static struct {
2890 void (*fun)();
2891 const char* str;
2892} tests[] = {
caryclark@google.comf839c032012-10-26 21:03:50 +00002893 TEST(testQuadratic58),
caryclark@google.comf839c032012-10-26 21:03:50 +00002894 TEST(testQuadratic56),
2895 TEST(testQuadratic55),
2896 TEST(testQuadratic53),
caryclark@google.comfb51afb2012-10-19 15:54:16 +00002897 TEST(testQuadratic51),
caryclark@google.comd1688742012-09-18 20:08:37 +00002898 TEST(testQuadratic38),
2899 TEST(testQuadratic37),
2900 TEST(testQuadratic36),
2901 TEST(testQuadratic35),
2902 TEST(testQuadratic34),
2903 TEST(testQuadratic33),
2904 TEST(testQuadratic32),
2905 TEST(testQuadratic31),
2906 TEST(testQuadratic30),
2907 TEST(testQuadratic29),
caryclark@google.com235f56a2012-09-14 14:19:30 +00002908 TEST(testQuadratic28),
2909 TEST(testQuadratic27),
2910 TEST(testQuadratic26),
2911 TEST(testQuadratic25),
2912 TEST(testQuadratic24),
2913 TEST(testQuadratic23),
2914 TEST(testQuadratic22),
2915 TEST(testQuadratic21),
caryclark@google.com32546db2012-08-31 20:55:07 +00002916 TEST(testQuadratic20),
caryclark@google.coma7e483d2012-08-28 20:44:43 +00002917 TEST(testQuadratic19),
caryclark@google.com3350c3c2012-08-24 15:24:36 +00002918 TEST(testQuadratic18),
2919 TEST(testQuadratic17x),
2920 TEST(testQuadratic15),
caryclark@google.comc899ad92012-08-23 15:24:42 +00002921 TEST(testQuadratic14),
2922 TEST(testQuadratic9),
2923 TEST(testQuadratic8),
2924 TEST(testQuadratic7),
2925 TEST(testQuadratic6),
2926 TEST(testQuadratic5),
2927 TEST(testQuadratic4x),
2928 TEST(testQuadratic3x),
2929 TEST(testQuadratic2x),
2930 TEST(testQuadratic1x),
2931 TEST(testQuadratic4),
caryclark@google.com03f97062012-08-21 13:13:52 +00002932 TEST(testQuadratic3),
caryclark@google.com24bec792012-08-20 12:43:57 +00002933 TEST(testQuadratic2),
2934 TEST(testQuadratic1),
caryclark@google.comc899ad92012-08-23 15:24:42 +00002935 TEST(testLine4ax),
2936 TEST(testLine3aax),
2937 TEST(testLine2ax),
2938 TEST(testLine1ax),
2939 TEST(testQuadralateral9x),
2940 TEST(testQuadralateral8x),
2941 TEST(testQuadralateral7x),
2942 TEST(testQuadralateral6x),
2943 TEST(testQuadralateral6ax),
caryclark@google.com24bec792012-08-20 12:43:57 +00002944 TEST(testQuadralateral9),
2945 TEST(testQuadralateral8),
2946 TEST(testQuadralateral7),
caryclark@google.com59823f72012-08-09 18:17:47 +00002947 TEST(testQuadralateral6),
caryclark@google.com24bec792012-08-20 12:43:57 +00002948 TEST(testQuadralateral6a),
caryclark@google.comc899ad92012-08-23 15:24:42 +00002949 TEST(testFauxQuadralateral6dx),
2950 TEST(testFauxQuadralateral6cx),
2951 TEST(testFauxQuadralateral6bx),
2952 TEST(testFauxQuadralateral6ax),
2953 TEST(testFauxQuadralateral6x),
caryclark@google.com24bec792012-08-20 12:43:57 +00002954 TEST(testFauxQuadralateral6d),
2955 TEST(testFauxQuadralateral6c),
2956 TEST(testFauxQuadralateral6b),
2957 TEST(testFauxQuadralateral6a),
2958 TEST(testFauxQuadralateral6),
caryclark@google.comc899ad92012-08-23 15:24:42 +00002959 TEST(testQuadralateral5x),
caryclark@google.com59823f72012-08-09 18:17:47 +00002960 TEST(testQuadralateral5),
caryclark@google.comc899ad92012-08-23 15:24:42 +00002961 TEST(testNondegenerate4x),
2962 TEST(testNondegenerate3x),
2963 TEST(testNondegenerate2x),
2964 TEST(testNondegenerate1x),
caryclark@google.com59823f72012-08-09 18:17:47 +00002965 TEST(testNondegenerate4),
2966 TEST(testNondegenerate3),
2967 TEST(testNondegenerate2),
2968 TEST(testNondegenerate1),
caryclark@google.comc899ad92012-08-23 15:24:42 +00002969 TEST(testDegenerate4x),
2970 TEST(testDegenerate3x),
2971 TEST(testDegenerate2x),
2972 TEST(testDegenerate1x),
caryclark@google.com59823f72012-08-09 18:17:47 +00002973 TEST(testDegenerate4),
2974 TEST(testDegenerate3),
2975 TEST(testDegenerate2),
2976 TEST(testDegenerate1),
caryclark@google.comc899ad92012-08-23 15:24:42 +00002977 TEST(testLine79x),
2978 TEST(testLine78x),
2979 TEST(testLine77x),
2980 TEST(testLine76x),
2981 TEST(testLine75x),
2982 TEST(testLine74x),
2983 TEST(testLine73x),
2984 TEST(testLine72x),
2985 TEST(testLine71x),
2986 TEST(testLine70x),
2987 TEST(testLine69x),
2988 TEST(testLine68hx),
2989 TEST(testLine68gx),
2990 TEST(testLine68fx),
2991 TEST(testLine68ex),
2992 TEST(testLine68dx),
2993 TEST(testLine68cx),
2994 TEST(testLine68bx),
2995 TEST(testLine68ax),
2996 TEST(testLine67x),
2997 TEST(testLine66x),
2998 TEST(testLine65x),
2999 TEST(testLine64x),
3000 TEST(testLine63x),
3001 TEST(testLine62x),
3002 TEST(testLine61x),
3003 TEST(testLine60x),
3004 TEST(testLine59x),
3005 TEST(testLine58x),
3006 TEST(testLine57x),
3007 TEST(testLine56x),
3008 TEST(testLine55x),
3009 TEST(testLine54x),
3010 TEST(testLine53x),
3011 TEST(testLine52x),
3012 TEST(testLine51x),
3013 TEST(testLine50x),
3014 TEST(testLine49x),
3015 TEST(testLine48x),
3016 TEST(testLine47x),
3017 TEST(testLine46x),
3018 TEST(testLine45x),
3019 TEST(testLine44x),
3020 TEST(testLine43x),
3021 TEST(testLine42x),
3022 TEST(testLine41x),
3023 TEST(testLine40x),
3024 TEST(testLine38x),
3025 TEST(testLine37x),
3026 TEST(testLine36x),
3027 TEST(testLine35x),
3028 TEST(testLine34x),
3029 TEST(testLine33x),
3030 TEST(testLine32x),
3031 TEST(testLine31x),
3032 TEST(testLine30x),
3033 TEST(testLine29x),
3034 TEST(testLine28x),
3035 TEST(testLine27x),
3036 TEST(testLine26x),
3037 TEST(testLine25x),
3038 TEST(testLine24ax),
3039 TEST(testLine24x),
3040 TEST(testLine23x),
3041 TEST(testLine22x),
3042 TEST(testLine21x),
3043 TEST(testLine20x),
3044 TEST(testLine19x),
3045 TEST(testLine18x),
3046 TEST(testLine17x),
3047 TEST(testLine16x),
3048 TEST(testLine15x),
3049 TEST(testLine14x),
3050 TEST(testLine13x),
3051 TEST(testLine12x),
3052 TEST(testLine11x),
3053 TEST(testLine10ax),
3054 TEST(testLine10x),
3055 TEST(testLine9x),
3056 TEST(testLine8x),
3057 TEST(testLine7bx),
3058 TEST(testLine7ax),
3059 TEST(testLine7x),
3060 TEST(testLine6x),
3061 TEST(testLine5x),
3062 TEST(testLine4x),
3063 TEST(testLine3bx),
3064 TEST(testLine3ax),
3065 TEST(testLine3x),
3066 TEST(testLine2x),
3067 TEST(testLine1x),
caryclark@google.com7fce0de2012-11-29 14:31:50 +00003068 TEST(testLine81),
3069 TEST(testLine80),
caryclark@google.com2ddff932012-08-07 21:25:27 +00003070 TEST(testLine79),
3071 TEST(testLine78),
3072 TEST(testLine77),
3073 TEST(testLine76),
3074 TEST(testLine75),
caryclark@google.com0c803d02012-08-06 11:15:47 +00003075 TEST(testLine74),
caryclark@google.com200c2112012-08-03 15:05:04 +00003076 TEST(testLine73),
3077 TEST(testLine72),
caryclark@google.com534aa5b2012-08-02 20:08:21 +00003078 TEST(testLine71),
3079 TEST(testLine70),
3080 TEST(testLine69),
3081 TEST(testLine68h),
3082 TEST(testLine68g),
3083 TEST(testLine68f),
3084 TEST(testLine68e),
3085 TEST(testLine68d),
3086 TEST(testLine68c),
3087 TEST(testLine68b),
3088 TEST(testLine68a),
3089 TEST(testLine67),
caryclark@google.com27c449a2012-07-27 18:26:38 +00003090 TEST(testLine66),
3091 TEST(testLine65),
3092 TEST(testLine64),
3093 TEST(testLine63),
3094 TEST(testLine62),
3095 TEST(testLine61),
3096 TEST(testLine60),
caryclark@google.comcc905052012-07-25 20:59:42 +00003097 TEST(testLine59),
3098 TEST(testLine58),
caryclark@google.com18063442012-07-25 12:05:18 +00003099 TEST(testLine57),
3100 TEST(testLine56),
caryclark@google.come21cb182012-07-23 21:26:31 +00003101 TEST(testLine55),
3102 TEST(testLine54),
3103 TEST(testLine53),
3104 TEST(testLine52),
caryclark@google.com47580692012-07-23 12:14:49 +00003105 TEST(testLine51),
3106 TEST(testLine50),
3107 TEST(testLine49),
3108 TEST(testLine48),
3109 TEST(testLine47),
3110 TEST(testLine46),
3111 TEST(testLine45),
3112 TEST(testLine44),
3113 TEST(testLine43),
3114 TEST(testLine42),
3115 TEST(testLine41),
3116 TEST(testLine40),
3117 TEST(testLine38),
3118 TEST(testLine37),
3119 TEST(testLine36),
3120 TEST(testLine35),
3121 TEST(testLine34),
3122 TEST(testLine33),
3123 TEST(testLine32),
3124 TEST(testLine31),
3125 TEST(testLine30),
3126 TEST(testLine29),
3127 TEST(testLine28),
3128 TEST(testLine27),
3129 TEST(testLine26),
3130 TEST(testLine25),
caryclark@google.com8dcf1142012-07-02 20:27:02 +00003131 TEST(testLine24a),
3132 TEST(testLine24),
caryclark@google.com47580692012-07-23 12:14:49 +00003133 TEST(testLine23),
3134 TEST(testLine22),
3135 TEST(testLine21),
3136 TEST(testLine20),
3137 TEST(testLine19),
3138 TEST(testLine18),
3139 TEST(testLine17),
3140 TEST(testLine16),
3141 TEST(testLine15),
3142 TEST(testLine14),
3143 TEST(testLine13),
3144 TEST(testLine12),
3145 TEST(testLine11),
3146 TEST(testLine10a),
3147 TEST(testLine10),
3148 TEST(testLine9),
3149 TEST(testLine8),
3150 TEST(testLine7b),
3151 TEST(testLine7a),
3152 TEST(testLine7),
3153 TEST(testLine6),
3154 TEST(testLine5),
3155 TEST(testLine4),
caryclark@google.com534aa5b2012-08-02 20:08:21 +00003156 TEST(testLine3b),
3157 TEST(testLine3a),
caryclark@google.com47580692012-07-23 12:14:49 +00003158 TEST(testLine3),
3159 TEST(testLine2),
3160 TEST(testLine1),
caryclark@google.comaf46cff2012-05-22 21:12:00 +00003161};
3162
caryclark@google.com4eeda372012-12-06 21:47:48 +00003163static void testIntersect1() {
3164 SkPath one, two;
3165 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
3166 two.addRect(3, 3, 9, 9, SkPath::kCW_Direction);
3167 testShapeOp(one, two, kIntersect_Op);
3168}
3169
3170static void testUnion1() {
3171 SkPath one, two;
3172 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
3173 two.addRect(3, 3, 9, 9, SkPath::kCW_Direction);
3174 testShapeOp(one, two, kUnion_Op);
3175}
3176
3177static void testDiff1() {
3178 SkPath one, two;
3179 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
3180 two.addRect(3, 3, 9, 9, SkPath::kCW_Direction);
3181 testShapeOp(one, two, kDifference_Op);
3182}
3183
3184static void testXor1() {
3185 SkPath one, two;
3186 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
3187 two.addRect(3, 3, 9, 9, SkPath::kCW_Direction);
3188 testShapeOp(one, two, kXor_Op);
3189}
3190
3191static void testIntersect2() {
3192 SkPath one, two;
3193 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
3194 two.addRect(0, 3, 9, 9, SkPath::kCW_Direction);
3195 testShapeOp(one, two, kIntersect_Op);
3196}
3197
3198static void testUnion2() {
3199 SkPath one, two;
3200 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
3201 two.addRect(0, 3, 9, 9, SkPath::kCW_Direction);
3202 testShapeOp(one, two, kUnion_Op);
3203}
3204
3205static void testDiff2() {
3206 SkPath one, two;
3207 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
3208 two.addRect(0, 3, 9, 9, SkPath::kCW_Direction);
3209 testShapeOp(one, two, kDifference_Op);
3210}
3211
3212static void testXor2() {
3213 SkPath one, two;
3214 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
3215 two.addRect(0, 3, 9, 9, SkPath::kCW_Direction);
3216 testShapeOp(one, two, kXor_Op);
3217}
3218
3219static void testOp1d() {
3220 SkPath path, pathB;
3221 path.setFillType(SkPath::kWinding_FillType);
3222 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3223 path.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
3224 pathB.setFillType(SkPath::kWinding_FillType);
3225 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3226 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3227 testShapeOp(path, pathB, kDifference_Op);
3228}
3229
3230static void testOp2d() {
3231 SkPath path, pathB;
3232 path.setFillType(SkPath::kWinding_FillType);
3233 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3234 path.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
3235 pathB.setFillType(SkPath::kEvenOdd_FillType);
3236 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3237 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3238 testShapeOp(path, pathB, kDifference_Op);
3239}
3240
3241static void testOp3d() {
3242 SkPath path, pathB;
3243 path.setFillType(SkPath::kWinding_FillType);
3244 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3245 path.addRect(1, 1, 2, 2, SkPath::kCW_Direction);
3246 pathB.setFillType(SkPath::kWinding_FillType);
3247 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3248 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3249 testShapeOp(path, pathB, kDifference_Op);
3250}
3251
3252static void testOp1u() {
3253 SkPath path, pathB;
3254 path.setFillType(SkPath::kWinding_FillType);
3255 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3256 path.addRect(0, 0, 3, 3, SkPath::kCW_Direction);
3257 pathB.setFillType(SkPath::kWinding_FillType);
3258 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3259 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3260 testShapeOp(path, pathB, kUnion_Op);
3261}
3262
3263static void testOp4d() {
3264 SkPath path, pathB;
3265 path.setFillType(SkPath::kWinding_FillType);
3266 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3267 path.addRect(2, 2, 4, 4, SkPath::kCW_Direction);
3268 pathB.setFillType(SkPath::kWinding_FillType);
3269 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3270 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3271 testShapeOp(path, pathB, kDifference_Op);
3272}
3273
3274static void testOp5d() {
3275 SkPath path, pathB;
3276 path.setFillType(SkPath::kEvenOdd_FillType);
3277 path.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
3278 path.addRect(0, 0, 3, 3, SkPath::kCW_Direction);
3279 pathB.setFillType(SkPath::kEvenOdd_FillType);
3280 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3281 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3282 testShapeOp(path, pathB, kDifference_Op);
3283}
3284
3285static void testOp6d() {
3286 SkPath path, pathB;
3287 path.setFillType(SkPath::kEvenOdd_FillType);
3288 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3289 path.addRect(0, 0, 3, 3, SkPath::kCW_Direction);
3290 pathB.setFillType(SkPath::kWinding_FillType);
3291 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3292 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3293 testShapeOp(path, pathB, kDifference_Op);
3294}
3295
3296static void testOp7d() {
3297 SkPath path, pathB;
3298 path.setFillType(SkPath::kEvenOdd_FillType);
3299 path.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
3300 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3301 pathB.setFillType(SkPath::kEvenOdd_FillType);
3302 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3303 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3304 testShapeOp(path, pathB, kDifference_Op);
3305}
3306
caryclark@google.comaf46cff2012-05-22 21:12:00 +00003307static const size_t testCount = sizeof(tests) / sizeof(tests[0]);
3308
caryclark@google.com534aa5b2012-08-02 20:08:21 +00003309static struct {
3310 void (*fun)();
3311 const char* str;
3312} subTests[] = {
caryclark@google.com235f56a2012-09-14 14:19:30 +00003313 TEST(testDiff1),
caryclark@google.com235f56a2012-09-14 14:19:30 +00003314 TEST(testIntersect1),
caryclark@google.com31143cf2012-11-09 22:14:19 +00003315 TEST(testUnion1),
caryclark@google.com57cff8d2012-11-14 21:14:56 +00003316 TEST(testXor1),
3317 TEST(testDiff2),
3318 TEST(testIntersect2),
3319 TEST(testUnion2),
3320 TEST(testXor2),
caryclark@google.comb1c42bb2012-11-16 13:16:41 +00003321 TEST(testOp1d),
caryclark@google.com729e1c42012-11-21 21:36:34 +00003322 TEST(testOp2d),
3323 TEST(testOp3d),
caryclark@google.com4eeda372012-12-06 21:47:48 +00003324 TEST(testOp1u),
3325 TEST(testOp4d),
3326 TEST(testOp5d),
3327 TEST(testOp6d),
3328 TEST(testOp7d),
caryclark@google.com534aa5b2012-08-02 20:08:21 +00003329};
3330
3331static const size_t subTestCount = sizeof(subTests) / sizeof(subTests[0]);
3332
caryclark@google.com9f3e9a52012-12-10 12:50:53 +00003333static void (*firstBinaryTest)() = testOp2d;
caryclark@google.com57cff8d2012-11-14 21:14:56 +00003334
caryclark@google.comaf46cff2012-05-22 21:12:00 +00003335static bool skipAll = false;
caryclark@google.com31143cf2012-11-09 22:14:19 +00003336static bool runBinaryTestsFirst = true;
3337static bool runReverse = false;
caryclark@google.comaf46cff2012-05-22 21:12:00 +00003338
3339void SimplifyNew_Test() {
3340 if (skipAll) {
3341 return;
3342 }
caryclark@google.com47580692012-07-23 12:14:49 +00003343#ifdef SK_DEBUG
caryclark@google.com27c449a2012-07-27 18:26:38 +00003344 gDebugMaxWindSum = 4;
3345 gDebugMaxWindValue = 4;
caryclark@google.com534aa5b2012-08-02 20:08:21 +00003346 size_t index;
caryclark@google.com47580692012-07-23 12:14:49 +00003347#endif
caryclark@google.com7fce0de2012-11-29 14:31:50 +00003348 if (runBinaryTestsFirst && firstBinaryTest) {
caryclark@google.com57cff8d2012-11-14 21:14:56 +00003349 index = subTestCount - 1;
3350 while (index > 0 && subTests[index].fun != firstBinaryTest) {
3351 --index;
3352 }
3353 SkDebugf(" %s [%s]\n", __FUNCTION__, subTests[index].str);
3354 (*subTests[index].fun)();
3355 }
caryclark@google.com31143cf2012-11-09 22:14:19 +00003356 if (runBinaryTestsFirst) {
caryclark@google.com534aa5b2012-08-02 20:08:21 +00003357 index = subTestCount - 1;
3358 do {
3359 SkDebugf(" %s [%s]\n", __FUNCTION__, subTests[index].str);
3360 (*subTests[index].fun)();
3361 } while (index--);
3362 }
3363 index = testCount - 1;
caryclark@google.comaf46cff2012-05-22 21:12:00 +00003364 if (firstTest) {
caryclark@google.come21cb182012-07-23 21:26:31 +00003365 while (index > 0 && tests[index].fun != firstTest) {
3366 --index;
caryclark@google.comaf46cff2012-05-22 21:12:00 +00003367 }
caryclark@google.com24bec792012-08-20 12:43:57 +00003368 SkDebugf(" %s [%s]\n", __FUNCTION__, tests[index].str);
caryclark@google.com59823f72012-08-09 18:17:47 +00003369 (*tests[index].fun)();
caryclark@google.comaf46cff2012-05-22 21:12:00 +00003370 }
caryclark@google.com235f56a2012-09-14 14:19:30 +00003371 index = runReverse ? testCount - 1 : 0;
3372 size_t last = runReverse ? 0 : testCount - 1;
caryclark@google.comaf46cff2012-05-22 21:12:00 +00003373 bool firstTestComplete = false;
caryclark@google.come21cb182012-07-23 21:26:31 +00003374 do {
3375 SkDebugf(" %s [%s]\n", __FUNCTION__, tests[index].str);
caryclark@google.com8dcf1142012-07-02 20:27:02 +00003376 (*tests[index].fun)();
caryclark@google.comaf46cff2012-05-22 21:12:00 +00003377 firstTestComplete = true;
caryclark@google.com235f56a2012-09-14 14:19:30 +00003378 if (index == last) {
3379 break;
3380 }
3381 index += runReverse ? -1 : 1;
3382 } while (true);
caryclark@google.com31143cf2012-11-09 22:14:19 +00003383 if (!runBinaryTestsFirst) {
3384 index = subTestCount - 1;
3385 do {
3386 SkDebugf(" %s [%s]\n", __FUNCTION__, subTests[index].str);
3387 (*subTests[index].fun)();
3388 } while (index--);
3389 }
caryclark@google.com47580692012-07-23 12:14:49 +00003390#ifdef SK_DEBUG
3391 gDebugMaxWindSum = SK_MaxS32;
3392 gDebugMaxWindValue = SK_MaxS32;
3393#endif
caryclark@google.comaf46cff2012-05-22 21:12:00 +00003394}