blob: 7e301418625e98d4011fec42fead5810ef2323e1 [file] [log] [blame]
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001/*
2 * Copyright 2012 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7#include "PathOpsExtendedTest.h"
tfarina@chromium.org78e7b4e2014-01-02 21:45:03 +00008#include "TestClassDef.h"
caryclark@google.com818b0cc2013-04-08 11:50:46 +00009
10#define TEST(name) { name, #name }
11
12static void cubicOp1d(skiatest::Reporter* reporter) {
13 SkPath path, pathB;
14 path.setFillType(SkPath::kWinding_FillType);
15 path.moveTo(0,1);
16 path.cubicTo(0,2, 1,0, 1,0);
17 path.close();
18 pathB.setFillType(SkPath::kWinding_FillType);
19 pathB.moveTo(0,1);
20 pathB.cubicTo(0,1, 1,0, 2,0);
21 pathB.close();
22 testPathOp(reporter, path, pathB, kDifference_PathOp);
23}
24
25static void cubicOp2d(skiatest::Reporter* reporter) {
26 SkPath path, pathB;
27 path.setFillType(SkPath::kWinding_FillType);
28 path.moveTo(0,2);
29 path.cubicTo(0,1, 1,0, 1,0);
30 path.close();
31 pathB.setFillType(SkPath::kWinding_FillType);
32 pathB.moveTo(0,1);
33 pathB.cubicTo(0,1, 2,0, 1,0);
34 pathB.close();
35 testPathOp(reporter, path, pathB, kDifference_PathOp);
36}
37
38static void cubicOp3d(skiatest::Reporter* reporter) {
39 SkPath path, pathB;
40 path.setFillType(SkPath::kWinding_FillType);
41 path.moveTo(0,1);
42 path.cubicTo(2,3, 1,0, 1,0);
43 path.close();
44 pathB.setFillType(SkPath::kWinding_FillType);
45 pathB.moveTo(0,1);
46 pathB.cubicTo(0,1, 1,0, 3,2);
47 pathB.close();
48 testPathOp(reporter, path, pathB, kDifference_PathOp);
49}
50
51static void cubicOp5d(skiatest::Reporter* reporter) {
52 SkPath path, pathB;
53 path.setFillType(SkPath::kWinding_FillType);
54 path.moveTo(0,1);
55 path.cubicTo(0,2, 1,0, 2,0);
56 path.close();
57 pathB.setFillType(SkPath::kWinding_FillType);
58 pathB.moveTo(0,1);
59 pathB.cubicTo(0,2, 1,0, 2,0);
60 pathB.close();
61 testPathOp(reporter, path, pathB, kDifference_PathOp);
62}
63
64static void cubicOp6d(skiatest::Reporter* reporter) {
65 SkPath path, pathB;
66 path.setFillType(SkPath::kWinding_FillType);
67 path.moveTo(0,1);
68 path.cubicTo(0,6, 1,0, 3,0);
69 path.close();
70 pathB.setFillType(SkPath::kWinding_FillType);
71 pathB.moveTo(0,1);
72 pathB.cubicTo(0,3, 1,0, 6,0);
73 pathB.close();
74 testPathOp(reporter, path, pathB, kDifference_PathOp);
75}
76
77static void cubicOp7d(skiatest::Reporter* reporter) {
78 SkPath path, pathB;
79 path.setFillType(SkPath::kWinding_FillType);
80 path.moveTo(0,1);
81 path.cubicTo(3,4, 1,0, 3,0);
82 path.close();
83 pathB.setFillType(SkPath::kWinding_FillType);
84 pathB.moveTo(0,1);
85 pathB.cubicTo(0,3, 1,0, 4,3);
86 pathB.close();
87 testPathOp(reporter, path, pathB, kDifference_PathOp);
88}
89
90static void cubicOp8d(skiatest::Reporter* reporter) {
91 SkPath path, pathB;
92 path.setFillType(SkPath::kWinding_FillType);
93 path.moveTo(0,1);
94 path.cubicTo(0,5, 1,0, 4,0);
95 path.close();
96 pathB.setFillType(SkPath::kWinding_FillType);
97 pathB.moveTo(0,1);
98 pathB.cubicTo(0,4, 1,0, 5,0);
99 pathB.close();
100 testPathOp(reporter, path, pathB, kDifference_PathOp);
101}
102
103static void cubicOp9d(skiatest::Reporter* reporter) {
104 SkPath path, pathB;
105 path.setFillType(SkPath::kWinding_FillType);
106 path.moveTo(0,1);
107 path.cubicTo(1,6, 1,0, 2,1);
108 path.close();
109 pathB.setFillType(SkPath::kWinding_FillType);
110 pathB.moveTo(0,1);
111 pathB.cubicTo(1,2, 1,0, 6,1);
112 pathB.close();
113 testPathOp(reporter, path, pathB, kDifference_PathOp);
114}
115
116static void quadOp9d(skiatest::Reporter* reporter) {
117 SkPath path, pathB;
118 path.setFillType(SkPath::kWinding_FillType);
119 path.moveTo(0,1);
120 path.quadTo(1,6, 1.5f,1);
121 path.quadTo(1.5f,0.5f, 2,1);
122 path.close();
123 pathB.setFillType(SkPath::kWinding_FillType);
124 pathB.moveTo(0,1);
125 pathB.quadTo(1,2, 1.4f,1);
126 pathB.quadTo(3,0.4f, 6,1);
127 pathB.close();
128 testPathOp(reporter, path, pathB, kDifference_PathOp);
129}
130
131static void lineOp9d(skiatest::Reporter* reporter) {
132 SkPath path, pathB;
133 path.setFillType(SkPath::kWinding_FillType);
134 path.moveTo(0,1);
135 path.lineTo(1,6);
136 path.lineTo(1.5f,1);
137 path.lineTo(1.8f,0.8f);
138 path.lineTo(2,1);
139 path.close();
140 pathB.setFillType(SkPath::kWinding_FillType);
141 pathB.moveTo(0,1);
142 pathB.lineTo(1,2);
143 pathB.lineTo(1.4f,1);
144 pathB.lineTo(3,0.4f);
145 pathB.lineTo(6,1);
146 pathB.close();
147 testPathOp(reporter, path, pathB, kDifference_PathOp);
148}
149
150static void cubicOp1i(skiatest::Reporter* reporter) {
151 SkPath path, pathB;
152 path.setFillType(SkPath::kWinding_FillType);
153 path.moveTo(0,1);
154 path.cubicTo(1,2, 1,0, 2,1);
155 path.close();
156 pathB.setFillType(SkPath::kWinding_FillType);
157 pathB.moveTo(0,1);
158 pathB.cubicTo(1,2, 1,0, 2,1);
159 pathB.close();
160 testPathOp(reporter, path, pathB, kIntersect_PathOp);
161}
162
163static void cubicOp10d(skiatest::Reporter* reporter) {
164 SkPath path, pathB;
165 path.setFillType(SkPath::kWinding_FillType);
166 path.moveTo(0,1);
167 path.cubicTo(1,3, 1,0, 4,1);
168 path.close();
169 pathB.setFillType(SkPath::kWinding_FillType);
170 pathB.moveTo(0,1);
171 pathB.cubicTo(1,4, 1,0, 3,1);
172 pathB.close();
173 testPathOp(reporter, path, pathB, kDifference_PathOp);
174}
175
176static void cubicOp11d(skiatest::Reporter* reporter) {
177 SkPath path, pathB;
178 path.setFillType(SkPath::kWinding_FillType);
179 path.moveTo(0,1);
180 path.cubicTo(3,4, 1,0, 5,1);
181 path.close();
182 pathB.setFillType(SkPath::kWinding_FillType);
183 pathB.moveTo(0,1);
184 pathB.cubicTo(1,5, 1,0, 4,3);
185 pathB.close();
186 testPathOp(reporter, path, pathB, kDifference_PathOp);
187}
188
189static void cubicOp12d(skiatest::Reporter* reporter) {
190 SkPath path, pathB;
191 path.setFillType(SkPath::kWinding_FillType);
192 path.moveTo(0,1);
193 path.cubicTo(1,6, 1,0, 1,0);
194 path.close();
195 pathB.setFillType(SkPath::kWinding_FillType);
196 pathB.moveTo(0,1);
197 pathB.cubicTo(0,1, 1,0, 6,1);
198 pathB.close();
199 testPathOp(reporter, path, pathB, kDifference_PathOp);
200}
201
202static void cubicOp13d(skiatest::Reporter* reporter) {
203 SkPath path, pathB;
204 path.setFillType(SkPath::kWinding_FillType);
205 path.moveTo(0,1);
206 path.cubicTo(4,5, 1,0, 5,3);
207 path.close();
208 pathB.setFillType(SkPath::kWinding_FillType);
209 pathB.moveTo(0,1);
210 pathB.cubicTo(3,5, 1,0, 5,4);
211 pathB.close();
212 testPathOp(reporter, path, pathB, kDifference_PathOp);
213}
214
215static void cubicOp14d(skiatest::Reporter* reporter) {
216 SkPath path, pathB;
217 path.setFillType(SkPath::kWinding_FillType);
218 path.moveTo(0,1);
219 path.cubicTo(0,2, 2,0, 2,1);
220 path.close();
221 pathB.setFillType(SkPath::kWinding_FillType);
222 pathB.moveTo(0,2);
223 pathB.cubicTo(1,2, 1,0, 2,0);
224 pathB.close();
225 testPathOp(reporter, path, pathB, kDifference_PathOp);
226}
227
228static void cubicOp15d(skiatest::Reporter* reporter) {
229 SkPath path, pathB;
230 path.setFillType(SkPath::kWinding_FillType);
231 path.moveTo(0,1);
232 path.cubicTo(3,6, 2,0, 2,1);
233 path.close();
234 pathB.setFillType(SkPath::kWinding_FillType);
235 pathB.moveTo(0,2);
236 pathB.cubicTo(1,2, 1,0, 6,3);
237 pathB.close();
238 testPathOp(reporter, path, pathB, kDifference_PathOp);
239}
240
241static void cubicOp16d(skiatest::Reporter* reporter) {
242 SkPath path, pathB;
243 path.setFillType(SkPath::kWinding_FillType);
244 path.moveTo(0,2);
245 path.cubicTo(0,1, 3,0, 1,0);
246 path.close();
247 pathB.setFillType(SkPath::kWinding_FillType);
248 pathB.moveTo(0,3);
249 pathB.cubicTo(0,1, 2,0, 1,0);
250 pathB.close();
251 testPathOp(reporter, path, pathB, kDifference_PathOp);
252}
253
254static void cubicOp17d(skiatest::Reporter* reporter) {
255 SkPath path, pathB;
256 path.setFillType(SkPath::kWinding_FillType);
257 path.moveTo(0,2);
258 path.cubicTo(0,2, 4,0, 2,1);
259 path.close();
260 pathB.setFillType(SkPath::kWinding_FillType);
261 pathB.moveTo(0,4);
262 pathB.cubicTo(1,2, 2,0, 2,0);
263 pathB.close();
264 testPathOp(reporter, path, pathB, kDifference_PathOp);
265}
266
267static void cubicOp18d(skiatest::Reporter* reporter) {
268 SkPath path, pathB;
269 path.setFillType(SkPath::kWinding_FillType);
270 path.moveTo(0,1);
271 path.cubicTo(3,5, 2,0, 2,1);
272 path.close();
273 pathB.setFillType(SkPath::kWinding_FillType);
274 pathB.moveTo(0,2);
275 pathB.cubicTo(1,2, 1,0, 5,3);
276 pathB.close();
277 testPathOp(reporter, path, pathB, kDifference_PathOp);
278}
279
280static void cubicOp19i(skiatest::Reporter* reporter) {
281 SkPath path, pathB;
282 path.setFillType(SkPath::kWinding_FillType);
283 path.moveTo(0,2);
284 path.cubicTo(0,1, 2,1, 6,2);
285 path.close();
286 pathB.setFillType(SkPath::kWinding_FillType);
287 pathB.moveTo(1,2);
288 pathB.cubicTo(2,6, 2,0, 1,0);
289 pathB.close();
290 testPathOp(reporter, path, pathB, kIntersect_PathOp);
291}
292
293static void cubicOp20d(skiatest::Reporter* reporter) {
294 SkPath path, pathB;
295 path.setFillType(SkPath::kWinding_FillType);
296 path.moveTo(0,1);
297 path.cubicTo(0,1, 6,0, 2,1);
298 path.close();
299 pathB.setFillType(SkPath::kWinding_FillType);
300 pathB.moveTo(0,6);
301 pathB.cubicTo(1,2, 1,0, 1,0);
302 pathB.close();
303 testPathOp(reporter, path, pathB, kDifference_PathOp);
304}
305
306static void cubicOp21d(skiatest::Reporter* reporter) {
307 SkPath path, pathB;
308 path.setFillType(SkPath::kWinding_FillType);
309 path.moveTo(0,1);
310 path.cubicTo(0,1, 2,1, 6,5);
311 path.close();
312 pathB.setFillType(SkPath::kWinding_FillType);
313 pathB.moveTo(1,2);
314 pathB.cubicTo(5,6, 1,0, 1,0);
315 pathB.close();
316 testPathOp(reporter, path, pathB, kDifference_PathOp);
317}
318
319static void cubicOp22d(skiatest::Reporter* reporter) {
320 SkPath path, pathB;
321 path.setFillType(SkPath::kWinding_FillType);
322 path.moveTo(0,1);
323 path.cubicTo(2,3, 3,0, 2,1);
324 path.close();
325 pathB.setFillType(SkPath::kWinding_FillType);
326 pathB.moveTo(0,3);
327 pathB.cubicTo(1,2, 1,0, 3,2);
328 pathB.close();
329 testPathOp(reporter, path, pathB, kDifference_PathOp);
330}
331
332static void cubicOp23d(skiatest::Reporter* reporter) {
333 SkPath path, pathB;
334 path.setFillType(SkPath::kWinding_FillType);
335 path.moveTo(0,1);
336 path.cubicTo(1,2, 4,0, 2,1);
337 path.close();
338 pathB.setFillType(SkPath::kWinding_FillType);
339 pathB.moveTo(0,4);
340 pathB.cubicTo(1,2, 1,0, 2,1);
341 pathB.close();
342 testPathOp(reporter, path, pathB, kDifference_PathOp);
343}
344
345static void cubicOp24d(skiatest::Reporter* reporter) {
346 SkPath path, pathB;
347 path.setFillType(SkPath::kWinding_FillType);
348 path.moveTo(0,1);
349 path.cubicTo(1,2, 2,0, 3,2);
350 path.close();
351 pathB.setFillType(SkPath::kWinding_FillType);
352 pathB.moveTo(0,2);
353 pathB.cubicTo(2,3, 1,0, 2,1);
354 pathB.close();
355 testPathOp(reporter, path, pathB, kDifference_PathOp);
356}
357
358static void testIntersect1(skiatest::Reporter* reporter) {
359 SkPath one, two;
360 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
361 two.addRect(3, 3, 9, 9, SkPath::kCW_Direction);
362 testPathOp(reporter, one, two, kIntersect_PathOp);
363}
364
365static void testUnion1(skiatest::Reporter* reporter) {
366 SkPath one, two;
367 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
368 two.addRect(3, 3, 9, 9, SkPath::kCW_Direction);
369 testPathOp(reporter, one, two, kUnion_PathOp);
370}
371
372static void testDiff1(skiatest::Reporter* reporter) {
373 SkPath one, two;
374 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
375 two.addRect(3, 3, 9, 9, SkPath::kCW_Direction);
376 testPathOp(reporter, one, two, kDifference_PathOp);
377}
378
379static void testXor1(skiatest::Reporter* reporter) {
380 SkPath one, two;
381 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
382 two.addRect(3, 3, 9, 9, SkPath::kCW_Direction);
383 testPathOp(reporter, one, two, kXOR_PathOp);
384}
385
386static void testIntersect2(skiatest::Reporter* reporter) {
387 SkPath one, two;
388 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
389 two.addRect(0, 3, 9, 9, SkPath::kCW_Direction);
390 testPathOp(reporter, one, two, kIntersect_PathOp);
391}
392
393static void testUnion2(skiatest::Reporter* reporter) {
394 SkPath one, two;
395 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
396 two.addRect(0, 3, 9, 9, SkPath::kCW_Direction);
397 testPathOp(reporter, one, two, kUnion_PathOp);
398}
399
400static void testDiff2(skiatest::Reporter* reporter) {
401 SkPath one, two;
402 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
403 two.addRect(0, 3, 9, 9, SkPath::kCW_Direction);
404 testPathOp(reporter, one, two, kDifference_PathOp);
405}
406
407static void testXor2(skiatest::Reporter* reporter) {
408 SkPath one, two;
409 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
410 two.addRect(0, 3, 9, 9, SkPath::kCW_Direction);
411 testPathOp(reporter, one, two, kXOR_PathOp);
412}
413
414static void testOp1d(skiatest::Reporter* reporter) {
415 SkPath path, pathB;
416 path.setFillType(SkPath::kWinding_FillType);
417 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
418 path.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
419 pathB.setFillType(SkPath::kWinding_FillType);
420 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
421 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
422 testPathOp(reporter, path, pathB, kDifference_PathOp);
423}
424
425static void testOp2d(skiatest::Reporter* reporter) {
426 SkPath path, pathB;
427 path.setFillType(SkPath::kWinding_FillType);
428 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
429 path.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
430 pathB.setFillType(SkPath::kEvenOdd_FillType);
431 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
432 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
433 testPathOp(reporter, path, pathB, kDifference_PathOp);
434}
435
436static void testOp3d(skiatest::Reporter* reporter) {
437 SkPath path, pathB;
438 path.setFillType(SkPath::kWinding_FillType);
439 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
440 path.addRect(1, 1, 2, 2, SkPath::kCW_Direction);
441 pathB.setFillType(SkPath::kWinding_FillType);
442 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
443 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
444 testPathOp(reporter, path, pathB, kDifference_PathOp);
445}
446
447static void testOp1u(skiatest::Reporter* reporter) {
448 SkPath path, pathB;
449 path.setFillType(SkPath::kWinding_FillType);
450 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
451 path.addRect(0, 0, 3, 3, SkPath::kCW_Direction);
452 pathB.setFillType(SkPath::kWinding_FillType);
453 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
454 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
455 testPathOp(reporter, path, pathB, kUnion_PathOp);
456}
457
458static void testOp4d(skiatest::Reporter* reporter) {
459 SkPath path, pathB;
460 path.setFillType(SkPath::kWinding_FillType);
461 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
462 path.addRect(2, 2, 4, 4, SkPath::kCW_Direction);
463 pathB.setFillType(SkPath::kWinding_FillType);
464 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
465 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
466 testPathOp(reporter, path, pathB, kDifference_PathOp);
467}
468
469static void testOp5d(skiatest::Reporter* reporter) {
470 SkPath path, pathB;
471 path.setFillType(SkPath::kEvenOdd_FillType);
472 path.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
473 path.addRect(0, 0, 3, 3, SkPath::kCW_Direction);
474 pathB.setFillType(SkPath::kEvenOdd_FillType);
475 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
476 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
477 testPathOp(reporter, path, pathB, kDifference_PathOp);
478}
479
480static void testOp6d(skiatest::Reporter* reporter) {
481 SkPath path, pathB;
482 path.setFillType(SkPath::kEvenOdd_FillType);
483 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
484 path.addRect(0, 0, 3, 3, SkPath::kCW_Direction);
485 pathB.setFillType(SkPath::kWinding_FillType);
486 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
487 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
488 testPathOp(reporter, path, pathB, kDifference_PathOp);
489}
490
491static void testOp7d(skiatest::Reporter* reporter) {
492 SkPath path, pathB;
493 path.setFillType(SkPath::kEvenOdd_FillType);
494 path.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
495 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
496 pathB.setFillType(SkPath::kEvenOdd_FillType);
497 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
498 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
499 testPathOp(reporter, path, pathB, kDifference_PathOp);
500}
501
502static void testOp2u(skiatest::Reporter* reporter) {
503 SkPath path, pathB;
504 path.setFillType(SkPath::kEvenOdd_FillType);
505 path.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
506 path.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
507 pathB.setFillType(SkPath::kWinding_FillType);
508 pathB.addRect(0, 0, 3, 3, SkPath::kCW_Direction);
509 pathB.addRect(1, 1, 2, 2, SkPath::kCW_Direction);
510 testPathOp(reporter, path, pathB, kUnion_PathOp);
511}
512
513static void testOp8d(skiatest::Reporter* reporter) {
514 SkPath path, pathB;
515 path.addRect(0, 0, 640, 480);
516 pathB.moveTo(577330, 1971.72f);
517 pathB.cubicTo(10.7082f, -116.596f, 262.057f, 45.6468f, 294.694f, 1.96237f);
518 pathB.close();
519 testPathOp(reporter, path, pathB, kDifference_PathOp);
520}
521static void cubicOp25i(skiatest::Reporter* reporter) {
522 SkPath path, pathB;
523 path.setFillType(SkPath::kWinding_FillType);
524 path.moveTo(0,1);
525 path.cubicTo(2,4, 5,0, 3,2);
526 path.close();
527 pathB.setFillType(SkPath::kWinding_FillType);
528 pathB.moveTo(0,5);
529 pathB.cubicTo(2,3, 1,0, 4,2);
530 pathB.close();
531 testPathOp(reporter, path, pathB, kIntersect_PathOp);
532}
533
534static void cubicOp26d(skiatest::Reporter* reporter) {
535 SkPath path, pathB;
536 path.setFillType(SkPath::kWinding_FillType);
537 path.moveTo(0,1);
538 path.cubicTo(3,4, 4,0, 3,2);
539 path.close();
540 pathB.setFillType(SkPath::kWinding_FillType);
541 pathB.moveTo(0,4);
542 pathB.cubicTo(2,3, 1,0, 4,3);
543 pathB.close();
544 testPathOp(reporter, path, pathB, kDifference_PathOp);
545}
546
547static void cubicOp27d(skiatest::Reporter* reporter) {
548 SkPath path, pathB;
549 path.setFillType(SkPath::kWinding_FillType);
550 path.moveTo(0,1);
551 path.cubicTo(3,6, 1,0, 5,2);
552 path.close();
553 pathB.setFillType(SkPath::kWinding_FillType);
554 pathB.moveTo(0,1);
555 pathB.cubicTo(2,5, 1,0, 6,3);
556 pathB.close();
557 testPathOp(reporter, path, pathB, kDifference_PathOp);
558}
559
560static void cubicOp28u(skiatest::Reporter* reporter) {
561 SkPath path, pathB;
562 path.setFillType(SkPath::kWinding_FillType);
563 path.moveTo(0,1);
564 path.cubicTo(1,4, 6,0, 3,2);
565 path.close();
566 pathB.setFillType(SkPath::kWinding_FillType);
567 pathB.moveTo(0,6);
568 pathB.cubicTo(2,3, 1,0, 4,1);
569 pathB.close();
570 testPathOp(reporter, path, pathB, kUnion_PathOp);
571}
572
573static void cubicOp29d(skiatest::Reporter* reporter) {
574 SkPath path, pathB;
575 path.setFillType(SkPath::kWinding_FillType);
576 path.moveTo(0,1);
577 path.cubicTo(2,5, 6,0, 4,2);
578 path.close();
579 pathB.setFillType(SkPath::kWinding_FillType);
580 pathB.moveTo(0,6);
581 pathB.cubicTo(2,4, 1,0, 5,2);
582 pathB.close();
583 testPathOp(reporter, path, pathB, kDifference_PathOp);
584}
585
586static void cubicOp30d(skiatest::Reporter* reporter) {
587 SkPath path, pathB;
588 path.setFillType(SkPath::kWinding_FillType);
589 path.moveTo(0,1);
590 path.cubicTo(2,5, 6,0, 5,3);
591 path.close();
592 pathB.setFillType(SkPath::kWinding_FillType);
593 pathB.moveTo(0,6);
594 pathB.cubicTo(3,5, 1,0, 5,2);
595 pathB.close();
596 testPathOp(reporter, path, pathB, kDifference_PathOp);
597}
598
599static void cubicOp31d(skiatest::Reporter* reporter) {
600 SkPath path, pathB;
601 path.setFillType(SkPath::kWinding_FillType);
602 path.moveTo(0,2);
603 path.cubicTo(0,3, 2,1, 4,0);
604 path.close();
605 pathB.setFillType(SkPath::kWinding_FillType);
606 pathB.moveTo(1,2);
607 pathB.cubicTo(0,4, 2,0, 3,0);
608 pathB.close();
609 testPathOp(reporter, path, pathB, kDifference_PathOp);
610}
611
612static void cubicOp31u(skiatest::Reporter* reporter) {
613 SkPath path, pathB;
614 path.setFillType(SkPath::kWinding_FillType);
615 path.moveTo(0,2);
616 path.cubicTo(0,3, 2,1, 4,0);
617 path.close();
618 pathB.setFillType(SkPath::kWinding_FillType);
619 pathB.moveTo(1,2);
620 pathB.cubicTo(0,4, 2,0, 3,0);
621 pathB.close();
622 testPathOp(reporter, path, pathB, kUnion_PathOp);
623}
624
625static void cubicOp31x(skiatest::Reporter* reporter) {
626 SkPath path, pathB;
627 path.setFillType(SkPath::kWinding_FillType);
628 path.moveTo(0,2);
629 path.cubicTo(0,3, 2,1, 4,0);
630 path.close();
631 pathB.setFillType(SkPath::kWinding_FillType);
632 pathB.moveTo(1,2);
633 pathB.cubicTo(0,4, 2,0, 3,0);
634 pathB.close();
635 testPathOp(reporter, path, pathB, kXOR_PathOp);
636}
637
638static void cubicOp32d(skiatest::Reporter* reporter) {
639 SkPath path, pathB;
640 path.setFillType(SkPath::kWinding_FillType);
641 path.moveTo(0,1);
642 path.cubicTo(1,2, 6,0, 3,1);
643 path.close();
644 pathB.setFillType(SkPath::kWinding_FillType);
645 pathB.moveTo(0,6);
646 pathB.cubicTo(1,3, 1,0, 2,1);
647 pathB.close();
648 testPathOp(reporter, path, pathB, kDifference_PathOp);
649}
650
651static void cubicOp33i(skiatest::Reporter* reporter) {
652 SkPath path, pathB;
653 path.setFillType(SkPath::kWinding_FillType);
654 path.moveTo(0,1);
655 path.cubicTo(1,2, 6,0, 3,1);
656 path.close();
657 pathB.setFillType(SkPath::kWinding_FillType);
658 pathB.moveTo(0,6);
659 pathB.cubicTo(1,3, 1,0, 2,1);
660 pathB.close();
661 testPathOp(reporter, path, pathB, kIntersect_PathOp);
662}
663
664static void cubicOp34d(skiatest::Reporter* reporter) {
665 SkPath path, pathB;
666 path.setFillType(SkPath::kWinding_FillType);
667 path.moveTo(0,1);
668 path.cubicTo(3,5, 2,1, 3,1);
669 path.close();
670 pathB.setFillType(SkPath::kWinding_FillType);
671 pathB.moveTo(1,2);
672 pathB.cubicTo(1,3, 1,0, 5,3);
673 pathB.close();
674 testPathOp(reporter, path, pathB, kDifference_PathOp);
675}
676
677static void cubicOp35d(skiatest::Reporter* reporter) {
678 SkPath path, pathB;
679 path.setFillType(SkPath::kWinding_FillType);
680 path.moveTo(0,1);
681 path.cubicTo(1,5, 2,1, 4,0);
682 path.close();
683 pathB.setFillType(SkPath::kWinding_FillType);
684 pathB.moveTo(1,2);
685 pathB.cubicTo(0,4, 1,0, 5,1);
686 pathB.close();
687 testPathOp(reporter, path, pathB, kDifference_PathOp);
688}
689
690static void cubicOp36u(skiatest::Reporter* reporter) {
691 SkPath path, pathB;
692 path.setFillType(SkPath::kWinding_FillType);
693 path.moveTo(0,1);
694 path.cubicTo(1,6, 2,0, 5,1);
695 path.close();
696 pathB.setFillType(SkPath::kWinding_FillType);
697 pathB.moveTo(0,2);
698 pathB.cubicTo(1,5, 1,0, 6,1);
699 pathB.close();
700 testPathOp(reporter, path, pathB, kUnion_PathOp);
701}
702
703static void cubicOp37d(skiatest::Reporter* reporter) {
704 SkPath path, pathB;
705 path.setFillType(SkPath::kWinding_FillType);
706 path.moveTo(0,1);
707 path.cubicTo(2,6, 6,1, 4,3);
708 path.close();
709 pathB.setFillType(SkPath::kWinding_FillType);
710 pathB.moveTo(1,6);
711 pathB.cubicTo(3,4, 1,0, 6,2);
712 pathB.close();
713 testPathOp(reporter, path, pathB, kDifference_PathOp);
714}
715
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000716// this fails to detect a cubic/cubic intersection
717// the slight overlap is missed when the cubics are approximated by quadratics
718// and the subsequent line/cubic intersection also (correctly) misses the intersection
719// if the line/cubic was a matching line/approx.quadratic then the missing intersection
720// could have been detected
721static void cubicOp38d(skiatest::Reporter* reporter) {
722 SkPath path, pathB;
723 path.setFillType(SkPath::kWinding_FillType);
724 path.moveTo(0,1);
725 path.cubicTo(0,6, 3,2, 4,1);
726 path.close();
727 pathB.setFillType(SkPath::kWinding_FillType);
728 pathB.moveTo(2,3);
729 pathB.cubicTo(1,4, 1,0, 6,0);
730 pathB.close();
731 testPathOp(reporter, path, pathB, kDifference_PathOp);
732}
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000733
734static void cubicOp39d(skiatest::Reporter* reporter) {
735 SkPath path, pathB;
736 path.setFillType(SkPath::kWinding_FillType);
737 path.moveTo(0,1);
738 path.cubicTo(2,3, 5,1, 4,3);
739 path.close();
740 pathB.setFillType(SkPath::kWinding_FillType);
741 pathB.moveTo(1,5);
742 pathB.cubicTo(3,4, 1,0, 3,2);
743 pathB.close();
744 testPathOp(reporter, path, pathB, kDifference_PathOp);
745}
746
747static void cubicOp40d(skiatest::Reporter* reporter) {
748 SkPath path, pathB;
749 path.setFillType(SkPath::kWinding_FillType);
750 path.moveTo(0,1);
751 path.cubicTo(1,5, 3,2, 4,2);
752 path.close();
753 pathB.setFillType(SkPath::kWinding_FillType);
754 pathB.moveTo(2,3);
755 pathB.cubicTo(2,4, 1,0, 5,1);
756 pathB.close();
757 testPathOp(reporter, path, pathB, kDifference_PathOp);
758}
759
760static void cubicOp41i(skiatest::Reporter* reporter) {
761 SkPath path, pathB;
762 path.setFillType(SkPath::kWinding_FillType);
763 path.moveTo(0,1);
764 path.cubicTo(2,6, 4,3, 6,4);
765 path.close();
766 pathB.setFillType(SkPath::kWinding_FillType);
767 pathB.moveTo(3,4);
768 pathB.cubicTo(4,6, 1,0, 6,2);
769 pathB.close();
770 testPathOp(reporter, path, pathB, kIntersect_PathOp);
771}
772
773static void cubicOp42d(skiatest::Reporter* reporter) {
774 SkPath path, pathB;
775 path.setFillType(SkPath::kWinding_FillType);
776 path.moveTo(0,1);
777 path.cubicTo(1,2, 6,5, 5,4);
778 path.close();
779 pathB.setFillType(SkPath::kWinding_FillType);
780 pathB.moveTo(5,6);
781 pathB.cubicTo(4,5, 1,0, 2,1);
782 pathB.close();
783 testPathOp(reporter, path, pathB, kDifference_PathOp);
784}
785
786static void cubicOp43d(skiatest::Reporter* reporter) {
787 SkPath path, pathB;
788 path.setFillType(SkPath::kWinding_FillType);
789 path.moveTo(0,2);
790 path.cubicTo(1,2, 4,0, 3,1);
791 path.close();
792 pathB.setFillType(SkPath::kWinding_FillType);
793 pathB.moveTo(0,4);
794 pathB.cubicTo(1,3, 2,0, 2,1);
795 pathB.close();
796 testPathOp(reporter, path, pathB, kDifference_PathOp);
797}
798
799static void cubicOp44d(skiatest::Reporter* reporter) {
800 SkPath path, pathB;
801 path.setFillType(SkPath::kWinding_FillType);
802 path.moveTo(0,2);
803 path.cubicTo(3,6, 4,0, 3,2);
804 path.close();
805 pathB.setFillType(SkPath::kWinding_FillType);
806 pathB.moveTo(0,4);
807 pathB.cubicTo(2,3, 2,0, 6,3);
808 pathB.close();
809 testPathOp(reporter, path, pathB, kDifference_PathOp);
810}
811
812static void cubicOp45d(skiatest::Reporter* reporter) {
813 SkPath path, pathB;
814 path.setFillType(SkPath::kWinding_FillType);
815 path.moveTo(0,2);
816 path.cubicTo(2,4, 4,0, 3,2);
817 path.close();
818 pathB.setFillType(SkPath::kWinding_FillType);
819 pathB.moveTo(0,4);
820 pathB.cubicTo(2,3, 2,0, 4,2);
821 pathB.close();
822 testPathOp(reporter, path, pathB, kDifference_PathOp);
823}
824
825static void cubicOp46d(skiatest::Reporter* reporter) {
826 SkPath path, pathB;
827 path.setFillType(SkPath::kWinding_FillType);
828 path.moveTo(0,2);
829 path.cubicTo(3,5, 5,0, 4,2);
830 path.close();
831 pathB.setFillType(SkPath::kWinding_FillType);
832 pathB.moveTo(0,5);
833 pathB.cubicTo(2,4, 2,0, 5,3);
834 pathB.close();
835 testPathOp(reporter, path, pathB, kDifference_PathOp);
836}
837
838static void cubicOp47d(skiatest::Reporter* reporter) {
839 SkPath path, pathB;
840 path.setFillType(SkPath::kWinding_FillType);
841 path.moveTo(0,1);
842 path.cubicTo(1,6, 6,2, 5,4);
843 path.close();
844 pathB.setFillType(SkPath::kWinding_FillType);
845 pathB.moveTo(2,6);
846 pathB.cubicTo(4,5, 1,0, 6,1);
847 pathB.close();
848 testPathOp(reporter, path, pathB, kDifference_PathOp);
849}
850
851static void cubicOp48d(skiatest::Reporter* reporter) {
852 SkPath path, pathB;
853 path.setFillType(SkPath::kWinding_FillType);
854 path.moveTo(0,2);
855 path.cubicTo(2,3, 5,1, 3,2);
856 path.close();
857 pathB.setFillType(SkPath::kWinding_FillType);
858 pathB.moveTo(1,5);
859 pathB.cubicTo(2,3, 2,0, 3,2);
860 pathB.close();
861 testPathOp(reporter, path, pathB, kDifference_PathOp);
862}
863
864static void cubicOp49d(skiatest::Reporter* reporter) {
865 SkPath path, pathB;
866 path.setFillType(SkPath::kWinding_FillType);
867 path.moveTo(0,2);
868 path.cubicTo(1,5, 3,2, 4,1);
869 path.close();
870 pathB.setFillType(SkPath::kWinding_FillType);
871 pathB.moveTo(2,3);
872 pathB.cubicTo(1,4, 2,0, 5,1);
873 pathB.close();
874 testPathOp(reporter, path, pathB, kDifference_PathOp);
875}
876
877static void cubicOp50d(skiatest::Reporter* reporter) {
878 SkPath path, pathB;
879 path.setFillType(SkPath::kWinding_FillType);
880 path.moveTo(0,3);
881 path.cubicTo(1,6, 5,0, 5,1);
882 path.close();
883 pathB.setFillType(SkPath::kWinding_FillType);
884 pathB.moveTo(0,5);
885 pathB.cubicTo(1,5, 3,0, 6,1);
886 pathB.close();
887 testPathOp(reporter, path, pathB, kDifference_PathOp);
888}
889
890static void cubicOp51d(skiatest::Reporter* reporter) {
891 SkPath path, pathB;
892 path.setFillType(SkPath::kWinding_FillType);
893 path.moveTo(0,3);
894 path.cubicTo(1,2, 4,1, 6,0);
895 path.close();
896 pathB.setFillType(SkPath::kWinding_FillType);
897 pathB.moveTo(1,4);
898 pathB.cubicTo(0,6, 3,0, 2,1);
899 pathB.close();
900 testPathOp(reporter, path, pathB, kDifference_PathOp);
901}
902
903static void cubicOp52d(skiatest::Reporter* reporter) {
904 SkPath path, pathB;
905 path.setFillType(SkPath::kWinding_FillType);
906 path.moveTo(0,2);
907 path.cubicTo(1,2, 5,4, 4,3);
908 path.close();
909 pathB.setFillType(SkPath::kWinding_FillType);
910 pathB.moveTo(4,5);
911 pathB.cubicTo(3,4, 2,0, 2,1);
912 pathB.close();
913 testPathOp(reporter, path, pathB, kDifference_PathOp);
914}
915
916static void cubicOp53d(skiatest::Reporter* reporter) {
917 SkPath path, pathB;
918 path.setFillType(SkPath::kWinding_FillType);
919 path.moveTo(0,3);
920 path.cubicTo(1,2, 5,3, 2,1);
921 path.close();
922 pathB.setFillType(SkPath::kWinding_FillType);
923 pathB.moveTo(3,5);
924 pathB.cubicTo(1,2, 3,0, 2,1);
925 pathB.close();
926 testPathOp(reporter, path, pathB, kDifference_PathOp);
927}
928
929static void cubicOp54d(skiatest::Reporter* reporter) {
930 SkPath path, pathB;
931 path.setFillType(SkPath::kWinding_FillType);
932 path.moveTo(0,4);
933 path.cubicTo(1,3, 5,4, 4,2);
934 path.close();
935 pathB.setFillType(SkPath::kWinding_FillType);
936 pathB.moveTo(4,5);
937 pathB.cubicTo(2,4, 4,0, 3,1);
938 pathB.close();
939 testPathOp(reporter, path, pathB, kDifference_PathOp);
940}
941
942static void cubicOp55d(skiatest::Reporter* reporter) {
943 SkPath path, pathB;
944 path.setFillType(SkPath::kWinding_FillType);
945 path.moveTo(0,5);
946 path.cubicTo(1,3, 3,2, 5,0);
947 path.close();
948 pathB.setFillType(SkPath::kWinding_FillType);
949 pathB.moveTo(2,3);
950 pathB.cubicTo(0,5, 5,0, 3,1);
951 pathB.close();
952 testPathOp(reporter, path, pathB, kDifference_PathOp);
953}
954
955static void cubicOp56d(skiatest::Reporter* reporter) {
956 SkPath path, pathB;
957 path.setFillType(SkPath::kWinding_FillType);
958 path.moveTo(0,1);
959 path.cubicTo(2,6, 5,0, 2,1);
960 path.close();
961 pathB.setFillType(SkPath::kWinding_FillType);
962 pathB.moveTo(0,5);
963 pathB.cubicTo(1,2, 1,0, 6,2);
964 pathB.close();
965 testPathOp(reporter, path, pathB, kDifference_PathOp);
966}
967
968static void cubicOp57d(skiatest::Reporter* reporter) {
969 SkPath path, pathB;
970 path.setFillType(SkPath::kWinding_FillType);
971 path.moveTo(0,5);
972 path.cubicTo(0,5, 5,4, 6,4);
973 path.close();
974 pathB.setFillType(SkPath::kWinding_FillType);
975 pathB.moveTo(4,5);
976 pathB.cubicTo(4,6, 5,0, 5,0);
977 pathB.close();
978 testPathOp(reporter, path, pathB, kDifference_PathOp);
979}
980
981static void cubicOp58d(skiatest::Reporter* reporter) {
982 SkPath path, pathB;
983 path.setFillType(SkPath::kWinding_FillType);
984 path.moveTo(0,5);
985 path.cubicTo(3,4, 6,5, 5,3);
986 path.close();
987 pathB.setFillType(SkPath::kWinding_FillType);
988 pathB.moveTo(5,6);
989 pathB.cubicTo(3,5, 5,0, 4,3);
990 pathB.close();
991 testPathOp(reporter, path, pathB, kDifference_PathOp);
992}
993
994static void cubicOp59d(skiatest::Reporter* reporter) {
995 SkPath path, pathB;
996 path.setFillType(SkPath::kWinding_FillType);
997 path.moveTo(0,1);
998 path.cubicTo(5,6, 4,0, 4,1);
999 path.close();
1000 pathB.setFillType(SkPath::kWinding_FillType);
1001 pathB.moveTo(0,4);
1002 pathB.cubicTo(1,4, 1,0, 6,5);
1003 pathB.close();
1004 testPathOp(reporter, path, pathB, kDifference_PathOp);
1005}
1006
1007static void cubicOp60d(skiatest::Reporter* reporter) {
1008 SkPath path, pathB;
1009 path.setFillType(SkPath::kWinding_FillType);
1010 path.moveTo(0,2);
1011 path.cubicTo(4,6, 6,0, 5,2);
1012 path.close();
1013 pathB.setFillType(SkPath::kWinding_FillType);
1014 pathB.moveTo(0,6);
1015 pathB.cubicTo(2,5, 2,0, 6,4);
1016 pathB.close();
1017 testPathOp(reporter, path, pathB, kDifference_PathOp);
1018}
1019
1020static void cubicOp61d(skiatest::Reporter* reporter) {
1021 SkPath path, pathB;
1022 path.setFillType(SkPath::kWinding_FillType);
1023 path.moveTo(1,2);
1024 path.cubicTo(0,5, 3,2, 6,1);
1025 path.close();
1026 pathB.setFillType(SkPath::kWinding_FillType);
1027 pathB.moveTo(2,3);
1028 pathB.cubicTo(1,6, 2,1, 5,0);
1029 pathB.close();
1030 testPathOp(reporter, path, pathB, kDifference_PathOp);
1031}
1032
1033static void cubicOp62d(skiatest::Reporter* reporter) {
1034 SkPath path, pathB;
1035 path.setFillType(SkPath::kWinding_FillType);
1036 path.moveTo(1,3);
1037 path.cubicTo(5,6, 5,3, 5,4);
1038 path.close();
1039 pathB.setFillType(SkPath::kWinding_FillType);
1040 pathB.moveTo(3,5);
1041 pathB.cubicTo(4,5, 3,1, 6,5);
1042 pathB.close();
1043 testPathOp(reporter, path, pathB, kDifference_PathOp);
1044}
1045
1046static void cubicOp63d(skiatest::Reporter* reporter) {
1047 SkPath path, pathB;
1048 path.setFillType(SkPath::kWinding_FillType);
1049 path.moveTo(2,3);
1050 path.cubicTo(0,4, 3,2, 5,3);
1051 path.close();
1052 pathB.setFillType(SkPath::kWinding_FillType);
1053 pathB.moveTo(2,3);
1054 pathB.cubicTo(3,5, 3,2, 4,0);
1055 pathB.close();
1056 testPathOp(reporter, path, pathB, kDifference_PathOp);
1057}
1058
1059static void cubicOp64d(skiatest::Reporter* reporter) {
1060 SkPath path, pathB;
1061 path.moveTo(0,1);
1062 path.cubicTo(0,1, 1,0, 3,0);
1063 path.lineTo(0,1);
1064 path.close();
1065 pathB.moveTo(0,1);
1066 pathB.cubicTo(0,3, 1,0, 1,0);
1067 pathB.lineTo(0,1);
1068 pathB.close();
1069 testPathOp(reporter, path, pathB, kDifference_PathOp);
1070}
1071
1072static void cubicOp65d(skiatest::Reporter* reporter) {
1073 SkPath path, pathB;
1074 path.moveTo(0,1);
1075 path.cubicTo(1,5, 1,0, 1,0);
1076 path.lineTo(0,1);
1077 path.close();
1078 pathB.moveTo(0,1);
1079 pathB.cubicTo(0,1, 1,0, 5,1);
1080 pathB.lineTo(0,1);
1081 pathB.close();
1082 testPathOp(reporter, path, pathB, kDifference_PathOp);
1083}
1084
1085static void rectOp1d(skiatest::Reporter* reporter) {
1086 SkPath path, pathB;
1087 path.moveTo(0,1);
1088 path.cubicTo(0,1, 1,0, 3,0);
1089 path.lineTo(0,1);
1090 path.close();
1091 pathB.moveTo(0,1);
1092 pathB.cubicTo(0,3, 1,0, 1,0);
1093 pathB.lineTo(0,1);
1094 pathB.close();
1095 testPathOp(reporter, path, pathB, kDifference_PathOp);
1096}
1097
caryclark@google.comb3f09212013-04-17 15:49:16 +00001098static void cubicOp66u(skiatest::Reporter* reporter) {
1099 SkPath path, pathB;
1100 path.setFillType(SkPath::kWinding_FillType);
1101 path.moveTo(0,1);
1102 path.cubicTo(2,6, 4,2, 5,3);
1103 path.close();
1104 pathB.setFillType(SkPath::kWinding_FillType);
1105 pathB.moveTo(2,4);
1106 pathB.cubicTo(3,5, 1,0, 6,2);
1107 pathB.close();
1108 testPathOp(reporter, path, pathB, kUnion_PathOp);
1109}
1110
1111static void cubicOp67u(skiatest::Reporter* reporter) {
1112 SkPath path, pathB;
1113 path.moveTo(3,5);
1114 path.cubicTo(1,6, 5,0, 3,1);
1115 path.lineTo(3,5);
1116 path.close();
1117 pathB.moveTo(0,5);
1118 pathB.cubicTo(1,3, 5,3, 6,1);
1119 pathB.lineTo(0,5);
1120 pathB.close();
1121 testPathOp(reporter, path, pathB, kUnion_PathOp);
1122}
1123
caryclark@google.com03610322013-04-18 15:58:21 +00001124static void cubicOp68u(skiatest::Reporter* reporter) {
1125 SkPath path, pathB;
1126 path.moveTo(0,5);
1127 path.cubicTo(4,5, 4,1, 5,0);
1128 path.close();
1129 pathB.moveTo(1,4);
1130 pathB.cubicTo(0,5, 5,0, 5,4);
1131 pathB.close();
1132 testPathOp(reporter, path, pathB, kUnion_PathOp);
1133}
1134
1135static void cubicOp69d(skiatest::Reporter* reporter) {
1136 SkPath path, pathB;
1137 path.moveTo(1,3);
1138 path.cubicTo(0,1, 3,1, 2,0);
1139 path.close();
1140 pathB.moveTo(1,3);
1141 pathB.cubicTo(0,2, 3,1, 1,0);
1142 pathB.close();
1143 testPathOp(reporter, path, pathB, kDifference_PathOp);
1144}
1145
caryclark@google.com6dc7df62013-04-25 11:51:54 +00001146SkPathOp ops[] = {
1147 kUnion_PathOp,
1148 kXOR_PathOp,
1149 kReverseDifference_PathOp,
1150 kXOR_PathOp,
1151 kReverseDifference_PathOp,
1152};
1153
1154static void rRect1(skiatest::Reporter* reporter) {
commit-bot@chromium.org4b413c82013-11-25 19:44:07 +00001155 SkScalar xA = 0.65f;
1156 SkScalar xB = 10.65f;
1157 SkScalar xC = 20.65f;
1158 SkScalar xD = 30.65f;
1159 SkScalar xE = 40.65f;
1160 SkScalar xF = 50.65f;
caryclark@google.com6dc7df62013-04-25 11:51:54 +00001161
commit-bot@chromium.org4b413c82013-11-25 19:44:07 +00001162 SkScalar yA = 0.65f;
1163 SkScalar yB = 10.65f;
1164 SkScalar yC = 20.65f;
1165 SkScalar yD = 30.65f;
1166 SkScalar yE = 40.65f;
1167 SkScalar yF = 50.65f;
caryclark@google.coma5e55922013-05-07 18:51:31 +00001168 SkPath paths[5];
1169 SkRect rects[5];
1170 rects[0].set(xB, yB, xE, yE);
1171 paths[0].addRoundRect(rects[0], SkIntToScalar(5), SkIntToScalar(5)); // red
1172 rects[1].set(xA, yA, xD, yD);
1173 paths[1].addRoundRect(rects[1], SkIntToScalar(5), SkIntToScalar(5)); // green
1174 rects[2].set(xC, yA, xF, yD);
1175 paths[2].addRoundRect(rects[2], SkIntToScalar(5), SkIntToScalar(5)); // blue
1176 rects[3].set(xA, yC, xD, yF);
1177 paths[3].addRoundRect(rects[3], SkIntToScalar(5), SkIntToScalar(5)); // yellow
1178 rects[4].set(xC, yC, xF, yF);
1179 paths[4].addRoundRect(rects[4], SkIntToScalar(5), SkIntToScalar(5)); // cyan
1180 SkPath path;
1181 path.setFillType(SkPath::kInverseEvenOdd_FillType);
1182 for (int index = 0; index < 5; ++index) {
1183 testPathOp(reporter, path, paths[index], ops[index]);
1184 Op(path, paths[index], ops[index], &path);
1185 }
1186}
1187
1188static void skp1(skiatest::Reporter* reporter) {
1189 SkPath path;
1190 path.setFillType(SkPath::kEvenOdd_FillType);
1191 path.moveTo(189,7);
1192 path.cubicTo(189,5.34314585f, 190.34314f,4, 192,4);
1193 path.lineTo(243,4);
1194 path.cubicTo(244.65686f,4, 246,5.34314585f, 246,7);
1195 path.lineTo(246,21);
1196 path.cubicTo(246,22.6568546f, 244.65686f,24, 243,24);
1197 path.lineTo(192,24);
1198 path.cubicTo(190.34314f,24, 189,22.6568546f, 189,21);
1199 path.lineTo(189,7);
1200 path.close();
1201 path.moveTo(191,8);
1202 path.cubicTo(191,6.89543009f, 191.895432f,6, 193,6);
1203 path.lineTo(242,6);
1204 path.cubicTo(243.104568f,6, 244,6.89543009f, 244,8);
1205 path.lineTo(244,20);
1206 path.cubicTo(244,21.1045704f, 243.104568f,22, 242,22);
1207 path.lineTo(193,22);
1208 path.cubicTo(191.895432f,22, 191,21.1045704f, 191,20);
1209 path.lineTo(191,8);
1210 path.close();
1211 SkPath pathB;
1212 pathB.setFillType(SkPath::kWinding_FillType);
1213 pathB.moveTo(189,4);
1214 pathB.lineTo(199,14);
1215 pathB.lineTo(236,14);
1216 pathB.lineTo(246,4);
1217 pathB.lineTo(189,4);
1218 pathB.close();
1219 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1220}
1221
1222static void skp2(skiatest::Reporter* reporter) {
1223 SkPath path;
1224 path.setFillType(SkPath::kEvenOdd_FillType);
1225 path.moveTo(253.000000f, 11757.0000f);
1226 path.lineTo(253.000000f, 222.000000f);
1227 path.lineTo(823.000000f, 222.000000f);
1228 path.lineTo(823.000000f, 11757.0000f);
1229 path.lineTo(253.000000f, 11757.0000f);
1230 path.close();
1231 SkPath pathB;
1232 pathB.setFillType(SkPath::kWinding_FillType);
1233 pathB.moveTo(258.000000f, 1028.00000f);
1234 pathB.lineTo(258.000000f, 1027.00000f);
1235 pathB.lineTo(823.000000f, 1027.00000f);
1236 pathB.lineTo(823.000000f, 1028.00000f);
1237 pathB.lineTo(258.000000f, 1028.00000f);
1238 pathB.close();
1239 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1240}
1241
1242static void skp3(skiatest::Reporter* reporter) {
1243 SkPath path;
1244 path.setFillType(SkPath::kEvenOdd_FillType);
1245 path.moveTo(717.000000f, 507.000000f);
1246 path.lineTo(717.000000f, 425.000000f);
1247 path.lineTo(973.000000f, 425.000000f);
1248 path.lineTo(973.000000f, 507.000000f);
1249 path.quadTo(973.000000f, 508.242645f, 972.121582f, 509.121613f);
1250 path.quadTo(971.242615f, 510.000000f, 970.000000f, 510.000000f);
1251 path.lineTo(720.000000f, 510.000000f);
1252 path.quadTo(718.757385f, 510.000000f, 717.878418f, 509.121613f);
1253 path.quadTo(717.000000f, 508.242645f, 717.000000f, 507.000000f);
1254 path.close();
1255 path.moveTo(719.000000f, 426.000000f);
1256 path.lineTo(971.000000f, 426.000000f);
1257 path.lineTo(971.000000f, 506.000000f);
1258 path.cubicTo(971.000000f, 507.104584f, 970.104553f, 508.000000f, 969.000000f, 508.000000f);
1259 path.lineTo(721.000000f, 508.000000f);
1260 path.cubicTo(719.895447f, 508.000000f, 719.000000f, 507.104584f, 719.000000f, 506.000000f);
1261 path.lineTo(719.000000f, 426.000000f);
1262 path.close();
1263 SkPath pathB;
1264 pathB.setFillType(SkPath::kWinding_FillType);
1265 pathB.moveTo(717.000000f, 510.000000f);
1266 pathB.lineTo(760.000000f, 467.000000f);
1267 pathB.lineTo(930.000000f, 467.000000f);
1268 pathB.lineTo(973.000000f, 510.000000f);
1269 pathB.lineTo(717.000000f, 510.000000f);
1270 pathB.close();
1271 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1272}
1273
1274static void skp4(skiatest::Reporter* reporter) {
1275 SkPath path;
1276 path.setFillType(SkPath::kEvenOdd_FillType);
1277 path.moveTo(230.756805f, 591.756775f);
1278 path.quadTo(232.514725f, 590.000000f, 235.000000f, 590.000000f);
1279 path.lineTo(300.000000f, 590.000000f);
1280 path.quadTo(302.485291f, 590.000000f, 304.243195f, 591.756775f);
1281 path.quadTo(306.000000f, 593.514709f, 306.000000f, 596.000000f);
1282 path.lineTo(306.000000f, 617.000000f);
1283 path.lineTo(229.000000f, 617.000000f);
1284 path.lineTo(229.000000f, 596.000000f);
1285 path.quadTo(229.000000f, 593.514709f, 230.756805f, 591.756775f);
1286 path.close();
1287 path.moveTo(231.000000f, 597.000000f);
1288 path.cubicTo(231.000000f, 594.238586f, 233.238571f, 592.000000f, 236.000000f, 592.000000f);
1289 path.lineTo(299.000000f, 592.000000f);
1290 path.cubicTo(301.761414f, 592.000000f, 304.000000f, 594.238586f, 304.000000f, 597.000000f);
1291 path.lineTo(304.000000f, 616.000000f);
1292 path.lineTo(231.000000f, 616.000000f);
1293 path.lineTo(231.000000f, 597.000000f);
1294 path.close();
1295 SkPath pathB;
1296 pathB.setFillType(SkPath::kWinding_FillType);
1297 pathB.moveTo(306.000000f, 590.000000f);
1298 pathB.lineTo(292.000000f, 604.000000f);
1299 pathB.lineTo(305.000000f, 617.000000f);
1300 pathB.lineTo(306.000000f, 617.000000f);
1301 pathB.lineTo(306.000000f, 590.000000f);
1302 pathB.close();
1303 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1304}
1305
1306static void skp5(skiatest::Reporter* reporter) {
1307 SkPath path;
1308 path.setFillType(SkPath::kEvenOdd_FillType);
1309 path.moveTo(18.0000000f, 226.000000f);
1310 path.quadTo(14.6862917f, 226.000000f, 12.3423996f, 228.342407f);
1311 path.quadTo(10.0000000f, 230.686295f, 10.0000000f, 234.000000f);
1312 path.lineTo(10.0000000f, 253.000000f);
1313 path.lineTo(1247.00000f, 253.000000f);
1314 path.lineTo(1247.00000f, 234.000000f);
1315 path.quadTo(1247.00000f, 230.686295f, 1244.65759f, 228.342407f);
1316 path.quadTo(1242.31372f, 226.000000f, 1239.00000f, 226.000000f);
1317 path.lineTo(18.0000000f, 226.000000f);
1318 path.close();
1319 SkPath pathB;
1320 pathB.setFillType(SkPath::kInverseWinding_FillType);
1321 pathB.moveTo(18.0000000f, 226.000000f);
1322 pathB.lineTo(1239.00000f, 226.000000f);
1323 pathB.cubicTo(1243.41833f, 226.000000f, 1247.00000f, 229.581726f, 1247.00000f, 234.000000f);
1324 pathB.lineTo(1247.00000f, 252.000000f);
1325 pathB.lineTo(10.0000000f, 252.000000f);
1326 pathB.lineTo(10.0000000f, 234.000000f);
1327 pathB.cubicTo(10.0000000f, 229.581726f, 13.5817204f, 226.000000f, 18.0000000f, 226.000000f);
1328 pathB.close();
1329 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1330}
1331
1332static void cubicOp70d(skiatest::Reporter* reporter) {
1333 SkPath path, pathB;
1334 path.setFillType(SkPath::kWinding_FillType);
1335 path.moveTo(0,1);
1336 path.cubicTo(0,5, 4,0, 5,0);
1337 path.close();
1338 pathB.setFillType(SkPath::kWinding_FillType);
1339 pathB.moveTo(0,4);
1340 pathB.cubicTo(0,5, 1,0, 5,0);
1341 pathB.close();
1342 testPathOp(reporter, path, pathB, kDifference_PathOp);
caryclark@google.com6dc7df62013-04-25 11:51:54 +00001343}
1344
reed@google.com277c3f82013-05-31 15:17:50 +00001345static void cubicOp71d(skiatest::Reporter* reporter) {
1346 SkPath path, pathB;
1347 path.setFillType(SkPath::kWinding_FillType);
1348 path.moveTo(0,1);
1349 path.cubicTo(0,5, 4,1, 6,4);
1350 path.close();
1351 pathB.setFillType(SkPath::kWinding_FillType);
1352 pathB.moveTo(1,4);
1353 pathB.cubicTo(4,6, 1,0, 5,0);
1354 pathB.close();
1355 testPathOp(reporter, path, pathB, kDifference_PathOp);
1356}
1357
1358static void cubicOp72i(skiatest::Reporter* reporter) {
1359 SkPath path, pathB;
1360 path.setFillType(SkPath::kWinding_FillType);
1361 path.moveTo(0,1);
1362 path.cubicTo(0,5, 5,2, 5,4);
1363 path.close();
1364 pathB.setFillType(SkPath::kWinding_FillType);
1365 pathB.moveTo(2,5);
1366 pathB.cubicTo(4,5, 1,0, 5,0);
1367 pathB.close();
1368 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1369}
1370
1371static void cubicOp73d(skiatest::Reporter* reporter) {
1372 SkPath path, pathB;
1373 path.setFillType(SkPath::kWinding_FillType);
1374 path.moveTo(0,1);
1375 path.cubicTo(3,4, 4,0, 6,4);
1376 path.lineTo(0,1);
1377 path.close();
1378 pathB.setFillType(SkPath::kWinding_FillType);
1379 pathB.moveTo(0,4);
1380 pathB.cubicTo(4,6, 1,0, 4,3);
1381 pathB.lineTo(0,4);
1382 pathB.close();
1383 testPathOp(reporter, path, pathB, kDifference_PathOp);
1384}
1385
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001386static void cubicOp74d(skiatest::Reporter* reporter) {
1387 SkPath path, pathB;
1388 path.setFillType(SkPath::kWinding_FillType);
1389 path.moveTo(0,1);
1390 path.cubicTo(1,5, 5,1, 5,1);
1391 path.lineTo(0,1);
1392 path.close();
1393 pathB.setFillType(SkPath::kWinding_FillType);
1394 pathB.moveTo(1,5);
1395 pathB.cubicTo(1,5, 1,0, 5,1);
1396 pathB.lineTo(1,5);
1397 pathB.close();
1398 testPathOp(reporter, path, pathB, kDifference_PathOp);
1399}
1400
reed@google.com277c3f82013-05-31 15:17:50 +00001401static void cubicOp75d(skiatest::Reporter* reporter) {
1402 SkPath path, pathB;
1403 path.setFillType(SkPath::kWinding_FillType);
1404 path.moveTo(0,1);
1405 path.cubicTo(0,4, 5,1, 6,4);
1406 path.lineTo(0,1);
1407 path.close();
1408 pathB.setFillType(SkPath::kWinding_FillType);
1409 pathB.moveTo(1,5);
1410 pathB.cubicTo(4,6, 1,0, 4,0);
1411 pathB.lineTo(1,5);
1412 pathB.close();
1413 testPathOp(reporter, path, pathB, kDifference_PathOp);
1414}
1415
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001416static void cubicOp76u(skiatest::Reporter* reporter) {
1417 SkPath path, pathB;
1418 path.setFillType(SkPath::kWinding_FillType);
1419 path.moveTo(0,1);
1420 path.cubicTo(0,2, 2,0, 5,3);
1421 path.close();
1422 pathB.setFillType(SkPath::kWinding_FillType);
1423 pathB.moveTo(0,2);
1424 pathB.cubicTo(3,5, 1,0, 2,0);
1425 pathB.close();
1426 testPathOp(reporter, path, pathB, kUnion_PathOp);
1427}
1428
reed@google.com277c3f82013-05-31 15:17:50 +00001429static void cubicOp77i(skiatest::Reporter* reporter) {
1430 SkPath path, pathB;
1431 path.setFillType(SkPath::kEvenOdd_FillType);
1432 path.moveTo(0,1);
1433 path.cubicTo(1,3, 2,0, 3,2);
1434 path.lineTo(0,1);
1435 path.close();
1436 pathB.setFillType(SkPath::kEvenOdd_FillType);
1437 pathB.moveTo(0,2);
1438 pathB.cubicTo(2,3, 1,0, 3,1);
1439 pathB.lineTo(0,2);
1440 pathB.close();
1441 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1442}
1443
1444static void cubicOp78u(skiatest::Reporter* reporter) {
1445 SkPath path, pathB;
1446 path.setFillType(SkPath::kEvenOdd_FillType);
1447 path.moveTo(1,6);
1448 path.cubicTo(1,6, 5,0, 6,1);
1449 path.lineTo(1,6);
1450 path.close();
1451 pathB.setFillType(SkPath::kEvenOdd_FillType);
1452 pathB.moveTo(0,5);
1453 pathB.cubicTo(1,6, 6,1, 6,1);
1454 pathB.lineTo(0,5);
1455 pathB.close();
1456 testPathOp(reporter, path, pathB, kUnion_PathOp);
1457}
1458
reed@google.com277c3f82013-05-31 15:17:50 +00001459static void cubicOp79u(skiatest::Reporter* reporter) {
1460 SkPath path, pathB;
1461 path.setFillType(SkPath::kWinding_FillType);
1462 path.moveTo(0,1);
1463 path.cubicTo(1,3, 1,0, 6,4);
1464 path.close();
1465 pathB.setFillType(SkPath::kWinding_FillType);
1466 pathB.moveTo(0,1);
1467 pathB.cubicTo(4,6, 1,0, 3,1);
1468 pathB.close();
1469 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1470}
1471
1472static void cubicOp80i(skiatest::Reporter* reporter) {
1473 SkPath path, pathB;
1474 path.setFillType(SkPath::kWinding_FillType);
1475 path.moveTo(0,1);
1476 path.cubicTo(2,3, 2,1, 4,3);
1477 path.lineTo(0,1);
1478 path.close();
1479 pathB.setFillType(SkPath::kWinding_FillType);
1480 pathB.moveTo(1,2);
1481 pathB.cubicTo(3,4, 1,0, 3,2);
1482 pathB.lineTo(1,2);
1483 pathB.close();
1484 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1485}
1486
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001487static void cubicOp81d(skiatest::Reporter* reporter) {
1488 SkPath path, pathB;
1489 path.setFillType(SkPath::kWinding_FillType);
1490 path.moveTo(0,1);
1491 path.cubicTo(4,6, 4,3, 5,4);
1492 path.close();
1493 pathB.setFillType(SkPath::kWinding_FillType);
1494 pathB.moveTo(3,4);
1495 pathB.cubicTo(4,5, 1,0, 6,4);
1496 pathB.close();
1497 testPathOp(reporter, path, pathB, kDifference_PathOp);
1498}
1499
reed@google.com277c3f82013-05-31 15:17:50 +00001500static void cubicOp82i(skiatest::Reporter* reporter) {
1501 SkPath path, pathB;
1502 path.setFillType(SkPath::kEvenOdd_FillType);
1503 path.moveTo(0,1);
1504 path.cubicTo(2,3, 5,2, 3,0);
1505 path.lineTo(0,1);
1506 path.close();
1507 pathB.setFillType(SkPath::kWinding_FillType);
1508 pathB.moveTo(2,5);
1509 pathB.cubicTo(0,3, 1,0, 3,2);
1510 pathB.lineTo(2,5);
1511 pathB.close();
1512 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1513}
1514
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001515static void cubicOp83i(skiatest::Reporter* reporter) {
reed@google.com277c3f82013-05-31 15:17:50 +00001516 SkPath path, pathB;
1517 path.setFillType(SkPath::kWinding_FillType);
1518 path.moveTo(0,1);
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001519 path.cubicTo(0,3, 2,1, 4,1);
1520 path.lineTo(0,1);
reed@google.com277c3f82013-05-31 15:17:50 +00001521 path.close();
1522 pathB.setFillType(SkPath::kWinding_FillType);
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001523 pathB.moveTo(1,2);
1524 pathB.cubicTo(1,4, 1,0, 3,0);
1525 pathB.lineTo(1,2);
1526 pathB.close();
1527 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1528}
1529
1530static void cubicOp84d(skiatest::Reporter* reporter) {
1531 SkPath path, pathB;
1532 path.setFillType(SkPath::kWinding_FillType);
1533 path.moveTo(0,4);
1534 path.cubicTo(2,3, 6,3, 3,2);
1535 path.close();
1536 pathB.setFillType(SkPath::kWinding_FillType);
1537 pathB.moveTo(3,6);
1538 pathB.cubicTo(2,3, 4,0, 3,2);
reed@google.com277c3f82013-05-31 15:17:50 +00001539 pathB.close();
1540 testPathOp(reporter, path, pathB, kDifference_PathOp);
1541}
1542
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001543static void skpClip1(skiatest::Reporter* reporter) {
1544 SkPath path;
1545 path.setFillType(SkPath::kEvenOdd_FillType);
1546 path.moveTo(1126.17114f, 877.171204f);
1547 path.quadTo(1127.34314f, 876.000000f, 1129.00000f, 876.000000f);
1548 path.lineTo(1243.00000f, 876.000000f);
1549 path.quadTo(1244.65686f, 876.000000f, 1245.82886f, 877.171204f);
1550 path.quadTo(1247.00000f, 878.343140f, 1247.00000f, 880.000000f);
1551 path.lineTo(1247.00000f, 907.000000f);
1552 path.lineTo(1246.00000f, 907.000000f);
1553 path.lineTo(1246.00000f, 880.000000f);
1554 path.cubicTo(1246.00000f, 878.343140f, 1244.65686f, 877.000000f, 1243.00000f, 877.000000f);
1555 path.lineTo(1129.00000f, 877.000000f);
1556 path.cubicTo(1127.34314f, 877.000000f, 1126.00000f, 878.343140f, 1126.00000f, 880.000000f);
1557 path.lineTo(1126.00000f, 907.000000f);
1558 path.lineTo(1125.00000f, 907.000000f);
1559 path.lineTo(1125.00000f, 880.000000f);
1560 path.quadTo(1125.00000f, 878.343140f, 1126.17114f, 877.171204f);
1561 path.close();
1562 SkPath pathB;
1563 pathB.setFillType(SkPath::kWinding_FillType);
1564 pathB.moveTo(1247.00000f, 876.000000f);
1565 pathB.lineTo(1231.00000f, 892.000000f);
1566 pathB.lineTo(1246.00000f, 907.000000f);
1567 pathB.lineTo(1247.00000f, 907.000000f);
1568 pathB.lineTo(1247.00000f, 876.000000f);
1569 pathB.close();
1570 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1571}
1572
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001573static void skpClip2(skiatest::Reporter* reporter) {
1574 SkPath path;
1575 path.setFillType(SkPath::kEvenOdd_FillType);
1576 path.moveTo(134.000000f, 11414.0000f);
1577 path.cubicTo(131.990234f, 11414.0000f, 130.326660f, 11415.4824f, 130.042755f, 11417.4131f);
1578 path.cubicTo(130.233124f, 11418.3193f, 131.037079f, 11419.0000f, 132.000000f, 11419.0000f);
1579 path.lineTo(806.000000f, 11419.0000f);
1580 path.cubicTo(806.962891f, 11419.0000f, 807.766907f, 11418.3193f, 807.957275f, 11417.4131f);
1581 path.cubicTo(807.673401f, 11415.4824f, 806.009766f, 11414.0000f, 804.000000f, 11414.0000f);
1582 path.lineTo(134.000000f, 11414.0000f);
1583 path.close();
1584 SkPath pathB;
1585 pathB.setFillType(SkPath::kInverseWinding_FillType);
1586 pathB.moveTo(132.000000f, 11415.0000f);
1587 pathB.lineTo(806.000000f, 11415.0000f);
1588 pathB.cubicTo(807.104553f, 11415.0000f, 808.000000f, 11415.4473f, 808.000000f, 11416.0000f);
1589 pathB.lineTo(808.000000f, 11417.0000f);
1590 pathB.cubicTo(808.000000f, 11418.1045f, 807.104553f, 11419.0000f, 806.000000f, 11419.0000f);
1591 pathB.lineTo(132.000000f, 11419.0000f);
1592 pathB.cubicTo(130.895432f, 11419.0000f, 130.000000f, 11418.1045f, 130.000000f, 11417.0000f);
1593 pathB.lineTo(130.000000f, 11416.0000f);
1594 pathB.cubicTo(130.000000f, 11415.4473f, 130.895432f, 11415.0000f, 132.000000f, 11415.0000f);
1595 pathB.close();
1596 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1597}
caryclark@google.com07e97fc2013-07-08 17:17:02 +00001598
1599static void skp96prezzi1(skiatest::Reporter* reporter) {
1600 SkPath path;
1601 path.setFillType(SkPath::kEvenOdd_FillType);
1602 path.moveTo(157.464005f, 670.463989f);
1603 path.quadTo(158.928925f, 669.000000f, 161.000000f, 669.000000f);
1604 path.lineTo(248.000000f, 669.000000f);
1605 path.quadTo(250.071075f, 669.000000f, 251.535995f, 670.463989f);
1606 path.quadTo(253.000000f, 671.928955f, 253.000000f, 674.000000f);
1607 path.lineTo(253.000000f, 706.000000f);
1608 path.lineTo(251.000000f, 706.000000f);
1609 path.lineTo(251.000000f, 675.000000f);
1610 path.cubicTo(251.000000f, 672.790833f, 249.209137f, 671.000000f, 247.000000f, 671.000000f);
1611 path.lineTo(162.000000f, 671.000000f);
1612 path.cubicTo(159.790863f, 671.000000f, 158.000000f, 672.790833f, 158.000000f, 675.000000f);
1613 path.lineTo(158.000000f, 706.000000f);
1614 path.lineTo(156.000000f, 706.000000f);
1615 path.lineTo(156.000000f, 674.000000f);
1616 path.quadTo(156.000000f, 671.928955f, 157.464005f, 670.463989f);
1617 path.close();
1618 SkPath pathB;
1619 pathB.setFillType(SkPath::kWinding_FillType);
1620 pathB.moveTo(156.000000f, 669.000000f);
1621 pathB.lineTo(178.500000f, 691.500000f);
1622 pathB.lineTo(230.500000f, 691.500000f);
1623 pathB.lineTo(253.000000f, 669.000000f);
1624 pathB.lineTo(156.000000f, 669.000000f);
1625 pathB.close();
1626 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1627}
1628
1629static void skpancestry_com1(skiatest::Reporter* reporter) {
1630 SkPath path;
1631 path.setFillType(SkPath::kEvenOdd_FillType);
1632 path.moveTo(161.000000f, 925.000000f);
1633 path.cubicTo(159.874390f, 925.000000f, 158.835663f, 925.371948f, 158.000000f, 925.999634f);
1634 path.lineTo(158.000000f, 926.000000f);
1635 path.lineTo(1108.00000f, 926.000000f);
1636 path.lineTo(1108.00000f, 925.999634f);
1637 path.cubicTo(1107.16443f, 925.371948f, 1106.12561f, 925.000000f, 1105.00000f, 925.000000f);
1638 path.lineTo(161.000000f, 925.000000f);
1639 path.close();
1640 SkPath pathB;
1641 pathB.setFillType(SkPath::kEvenOdd_FillType);
1642 pathB.moveTo(161.000000f, 926.000000f);
1643 pathB.lineTo(1105.00000f, 926.000000f);
1644 pathB.cubicTo(1107.20911f, 926.000000f, 1109.00000f, 927.790833f, 1109.00000f, 930.000000f);
1645 pathB.lineTo(1109.00000f, 956.000000f);
1646 pathB.cubicTo(1109.00000f, 958.209167f, 1107.20911f, 960.000000f, 1105.00000f, 960.000000f);
1647 pathB.lineTo(161.000000f, 960.000000f);
1648 pathB.cubicTo(158.790863f, 960.000000f, 157.000000f, 958.209167f, 157.000000f, 956.000000f);
1649 pathB.lineTo(157.000000f, 930.000000f);
1650 pathB.cubicTo(157.000000f, 927.790833f, 158.790863f, 926.000000f, 161.000000f, 926.000000f);
1651 pathB.close();
1652 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1653}
1654
1655static void skpeldorado_com_ua1(skiatest::Reporter* reporter) {
1656 SkPath path;
1657 path.setFillType(SkPath::kEvenOdd_FillType);
1658 path.moveTo(286.695129f, 291.000000f);
1659 path.lineTo(229.304855f, 561.000000f);
1660 path.lineTo(979.304871f, 561.000000f);
1661 path.lineTo(1036.69507f, 291.000000f);
1662 path.lineTo(286.695129f, 291.000000f);
1663 path.close();
1664 SkPath pathB;
1665 pathB.setFillType(SkPath::kWinding_FillType);
1666 pathB.moveTo(1006.69513f, 291.000000f);
1667 pathB.cubicTo(1023.26367f, 291.000000f, 1033.84021f, 304.431458f, 1030.31836f, 321.000000f);
1668 pathB.lineTo(985.681519f, 531.000000f);
1669 pathB.cubicTo(982.159790f, 547.568542f, 965.873413f, 561.000000f, 949.304871f, 561.000000f);
1670 pathB.lineTo(259.304871f, 561.000000f);
1671 pathB.cubicTo(242.736313f, 561.000000f, 232.159805f, 547.568542f, 235.681549f, 531.000000f);
1672 pathB.lineTo(280.318420f, 321.000000f);
1673 pathB.cubicTo(283.840179f, 304.431458f, 300.126587f, 291.000000f, 316.695129f, 291.000000f);
1674 pathB.lineTo(1006.69513f, 291.000000f);
1675 pathB.close();
1676 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1677}
1678
1679static void skpbyte_com1(skiatest::Reporter* reporter) {
1680 SkPath path;
1681 path.setFillType(SkPath::kEvenOdd_FillType);
1682 path.moveTo(968.000000f, 14.0000000f);
1683 path.cubicTo(965.238586f, 14.0000000f, 963.000000f, 16.2385769f, 963.000000f, 19.0000000f);
1684 path.lineTo(963.000000f, 32.0000000f);
1685 path.cubicTo(963.000000f, 34.7614250f, 965.238586f, 37.0000000f, 968.000000f, 37.0000000f);
1686 path.lineTo(1034.00000f, 37.0000000f);
1687 path.cubicTo(1036.76147f, 37.0000000f, 1039.00000f, 34.7614250f, 1039.00000f, 32.0000000f);
1688 path.lineTo(1039.00000f, 19.0000000f);
1689 path.cubicTo(1039.00000f, 16.2385769f, 1036.76147f, 14.0000000f, 1034.00000f, 14.0000000f);
1690 path.lineTo(968.000000f, 14.0000000f);
1691 path.close();
1692 SkPath pathB;
1693 pathB.setFillType(SkPath::kInverseWinding_FillType);
1694 pathB.moveTo(968.000000f, 14.0000000f);
1695 pathB.lineTo(1034.00000f, 14.0000000f);
1696 pathB.cubicTo(1036.76147f, 14.0000000f, 1039.00000f, 16.2385750f, 1039.00000f, 19.0000000f);
1697 pathB.lineTo(1039.00000f, 32.0000000f);
1698 pathB.cubicTo(1039.00000f, 34.2091408f, 1036.76147f, 36.0000000f, 1034.00000f, 36.0000000f);
1699 pathB.lineTo(968.000000f, 36.0000000f);
1700 pathB.cubicTo(965.238586f, 36.0000000f, 963.000000f, 34.2091408f, 963.000000f, 32.0000000f);
1701 pathB.lineTo(963.000000f, 19.0000000f);
1702 pathB.cubicTo(963.000000f, 16.2385750f, 965.238586f, 14.0000000f, 968.000000f, 14.0000000f);
1703 pathB.close();
1704 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1705}
1706
1707static void skphealth_com76(skiatest::Reporter* reporter) {
1708 SkPath path;
1709 path.setFillType(SkPath::kEvenOdd_FillType);
1710 path.moveTo(708.099182f, 7.09919119f);
1711 path.lineTo(708.099182f, 7.09920025f);
1712 path.quadTo(704.000000f, 11.2010098f, 704.000000f, 17.0000000f);
1713 path.lineTo(704.000000f, 33.0000000f);
1714 path.lineTo(705.000000f, 33.0000000f);
1715 path.lineTo(705.000000f, 17.0000000f);
1716 path.cubicTo(705.000000f, 13.4101496f, 706.455078f, 10.1601505f, 708.807617f, 7.80761385f);
1717 path.lineTo(708.099182f, 7.09919119f);
1718 path.close();
1719 SkPath pathB;
1720 pathB.setFillType(SkPath::kWinding_FillType);
1721 pathB.moveTo(704.000000f, 3.00000000f);
1722#if 0
1723 pathB.lineTo(719.500000f, 3.00000000f);
1724 pathB.lineTo(705.000000f, 33.0000000f);
1725 pathB.lineTo(704.000000f, 33.0000000f);
1726 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1727#else
1728 pathB.lineTo(704.000000f, 33.0000000f);
1729 pathB.lineTo(705.000000f, 33.0000000f);
1730 pathB.lineTo(719.500000f, 3.00000000f);
1731 testPathOp(reporter, path, pathB, kIntersect_PathOp);
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001732#endif
caryclark@google.com07e97fc2013-07-08 17:17:02 +00001733}
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001734
skia.committer@gmail.com977409a2013-07-16 07:00:56 +00001735static void skpahrefs_com88(skiatest::Reporter* reporter) {
1736 SkPath path;
1737 path.setFillType(SkPath::kEvenOdd_FillType);
1738 path.moveTo(1099.82886f, 7.17117119f);
1739 path.lineTo(1099.12134f, 7.87867832f);
1740 path.cubicTo(1099.66418f, 8.42157173f, 1100.00000f, 9.17157173f, 1100.00000f, 10.0000000f);
1741 path.lineTo(1100.00000f, 28.0000000f);
1742 path.cubicTo(1100.00000f, 29.6568546f, 1098.65686f, 31.0000000f, 1097.00000f, 31.0000000f);
1743 path.lineTo(1088.00000f, 31.0000000f);
1744 path.lineTo(1088.00000f, 32.0000000f);
1745 path.lineTo(1097.00000f, 32.0000000f);
1746 path.quadTo(1098.65686f, 32.0000000f, 1099.82886f, 30.8288002f);
1747 path.quadTo(1101.00000f, 29.6568546f, 1101.00000f, 28.0000000f);
1748 path.lineTo(1101.00000f, 10.0000000f);
1749 path.quadTo(1101.00000f, 8.34314537f, 1099.82886f, 7.17119980f);
1750 path.lineTo(1099.82886f, 7.17117119f);
1751 path.close();
1752 SkPath pathB;
1753 pathB.setFillType(SkPath::kWinding_FillType);
1754 pathB.moveTo(1101.00000f, 6.00000000f);
1755 pathB.lineTo(1088.00000f, 6.00000000f);
1756 pathB.lineTo(1088.00000f, 19.0000000f);
1757 pathB.lineTo(1101.00000f, 32.0000000f);
1758 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1759}
caryclark@google.comfa2aeee2013-07-15 13:29:13 +00001760
skia.committer@gmail.com977409a2013-07-16 07:00:56 +00001761static void skpahrefs_com29(skiatest::Reporter* reporter) {
1762 SkPath path;
1763 path.setFillType(SkPath::kEvenOdd_FillType);
1764 path.moveTo(1037.17114f, 7.17119980f);
1765 path.quadTo(1038.34314f, 6.00000000f, 1040.00000f, 6.00000000f);
1766 path.lineTo(1074.00000f, 6.00000000f);
1767 path.lineTo(1074.00000f, 32.0000000f);
1768 path.lineTo(1040.00000f, 32.0000000f);
1769 path.quadTo(1038.34314f, 32.0000000f, 1037.17114f, 30.8288002f);
1770 path.quadTo(1036.00000f, 29.6568546f, 1036.00000f, 28.0000000f);
1771 path.lineTo(1036.00000f, 10.0000000f);
1772 path.quadTo(1036.00000f, 8.34314537f, 1037.17114f, 7.17119980f);
1773 path.close();
1774 path.moveTo(1037.00000f, 10.0000000f);
1775 path.cubicTo(1037.00000f, 8.34314537f, 1038.34314f, 7.00000000f, 1040.00000f, 7.00000000f);
1776 path.lineTo(1073.00000f, 7.00000000f);
1777 path.lineTo(1073.00000f, 31.0000000f);
1778 path.lineTo(1040.00000f, 31.0000000f);
1779 path.cubicTo(1038.34314f, 31.0000000f, 1037.00000f, 29.6568546f, 1037.00000f, 28.0000000f);
1780 path.lineTo(1037.00000f, 10.0000000f);
1781 path.close();
1782 SkPath pathB;
1783 pathB.setFillType(SkPath::kWinding_FillType);
1784 pathB.moveTo(1036.00000f, 32.0000000f);
1785 pathB.lineTo(1049.00000f, 19.0000000f);
1786 pathB.lineTo(1073.00000f, 31.0000000f);
1787 pathB.lineTo(1074.00000f, 32.0000000f);
1788 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1789}
caryclark@google.comfa2aeee2013-07-15 13:29:13 +00001790
skia.committer@gmail.com977409a2013-07-16 07:00:56 +00001791static void cubicOp85d(skiatest::Reporter* reporter) {
1792 SkPath path;
1793 path.setFillType(SkPath::kWinding_FillType);
1794 path.moveTo(0,1);
1795 path.cubicTo(1,6, 1,0, 6,2);
1796 path.close();
1797 SkPath pathB;
1798 pathB.setFillType(SkPath::kWinding_FillType);
1799 pathB.moveTo(0,1);
1800 pathB.cubicTo(2,6, 1,0, 6,1);
1801 pathB.close();
1802 testPathOp(reporter, path, pathB, kDifference_PathOp);
caryclark@google.comfa2aeee2013-07-15 13:29:13 +00001803}
1804
caryclark@google.comfa2aeee2013-07-15 13:29:13 +00001805// this fails because the pair of nearly coincident cubics intersect at the ends
1806// but the line connected to one of the cubics at the same point does not intersect
1807// the other
skia.committer@gmail.com977409a2013-07-16 07:00:56 +00001808static void skpkkiste_to98(skiatest::Reporter* reporter) {
1809 SkPath path;
1810 path.setFillType(SkPath::kEvenOdd_FillType);
1811 path.moveTo(96, 122);
1812 path.cubicTo(94.6192932f, 122, 93.3692932f, 122.559647f, 92.4644699f, 123.46447f);
1813 path.lineTo(94.1715698f, 125.17157f);
1814 path.cubicTo(94.8954315f, 124.447708f, 95.8954315f, 124, 97, 124);
1815 path.lineTo(257, 124);
1816 path.cubicTo(258.104553f, 124, 259.104584f, 124.447708f, 259.82843f, 125.17157f);
1817 path.lineTo(261.535522f, 123.46447f);
1818 path.cubicTo(260.630707f, 122.559647f, 259.380707f, 122, 258, 122);
1819 path.lineTo(96, 122);
1820 path.close();
1821 SkPath pathB;
1822 pathB.setFillType(SkPath::kWinding_FillType);
1823 pathB.moveTo(258, 122);
1824 pathB.cubicTo(260.761414f, 122, 263, 124.238579f, 263, 127);
1825 pathB.lineTo(263, 284);
1826 pathB.cubicTo(263, 286.761414f, 260.761414f, 289, 258, 289);
1827 pathB.lineTo(96, 289);
1828 pathB.cubicTo(93.2385788f, 289, 91, 286.761414f, 91, 284);
1829 pathB.lineTo(91, 127);
1830 pathB.cubicTo(91, 124.238579f, 93.2385788f, 122, 96, 122);
1831 pathB.lineTo(258, 122);
1832 pathB.close();
1833 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1834}
caryclark@google.comfa2aeee2013-07-15 13:29:13 +00001835
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00001836#define ISSUE_1417_WORKING_ON_LINUX_32 0
1837#if ISSUE_1417_WORKING_ON_LINUX_32
skia.committer@gmail.com977409a2013-07-16 07:00:56 +00001838static void issue1417(skiatest::Reporter* reporter) {
skia.committer@gmail.com7f1af502013-07-24 07:01:12 +00001839 SkPath path1;
1840 path1.moveTo(122.58908843994140625f, 82.2836456298828125f);
1841 path1.quadTo(129.8215789794921875f, 80, 138, 80);
1842 path1.quadTo(147.15692138671875f, 80, 155.1280364990234375f, 82.86279296875f);
1843 path1.lineTo(161.1764678955078125f, 100);
1844 path1.lineTo(161.1764678955078125f, 100);
1845 path1.lineTo(115.29412078857421875f, 100);
1846 path1.lineTo(115.29412078857421875f, 100);
1847 path1.lineTo(122.58908843994140625f, 82.2836456298828125f);
1848 path1.lineTo(122.58908843994140625f, 82.2836456298828125f);
1849 path1.close();
1850 path1.moveTo(98.68194580078125f, 140.343841552734375f);
1851 path1.lineTo(115.29412078857421875f, 100);
1852 path1.lineTo(115.29412078857421875f, 100);
1853 path1.lineTo(97.9337615966796875f, 100);
1854 path1.lineTo(97.9337615966796875f, 100);
1855 path1.quadTo(88, 112.94264984130859375f, 88, 130);
1856 path1.quadTo(88, 131.544830322265625f, 88.08148956298828125f, 133.0560302734375f);
1857 path1.lineTo(98.68194580078125f, 140.343841552734375f);
1858 path1.lineTo(98.68194580078125f, 140.343841552734375f);
1859 path1.close();
1860 path1.moveTo(136.969696044921875f, 166.6666717529296875f);
1861 path1.lineTo(98.68194580078125f, 140.343841552734375f);
1862 path1.lineTo(98.68194580078125f, 140.343841552734375f);
1863 path1.lineTo(93.45894622802734375f, 153.02825927734375f);
1864 path1.lineTo(93.45894622802734375f, 153.02825927734375f);
1865 path1.quadTo(96.94116973876953125f, 159.65185546875f, 102.64466094970703125f, 165.3553466796875f);
1866 path1.quadTo(110.7924652099609375f, 173.503143310546875f, 120.8179779052734375f, 177.1177825927734375f);
1867 path1.lineTo(136.969696044921875f, 166.6666717529296875f);
1868 path1.lineTo(136.969696044921875f, 166.6666717529296875f);
1869 path1.close();
1870 path1.moveTo(175.8309783935546875f, 141.5211334228515625f);
1871 path1.lineTo(136.969696044921875f, 166.6666717529296875f);
1872 path1.lineTo(136.969696044921875f, 166.6666717529296875f);
1873 path1.lineTo(153.15728759765625f, 177.7956390380859375f);
1874 path1.lineTo(153.15728759765625f, 177.7956390380859375f);
1875 path1.quadTo(164.392425537109375f, 174.318267822265625f, 173.3553466796875f, 165.3553466796875f);
1876 path1.quadTo(177.805816650390625f, 160.9048614501953125f, 180.90380859375f, 155.8941650390625f);
1877 path1.lineTo(175.8309783935546875f, 141.5211334228515625f);
1878 path1.lineTo(175.8309783935546875f, 141.5211334228515625f);
1879 path1.close();
1880 path1.moveTo(175.8309783935546875f, 141.5211334228515625f);
1881 path1.lineTo(187.8782806396484375f, 133.7258148193359375f);
1882 path1.lineTo(187.8782806396484375f, 133.7258148193359375f);
1883 path1.quadTo(188, 131.8880615234375f, 188, 130);
1884 path1.quadTo(188, 112.942657470703125f, 178.0662384033203125f, 100);
1885 path1.lineTo(161.1764678955078125f, 100);
1886 path1.lineTo(161.1764678955078125f, 100);
1887 path1.lineTo(175.8309783935546875f, 141.5211334228515625f);
1888 path1.lineTo(175.8309783935546875f, 141.5211334228515625f);
1889 path1.close();
1890
1891 SkPath path2;
1892 path2.moveTo(174.117645263671875f, 100);
1893 path2.lineTo(161.1764678955078125f, 100);
1894 path2.lineTo(161.1764678955078125f, 100);
1895 path2.lineTo(155.1280364990234375f, 82.86279296875f);
1896 path2.lineTo(155.1280364990234375f, 82.86279296875f);
1897 path2.quadTo(153.14971923828125f, 82.15229034423828125f, 151.098419189453125f, 81.618133544921875f);
1898 path2.lineTo(143.5294189453125f, 100);
1899 path2.lineTo(143.5294189453125f, 100);
1900 path2.lineTo(161.1764678955078125f, 100);
1901 path2.lineTo(161.1764678955078125f, 100);
1902 path2.lineTo(168.23529052734375f, 120);
1903 path2.lineTo(168.23529052734375f, 120);
1904 path2.lineTo(181.1764678955078125f, 120);
1905 path2.lineTo(181.1764678955078125f, 120);
1906 path2.lineTo(186.3661956787109375f, 134.7042236328125f);
1907 path2.lineTo(186.3661956787109375f, 134.7042236328125f);
1908 path2.lineTo(187.8782806396484375f, 133.7258148193359375f);
1909 path2.lineTo(187.8782806396484375f, 133.7258148193359375f);
1910 path2.quadTo(188, 131.8880615234375f, 188, 130);
1911 path2.quadTo(188, 124.80947113037109375f, 187.080169677734375f, 120);
1912 path2.lineTo(181.1764678955078125f, 120);
1913 path2.lineTo(181.1764678955078125f, 120);
1914 path2.lineTo(174.117645263671875f, 100);
1915 path2.lineTo(174.117645263671875f, 100);
1916 path2.close();
1917 path2.moveTo(88.91983795166015625f, 120);
1918 path2.lineTo(107.0588226318359375f, 120);
1919 path2.lineTo(107.0588226318359375f, 120);
1920 path2.lineTo(98.68194580078125f, 140.343841552734375f);
1921 path2.lineTo(98.68194580078125f, 140.343841552734375f);
1922 path2.lineTo(88.08148956298828125f, 133.0560302734375f);
1923 path2.lineTo(88.08148956298828125f, 133.0560302734375f);
1924 path2.quadTo(88, 131.544830322265625f, 88, 130);
1925 path2.quadTo(88, 124.80951690673828125f, 88.91983795166015625f, 120);
1926 path2.close();
1927 path2.moveTo(96.67621612548828125f, 145.21490478515625f);
1928 path2.lineTo(98.68194580078125f, 140.343841552734375f);
1929 path2.lineTo(98.68194580078125f, 140.343841552734375f);
1930 path2.lineTo(120.68767547607421875f, 155.4727783203125f);
1931 path2.lineTo(120.68767547607421875f, 155.4727783203125f);
1932 path2.lineTo(118.68194580078125f, 160.343841552734375f);
1933 path2.lineTo(118.68194580078125f, 160.343841552734375f);
1934 path2.lineTo(96.67621612548828125f, 145.21490478515625f);
1935 path2.lineTo(96.67621612548828125f, 145.21490478515625f);
1936 path2.close();
1937 path2.moveTo(113.232177734375f, 173.5789947509765625f);
1938 path2.quadTo(116.8802642822265625f, 175.69805908203125f, 120.8179779052734375f, 177.1177825927734375f);
1939 path2.lineTo(132.2864990234375f, 169.6969757080078125f);
1940 path2.lineTo(132.2864990234375f, 169.6969757080078125f);
1941 path2.lineTo(118.68194580078125f, 160.343841552734375f);
1942 path2.lineTo(118.68194580078125f, 160.343841552734375f);
1943 path2.lineTo(113.232177734375f, 173.5789947509765625f);
1944 path2.lineTo(113.232177734375f, 173.5789947509765625f);
1945 path2.close();
skia.committer@gmail.com977409a2013-07-16 07:00:56 +00001946
1947 testPathOp(reporter, path1, path2, kUnion_PathOp);
1948}
caryclark@google.com3dd27842013-07-15 15:00:58 +00001949#endif
1950
skia.committer@gmail.com977409a2013-07-16 07:00:56 +00001951static void issue1418(skiatest::Reporter* reporter) {
skia.committer@gmail.com7f1af502013-07-24 07:01:12 +00001952 SkPath path1;
1953 path1.moveTo(0, 0);
1954 path1.lineTo(1, 0);
1955 path1.lineTo(1, 0);
1956 path1.lineTo(1, 1);
1957 path1.lineTo(1, 1);
1958 path1.lineTo(0, 1);
1959 path1.lineTo(0, 1);
1960 path1.lineTo(0, 0);
1961 path1.lineTo(0, 0);
1962 path1.close();
1963
1964 SkPath path2;
1965 path2.moveTo(0.64644664525985717773f, -0.35355341434478759766f);
1966 path2.quadTo(0.79289329051971435547f, -0.50000005960464477539f, 1.0000001192092895508f, -0.50000005960464477539f);
1967 path2.quadTo(1.2071068286895751953f, -0.50000005960464477539f, 1.3535535335540771484f, -0.35355341434478759766f);
1968 path2.quadTo(1.5000001192092895508f, -0.20710679888725280762f, 1.5000001192092895508f, 0);
1969 path2.quadTo(1.5000001192092895508f, 0.20710679888725280762f, 1.3535535335540771484f, 0.35355341434478759766f);
1970 path2.quadTo(1.2071068286895751953f, 0.50000005960464477539f, 1.0000001192092895508f, 0.50000005960464477539f);
1971 path2.quadTo(0.79289329051971435547f, 0.50000005960464477539f, 0.64644664525985717773f, 0.35355341434478759766f);
1972 path2.quadTo(0.50000005960464477539f, 0.20710679888725280762f, 0.50000005960464477539f, 0);
caryclark@google.com4fdbb222013-07-23 15:27:41 +00001973 path2.quadTo(0.50000005960464477539f, -0.20710679888725280762f, 0.64644664525985717773f, -0.35355341434478759766f);
skia.committer@gmail.com977409a2013-07-16 07:00:56 +00001974 testPathOp(reporter, path1, path2, kIntersect_PathOp);
1975}
caryclark@google.com4fdbb222013-07-23 15:27:41 +00001976
skia.committer@gmail.com7f1af502013-07-24 07:01:12 +00001977static void cubicOp85i(skiatest::Reporter* reporter) {
1978 SkPath path, pathB;
1979 path.setFillType(SkPath::kWinding_FillType);
1980 path.moveTo(3, 4);
1981 path.cubicTo(1, 5, 4, 3, 6, 4);
1982 path.close();
1983 pathB.setFillType(SkPath::kWinding_FillType);
1984 pathB.moveTo(3, 4);
1985 pathB.cubicTo(4, 6, 4, 3, 5, 1);
1986 pathB.close();
1987 testPathOp(reporter, path, pathB, kIntersect_PathOp);
caryclark@google.com4fdbb222013-07-23 15:27:41 +00001988}
1989
caryclark@google.com570863f2013-09-16 15:55:01 +00001990static void issue1418b(skiatest::Reporter* reporter) {
1991 SkPath path1;
1992 path1.moveTo(0, 0);
1993 path1.lineTo(1, 0);
1994 path1.lineTo(1, 1);
1995 path1.lineTo(0, 1);
1996 path1.lineTo(0, 0);
1997 path1.close();
1998 path1.setFillType(SkPath::kWinding_FillType);
1999 SkPath path2;
2000 path2.moveTo(0.646446645f, -0.353553414f);
2001 path2.quadTo(0.792893291f, -0.50000006f, 1.00000012f, -0.50000006f);
2002 path2.quadTo(1.20710683f, -0.50000006f, 1.35355353f, -0.353553414f);
2003 path2.quadTo(1.50000012f, -0.207106799f, 1.50000012f, 0);
2004 path2.quadTo(1.50000012f, 0.207106799f, 1.35355353f, 0.353553414f);
2005 path2.quadTo(1.20710683f, 0.50000006f, 1.00000012f, 0.50000006f);
2006 path2.quadTo(0.792893291f, 0.50000006f, 0.646446645f, 0.353553414f);
2007 path2.quadTo(0.50000006f, 0.207106799f, 0.50000006f, 0);
2008 path2.quadTo(0.50000006f, -0.207106799f, 0.646446645f, -0.353553414f);
2009 path2.close();
2010 path2.moveTo(1.00000012f, 0.50000006f);
2011 path2.lineTo(1.00000012f, 1.00000012f);
2012 path2.lineTo(0.50000006f, 1.00000012f);
2013 path2.quadTo(0.50000006f, 0.792893291f, 0.646446645f, 0.646446645f);
2014 path2.quadTo(0.792893291f, 0.50000006f, 1.00000012f, 0.50000006f);
2015 path2.close();
2016 path2.setFillType(SkPath::kEvenOdd_FillType);
2017 testPathOp(reporter, path1, path2, kIntersect_PathOp);
2018}
2019
2020static void rectOp1i(skiatest::Reporter* reporter) {
2021 SkPath path, pathB;
2022 path.setFillType(SkPath::kWinding_FillType);
2023 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
2024 path.addRect(2, 2, 4, 4, SkPath::kCW_Direction);
2025 pathB.setFillType(SkPath::kWinding_FillType);
2026 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
2027 pathB.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
2028 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2029}
2030
2031static void rectOp2i(skiatest::Reporter* reporter) {
2032 SkPath path, pathB;
2033 path.setFillType(SkPath::kEvenOdd_FillType);
2034 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
2035 path.addRect(0, 0, 3, 3, SkPath::kCW_Direction);
2036 pathB.setFillType(SkPath::kWinding_FillType);
2037 pathB.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
2038 pathB.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
2039 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2040}
2041
2042static void rectOp3x(skiatest::Reporter* reporter) {
2043 SkPath path, pathB;
2044 path.setFillType(SkPath::kEvenOdd_FillType);
2045 path.moveTo(0, 0);
2046 path.lineTo(3, 0);
2047 path.lineTo(3, 3);
2048 path.lineTo(0, 3);
2049 path.close();
2050 path.moveTo(2, 2);
2051 path.lineTo(3, 2);
2052 path.lineTo(3, 3);
2053 path.lineTo(2, 3);
2054 path.close();
2055 pathB.setFillType(SkPath::kWinding_FillType);
2056 pathB.moveTo(1, 1);
2057 pathB.lineTo(3, 1);
2058 pathB.lineTo(3, 3);
2059 pathB.lineTo(1, 3);
2060 pathB.close();
2061 pathB.moveTo(2, 2);
2062 pathB.lineTo(3, 2);
2063 pathB.lineTo(3, 3);
2064 pathB.lineTo(2, 3);
2065 pathB.close();
2066 testPathOp(reporter, path, pathB, kXOR_PathOp);
2067}
2068
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002069#define ISSUE_1435_WORKING 0
2070#if ISSUE_1435_WORKING
caryclark@google.com570863f2013-09-16 15:55:01 +00002071static void issue1435(skiatest::Reporter* reporter) {
2072 SkPath path1;
2073 path1.moveTo(160, 60);
2074 path1.lineTo(220, 230);
2075 path1.lineTo(60, 120);
2076 path1.lineTo(260, 120);
2077 path1.lineTo(90, 230);
2078 path1.lineTo(160, 60);
2079 path1.close();
2080 path1.setFillType(SkPath::kEvenOdd_FillType);
2081
2082
2083 SkPath path2;
2084 path2.moveTo(142.589081f, 102.283646f);
2085 path2.quadTo(149.821579f, 100, 158, 100);
2086 path2.quadTo(167.156921f, 100, 175.128036f, 102.862793f);
2087 path2.lineTo(181.176468f, 120);
2088 path2.lineTo(135.294128f, 120);
2089 path2.lineTo(142.589081f, 102.283646f);
2090 path2.close();
2091 path2.moveTo(118.681946f, 160.343842f);
2092 path2.lineTo(135.294128f, 120);
2093 path2.lineTo(117.933762f, 120);
2094 path2.quadTo(108, 132.942657f, 108, 150);
2095 path2.quadTo(108, 151.54483f, 108.08149f, 153.05603f);
2096 path2.lineTo(118.681946f, 160.343842f);
2097 path2.close();
2098 path2.moveTo(156.969696f, 186.666672f);
2099 path2.lineTo(118.681946f, 160.343842f);
2100 path2.lineTo(113.458946f, 173.028259f);
2101 path2.quadTo(116.94117f, 179.651855f, 122.644661f, 185.355347f);
2102 path2.quadTo(130.792465f, 193.503143f, 140.817978f, 197.117783f);
2103 path2.lineTo(156.969696f, 186.666672f);
2104 path2.close();
2105 path2.moveTo(195.830978f, 161.521133f);
2106 path2.lineTo(156.969696f, 186.666672f);
2107 path2.lineTo(173.157288f, 197.795639f);
2108 path2.quadTo(184.392426f, 194.318268f, 193.355347f, 185.355347f);
2109 path2.quadTo(197.805817f, 180.904861f, 200.903809f, 175.894165f);
2110 path2.lineTo(195.830978f, 161.521133f);
2111 path2.close();
2112 path2.moveTo(195.830978f, 161.521133f);
2113 path2.lineTo(207.878281f, 153.725815f);
2114 path2.quadTo(208, 151.888062f, 208, 150);
2115 path2.quadTo(208, 132.942657f, 198.066238f, 120);
2116 path2.lineTo(181.176468f, 120);
2117 path2.lineTo(195.830978f, 161.521133f);
2118 path2.close();
2119 path2.setFillType(SkPath::kEvenOdd_FillType);
2120 testPathOp(reporter, path1, path2, kIntersect_PathOp);
2121}
2122#endif
2123
caryclark@google.com570863f2013-09-16 15:55:01 +00002124static void bufferOverflow(skiatest::Reporter* reporter) {
2125 SkPath path;
caryclark@google.comf614b762013-10-02 15:07:52 +00002126 path.addRect(0,0, 300,170141183460469231731687303715884105728.f);
caryclark@google.com570863f2013-09-16 15:55:01 +00002127 SkPath pathB;
2128 pathB.addRect(0,0, 300,16);
2129 testPathOp(reporter, path, pathB, kUnion_PathOp);
2130}
caryclark@google.com570863f2013-09-16 15:55:01 +00002131
skia.committer@gmail.com7f1af502013-07-24 07:01:12 +00002132static void skpkkiste_to716(skiatest::Reporter* reporter) {
2133 SkPath path;
2134 path.setFillType(SkPath::kEvenOdd_FillType);
2135 path.moveTo(1173, 284);
2136 path.cubicTo(1173, 285.125824f, 1173.37207f, 286.164734f, 1174, 287.000488f);
2137 path.lineTo(1174, 123.999496f);
2138 path.cubicTo(1173.37207f, 124.835243f, 1173, 125.874168f, 1173, 127);
2139 path.lineTo(1173, 284);
2140 path.close();
2141 SkPath pathB;
2142 pathB.setFillType(SkPath::kWinding_FillType);
2143 pathB.moveTo(1340, 122);
2144 pathB.cubicTo(1342.76147f, 122, 1345, 124.238579f, 1345, 127);
2145 pathB.lineTo(1345, 284);
2146 pathB.cubicTo(1345, 286.761414f, 1342.76147f, 289, 1340, 289);
2147 pathB.lineTo(1178, 289);
2148 pathB.cubicTo(1175.23853f, 289, 1173, 286.761414f, 1173, 284);
2149 pathB.lineTo(1173, 127);
2150 pathB.cubicTo(1173, 124.238579f, 1175.23853f, 122, 1178, 122);
2151 pathB.lineTo(1340, 122);
2152 pathB.close();
2153 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2154}
caryclark@google.com3dd27842013-07-15 15:00:58 +00002155
caryclark@google.com570863f2013-09-16 15:55:01 +00002156static void loopEdge1(skiatest::Reporter* reporter) {
2157 SkPath path;
2158 path.setFillType(SkPath::kEvenOdd_FillType);
2159 path.moveTo(0,0);
2160 path.lineTo(3,0);
2161 path.lineTo(3,2);
2162 path.lineTo(1,2);
2163 path.lineTo(1,1);
2164 path.lineTo(2,1);
2165 path.lineTo(2,3);
2166 path.lineTo(0,3);
2167 path.close();
2168 SkPath pathB;
2169 pathB.setFillType(SkPath::kEvenOdd_FillType);
2170 pathB.moveTo(1,2);
2171 pathB.lineTo(2,2);
2172 pathB.lineTo(2,4);
2173 pathB.lineTo(1,4);
2174 pathB.close();
2175 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2176}
2177
2178static void loopEdge2(skiatest::Reporter* reporter) {
2179 SkPath path;
2180 path.setFillType(SkPath::kEvenOdd_FillType);
2181 path.moveTo(0,0);
2182 path.lineTo(3,0);
2183 path.lineTo(3,2);
2184 path.lineTo(1,2);
2185 path.lineTo(1,1);
2186 path.lineTo(2,1);
2187 path.lineTo(2,3);
2188 path.lineTo(0,3);
2189 path.close();
2190 SkPath pathB;
2191 pathB.setFillType(SkPath::kEvenOdd_FillType);
2192 pathB.moveTo(1 - 1e-6f,2);
2193 pathB.lineTo(2 - 1e-6f,2);
2194 pathB.lineTo(2 - 1e-6f,4);
2195 pathB.lineTo(1 - 1e-6f,4);
2196 pathB.close();
2197 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2198}
2199
2200static void cubicOp86i(skiatest::Reporter* reporter) {
2201 SkPath path, pathB;
2202 path.setFillType(SkPath::kWinding_FillType);
2203 path.moveTo(0, 4);
2204 path.cubicTo(3, 4, 6, 2, 5, 2);
2205 path.close();
2206 pathB.setFillType(SkPath::kEvenOdd_FillType);
2207 pathB.moveTo(2, 6);
2208 pathB.cubicTo(2, 5, 4, 0, 4, 3);
2209 pathB.close();
2210 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2211}
2212
2213static void cubicOp87u(skiatest::Reporter* reporter) {
2214 SkPath path, pathB;
2215 path.setFillType(SkPath::kWinding_FillType);
2216 path.moveTo(0,1);
2217 path.cubicTo(0,2, 2,0, 6,4);
2218 path.close();
2219 pathB.setFillType(SkPath::kWinding_FillType);
2220 pathB.moveTo(0,2);
2221 pathB.cubicTo(4,6, 1,0, 2,0);
2222 pathB.close();
2223 testPathOp(reporter, path, pathB, kUnion_PathOp);
2224}
2225
2226static void cubicOp88u(skiatest::Reporter* reporter) {
2227 SkPath path, pathB;
2228 path.setFillType(SkPath::kWinding_FillType);
2229 path.moveTo(0,1);
2230 path.cubicTo(2,5, 5,0, 6,4);
2231 path.close();
2232 pathB.setFillType(SkPath::kWinding_FillType);
2233 pathB.moveTo(0,5);
2234 pathB.cubicTo(4,6, 1,0, 5,2);
2235 pathB.close();
2236 testPathOp(reporter, path, pathB, kUnion_PathOp);
2237}
2238
2239static void cubicOp89u(skiatest::Reporter* reporter) {
2240 SkPath path, pathB;
2241 path.setFillType(SkPath::kWinding_FillType);
2242 path.moveTo(0, 3);
2243 path.cubicTo(1, 6, 5, 0, 6, 3);
2244 path.close();
2245 pathB.setFillType(SkPath::kWinding_FillType);
2246 pathB.moveTo(0, 5);
2247 pathB.cubicTo(3, 6, 3, 0, 6, 1);
2248 pathB.close();
2249 testPathOp(reporter, path, pathB, kUnion_PathOp);
2250}
2251
2252static void cubicOp90u(skiatest::Reporter* reporter) {
2253 SkPath path, pathB;
2254 path.setFillType(SkPath::kEvenOdd_FillType);
2255 path.moveTo(0, 5);
2256 path.cubicTo(1, 2, 5, 2, 4, 1);
2257 path.close();
2258 pathB.setFillType(SkPath::kEvenOdd_FillType);
2259 pathB.moveTo(2, 5);
2260 pathB.cubicTo(1, 4, 5, 0, 2, 1);
2261 pathB.close();
2262 testPathOp(reporter, path, pathB, kUnion_PathOp);
2263}
2264
2265static void cubicOp91u(skiatest::Reporter* reporter) {
2266 SkPath path, pathB;
2267 path.setFillType(SkPath::kWinding_FillType);
2268 path.moveTo(1, 6);
2269 path.cubicTo(0, 3, 6, 3, 5, 0);
2270 path.close();
2271 pathB.setFillType(SkPath::kWinding_FillType);
2272 pathB.moveTo(3, 6);
2273 pathB.cubicTo(0, 5, 6, 1, 3, 0);
2274 pathB.close();
2275 testPathOp(reporter, path, pathB, kUnion_PathOp);
2276}
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002277
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002278static void skpaaalgarve_org53(skiatest::Reporter* reporter) { // add t cancel
2279 SkPath path;
2280 path.setFillType(SkPath::kEvenOdd_FillType);
2281 path.moveTo(-1.24344979e-014f, 348);
2282 path.lineTo(258, 348);
2283 path.lineTo(258, 322);
2284 path.quadTo(258, 317.857849f, 255.072006f, 314.928009f);
2285 path.quadTo(252.142136f, 312, 248, 312);
2286 path.lineTo(1.77635684e-015f, 312);
2287 path.lineTo(-1.24344979e-014f, 348);
2288 path.close();
2289 SkPath pathB;
2290 pathB.setFillType(SkPath::kWinding_FillType);
2291 pathB.moveTo(0, 312);
2292 pathB.lineTo(258, 312);
2293 pathB.lineTo(258, 348);
2294 pathB.lineTo(0, 348);
2295 pathB.close();
2296 testPathOp(reporter, path, pathB, kIntersect_PathOp);
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002297}
2298
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002299static void skpabcspark_ca103(skiatest::Reporter* reporter) { // add t cancel
2300 SkPath path;
2301 path.setFillType(SkPath::kEvenOdd_FillType);
2302 path.moveTo(1.99840144e-015f, 494);
2303 path.lineTo(97, 494);
2304 path.quadTo(100.313705f, 494, 102.6576f, 491.657593f);
2305 path.quadTo(105, 489.313721f, 105, 486);
2306 path.lineTo(105, 425);
2307 path.quadTo(105, 421.686279f, 102.6576f, 419.342407f);
2308 path.quadTo(100.313705f, 417, 97, 417);
2309 path.lineTo(2.22044605e-016f, 417);
2310 path.lineTo(1.99840144e-015f, 494);
2311 path.close();
2312 SkPath pathB;
2313 pathB.setFillType(SkPath::kWinding_FillType);
2314 pathB.moveTo(0, 417);
2315 pathB.lineTo(105, 417);
2316 pathB.lineTo(105, 494);
2317 pathB.lineTo(0, 494);
2318 pathB.close();
2319 testPathOp(reporter, path, pathB, kIntersect_PathOp);
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002320}
2321
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002322static void skpacesoftech_com47(skiatest::Reporter* reporter) { // partial coincidence
2323 SkPath path;
2324 path.setFillType(SkPath::kEvenOdd_FillType);
2325 path.moveTo(670.537415f, 285);
2326 path.lineTo(670.387451f, 285);
2327 path.lineTo(596.315186f, 314.850708f);
2328 path.lineTo(626.19696f, 389);
2329 path.lineTo(626.346863f, 389);
2330 path.lineTo(700.419189f, 359.149261f);
2331 path.lineTo(670.537415f, 285);
2332 path.close();
2333 SkPath pathB;
2334 pathB.setFillType(SkPath::kWinding_FillType);
2335 pathB.moveTo(663.318542f, 374.100616f);
2336 pathB.quadTo(647.950989f, 380.293671f, 632.705322f, 373.806305f);
2337 pathB.quadTo(617.459595f, 367.318909f, 611.266541f, 351.951355f);
2338 pathB.quadTo(605.073486f, 336.58374f, 611.560913f, 321.338074f);
2339 pathB.quadTo(618.048279f, 306.092407f, 633.415833f, 299.899353f);
2340 pathB.quadTo(648.783447f, 293.706299f, 664.029114f, 300.193665f);
2341 pathB.quadTo(679.27478f, 306.68103f, 685.467834f, 322.048645f);
2342 pathB.quadTo(691.660889f, 337.416199f, 685.173523f, 352.661896f);
2343 pathB.quadTo(678.686157f, 367.907562f, 663.318542f, 374.100616f);
2344 pathB.close();
2345 testPathOp(reporter, path, pathB, kIntersect_PathOp);
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002346}
2347
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002348static void skpact_com43(skiatest::Reporter* reporter) { // bridge op
2349 SkPath path;
2350 path.setFillType(SkPath::kEvenOdd_FillType);
2351 path.moveTo(1.45716772e-016f, 924.336121f);
2352 path.lineTo(-1.11022302e-016f, 920);
2353 path.lineTo(6, 920);
2354 path.lineTo(6, 926);
2355 path.lineTo(1.66389287f, 926);
2356 path.quadTo(1.18842196f, 925.674561f, 0.756800175f, 925.243225f);
2357 path.quadTo(0.325406998f, 924.811523f, 1.45716772e-016f, 924.336121f);
2358 path.close();
2359 path.moveTo(1, 921);
2360 path.lineTo(5, 921);
2361 path.lineTo(5, 925);
2362 path.cubicTo(2.79086018f, 925, 1, 923.209167f, 1, 921);
2363 path.close();
2364 SkPath pathB;
2365 pathB.setFillType(SkPath::kWinding_FillType);
2366 pathB.moveTo(-1, 920);
2367 pathB.lineTo(0, 920);
2368 pathB.lineTo(3, 927);
2369 pathB.lineTo(-1, 927);
2370 testPathOp(reporter, path, pathB, kIntersect_PathOp);
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002371}
2372
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002373static void skpadbox_lt8(skiatest::Reporter* reporter) { // zero span
2374 SkPath path;
2375 path.setFillType(SkPath::kEvenOdd_FillType);
2376 path.moveTo(320.097229f, 628.573669f);
2377 path.lineTo(610.227173f, 85.7786865f);
2378 path.lineTo(946.652588f, 265.601807f);
2379 path.lineTo(656.522644f, 808.39679f);
2380 path.lineTo(320.097229f, 628.573669f);
2381 path.close();
2382 SkPath pathB;
2383 pathB.setFillType(SkPath::kInverseWinding_FillType);
2384 pathB.moveTo(333.866608f, 623.496155f);
2385 pathB.lineTo(613.368042f, 100.585754f);
2386 pathB.cubicTo(613.685303f, 99.9921265f, 614.423767f, 99.7681885f, 615.017395f, 100.085449f);
2387 pathB.lineTo(932.633057f, 269.854553f);
2388 pathB.cubicTo(933.226685f, 270.171875f, 933.450623f, 270.910278f, 933.133301f, 271.503906f);
2389 pathB.lineTo(653.631897f, 794.414307f);
2390 pathB.cubicTo(653.314636f, 795.007935f, 652.576172f, 795.231934f, 651.982544f, 794.914612f);
2391 pathB.lineTo(334.366943f, 625.145508f);
2392 pathB.cubicTo(333.773315f, 624.828247f, 333.549286f, 624.089783f, 333.866608f, 623.496155f);
2393 pathB.close();
2394 testPathOp(reporter, path, pathB, kIntersect_PathOp);
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002395}
2396
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002397static void skpadindex_de4(skiatest::Reporter* reporter) { // find chase op
2398 SkPath path;
2399 path.setFillType(SkPath::kEvenOdd_FillType);
2400 path.moveTo(0, 926);
2401 path.lineTo(0, 0);
2402 path.lineTo(1280, 0);
2403 path.lineTo(1280, 926);
2404 path.lineTo(0, 926);
2405 path.close();
2406 SkPath pathB;
2407 pathB.setFillType(SkPath::kWinding_FillType);
2408 pathB.moveTo(0, 312);
2409 pathB.lineTo(8.20486257e-015f, 178);
2410 pathB.lineTo(49, 178);
2411 pathB.lineTo(49, 312);
2412 pathB.close();
2413 testPathOp(reporter, path, pathB, kIntersect_PathOp);
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002414}
2415
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002416static void skpadithya_putr4_blogspot_com551(skiatest::Reporter* reporter) { // calc common
2417 SkPath path;
2418 path.setFillType(SkPath::kEvenOdd_FillType);
2419 path.moveTo(205.605804f, 142.334625f);
2420 path.lineTo(254.665359f, 85.6058044f);
2421 path.lineTo(311.394196f, 134.665359f);
2422 path.lineTo(262.334625f, 191.39418f);
2423 path.lineTo(205.605804f, 142.334625f);
2424 path.close();
2425 SkPath pathB;
2426 pathB.setFillType(SkPath::kWinding_FillType);
2427 pathB.moveTo(283.407959f, 110.462646f);
2428 pathB.cubicTo(298.864319f, 123.829437f, 300.558258f, 147.195221f, 287.191467f, 162.651581f);
2429 pathB.lineTo(286.537354f, 163.407959f);
2430 pathB.cubicTo(273.170563f, 178.864334f, 249.804779f, 180.558258f, 234.348419f, 167.191467f);
2431 pathB.lineTo(233.592026f, 166.537338f);
2432 pathB.cubicTo(218.135666f, 153.170547f, 216.441727f, 129.804779f, 229.808517f, 114.348412f);
2433 pathB.lineTo(230.462646f, 113.592026f);
2434 pathB.cubicTo(243.829437f, 98.1356659f, 267.195221f, 96.4417267f, 282.651581f, 109.808517f);
2435 pathB.lineTo(283.407959f, 110.462646f);
2436 pathB.close();
2437 testPathOp(reporter, path, pathB, kIntersect_PathOp);
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002438}
2439
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002440static void skpadspert_de11(skiatest::Reporter* reporter) { // mark and chase winding
2441 SkPath path;
2442 path.setFillType(SkPath::kEvenOdd_FillType);
2443 path.moveTo(-4.4408921e-016f, 682.5f);
2444 path.lineTo(30.5f, 682.5f);
2445 path.cubicTo(32.709137f, 682.5f, 34.5f, 680.709167f, 34.5f, 678.5f);
2446 path.lineTo(34.5f, 486.5f);
2447 path.cubicTo(34.5f, 484.290863f, 32.709137f, 482.5f, 30.5f, 482.5f);
2448 path.lineTo(0, 482.5f);
2449 path.lineTo(-4.4408921e-016f, 682.5f);
2450 path.close();
2451 SkPath pathB;
2452 pathB.setFillType(SkPath::kWinding_FillType);
2453 pathB.moveTo(0, 482);
2454 pathB.lineTo(35, 482);
2455 pathB.lineTo(35, 683);
2456 pathB.lineTo(0, 683);
2457 pathB.close();
2458 testPathOp(reporter, path, pathB, kIntersect_PathOp);
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002459}
2460
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002461static void skpaiaigames_com870(skiatest::Reporter* reporter) { // cubic/cubic intersect
2462 SkPath path;
2463 path.setFillType(SkPath::kEvenOdd_FillType);
2464 path.moveTo(324.071075f, 845.071045f);
2465 path.cubicTo(324.405151f, 844.737f, 324.715668f, 844.379395f, 325, 844.000977f);
2466 path.lineTo(325, 842.127197f);
2467 path.cubicTo(324.571411f, 842.956238f, 324.017761f, 843.710144f, 323.363953f, 844.363953f);
2468 path.lineTo(324.071075f, 845.071045f);
2469 path.close();
2470 path.moveTo(323.363953f, 714.636047f);
2471 path.lineTo(324.071075f, 713.928955f);
2472 path.cubicTo(324.405151f, 714.263f, 324.715668f, 714.620605f, 325, 714.999023f);
2473 path.lineTo(325, 716.872803f);
2474 path.cubicTo(324.571411f, 716.043762f, 324.017761f, 715.289856f, 323.363953f, 714.636047f);
2475 path.close();
2476 SkPath pathB;
2477 pathB.setFillType(SkPath::kWinding_FillType);
2478 pathB.moveTo(317, 711);
2479 pathB.cubicTo(322.522858f, 711, 327, 715.477173f, 327, 721);
2480 pathB.lineTo(327, 838);
2481 pathB.cubicTo(327, 843.522827f, 322.522858f, 848, 317, 848);
2482 pathB.lineTo(155, 848);
2483 pathB.cubicTo(149.477158f, 848, 145, 843.522827f, 145, 838);
2484 pathB.lineTo(145, 721);
2485 pathB.cubicTo(145, 715.477173f, 149.477158f, 711, 155, 711);
2486 pathB.lineTo(317, 711);
2487 pathB.close();
2488 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2489}
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002490
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002491static void cubicOp92i(skiatest::Reporter* reporter) {
2492 SkPath path, pathB;
2493 path.setFillType(SkPath::kWinding_FillType);
2494 path.moveTo(0, 1);
2495 path.cubicTo(2, 6, 4, 1, 5, 4);
2496 path.close();
2497 pathB.setFillType(SkPath::kWinding_FillType);
2498 pathB.moveTo(1, 4);
2499 pathB.cubicTo(4, 5, 1, 0, 6, 2);
2500 pathB.close();
2501 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2502}
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002503
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002504static void cubicOp93d(skiatest::Reporter* reporter) {
2505 SkPath path, pathB;
2506 path.setFillType(SkPath::kWinding_FillType);
2507 path.moveTo(0, 1);
2508 path.cubicTo(1, 6, 4, 1, 4, 3);
2509 path.close();
2510 pathB.setFillType(SkPath::kWinding_FillType);
2511 pathB.moveTo(1, 4);
2512 pathB.cubicTo(3, 4, 1, 0, 6, 1);
2513 pathB.close();
2514 testPathOp(reporter, path, pathB, kDifference_PathOp);
2515}
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002516
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002517static void cubicOp94u(skiatest::Reporter* reporter) {
2518 SkPath path, pathB;
2519 path.setFillType(SkPath::kEvenOdd_FillType);
2520 path.moveTo(0, 3);
2521 path.cubicTo(2, 3, 5, 0, 5, 3);
2522 path.close();
2523 pathB.setFillType(SkPath::kEvenOdd_FillType);
2524 pathB.moveTo(0, 5);
2525 pathB.cubicTo(3, 5, 3, 0, 3, 2);
2526 pathB.close();
2527 testPathOp(reporter, path, pathB, kUnion_PathOp);
2528}
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002529
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002530static void skpadbox_lt15(skiatest::Reporter* reporter) {
2531 SkPath path;
2532 path.setFillType(SkPath::kEvenOdd_FillType);
2533 path.moveTo(333.292084f, 624.570984f);
2534 path.lineTo(614.229797f, 98.9735107f);
2535 path.lineTo(933.457764f, 269.604431f);
2536 path.lineTo(652.52002f, 795.201904f);
2537 path.lineTo(333.292084f, 624.570984f);
2538 path.close();
2539 SkPath pathB;
2540 pathB.setFillType(SkPath::kWinding_FillType);
2541 pathB.moveTo(613.368042f, 100.585754f);
2542 pathB.cubicTo(613.685303f, 99.9921265f, 614.423767f, 99.7681885f, 615.017395f, 100.085449f);
2543 pathB.lineTo(932.633057f, 269.854553f);
2544 pathB.cubicTo(933.226685f, 270.171875f, 933.450623f, 270.910278f, 933.133301f, 271.503906f);
2545 pathB.lineTo(653.631897f, 794.414307f);
2546 pathB.cubicTo(653.314636f, 795.007935f, 652.576172f, 795.231934f, 651.982544f, 794.914612f);
2547 pathB.lineTo(334.366943f, 625.145508f);
2548 pathB.cubicTo(333.773315f, 624.828247f, 333.549286f, 624.089783f, 333.866608f, 623.496155f);
2549 pathB.lineTo(613.368042f, 100.585754f);
2550 pathB.close();
2551 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2552}
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002553
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002554static void skpadoption_org196(skiatest::Reporter* reporter) {
2555 SkPath path;
2556 path.setFillType(SkPath::kEvenOdd_FillType);
2557 path.moveTo(802, 367);
2558 path.lineTo(802, 324);
2559 path.lineTo(956, 324);
2560 path.lineTo(956, 371);
2561 path.quadTo(956, 373.071075f, 954.536011f, 374.536011f);
2562 path.quadTo(953.071045f, 376, 951, 376);
2563 path.lineTo(811, 376);
2564 path.cubicTo(806.029419f, 376, 802, 371.970551f, 802, 367);
2565 path.close();
2566 SkPath pathB;
2567 pathB.setFillType(SkPath::kInverseWinding_FillType);
2568 pathB.moveTo(803, 326);
2569 pathB.lineTo(955, 326);
2570 pathB.lineTo(955, 370);
2571 pathB.cubicTo(955, 372.761414f, 952.761414f, 375, 950, 375);
2572 pathB.lineTo(808, 375);
2573 pathB.cubicTo(805.238586f, 375, 803, 372.761414f, 803, 370);
2574 pathB.lineTo(803, 326);
2575 pathB.close();
2576 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2577}
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002578
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002579static void skpadspert_net23(skiatest::Reporter* reporter) {
2580 SkPath path;
2581 path.setFillType(SkPath::kEvenOdd_FillType);
2582 path.moveTo(-2.220446e-018f, 483.5f);
2583 path.lineTo(0, 482.5f);
2584 path.lineTo(30.5f, 482.5f);
2585 path.cubicTo(32.709137f, 482.5f, 34.5f, 484.290863f, 34.5f, 486.5f);
2586 path.lineTo(34.5f, 678.5f);
2587 path.cubicTo(34.5f, 680.709167f, 32.709137f, 682.5f, 30.5f, 682.5f);
2588 path.lineTo(-4.4408921e-016f, 682.5f);
2589 path.lineTo(-4.41868766e-016f, 681.5f);
2590 path.lineTo(30.5f, 681.5f);
2591 path.cubicTo(32.1568565f, 681.5f, 33.5f, 680.15686f, 33.5f, 678.5f);
2592 path.lineTo(33.5f, 486.5f);
2593 path.cubicTo(33.5f, 484.84314f, 32.1568565f, 483.5f, 30.5f, 483.5f);
2594 path.lineTo(-2.220446e-018f, 483.5f);
2595 path.close();
2596 SkPath pathB;
2597 pathB.setFillType(SkPath::kWinding_FillType);
2598 pathB.moveTo(0, 482);
2599 pathB.lineTo(35, 482);
2600 pathB.lineTo(35, 683);
2601 pathB.lineTo(0, 683);
2602 pathB.close();
2603 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2604}
2605
2606static void skpadventistmission_org572(skiatest::Reporter* reporter) {
2607 SkPath path;
2608 path.setFillType(SkPath::kEvenOdd_FillType);
2609 path.moveTo(1182.00037f, 926);
2610 path.cubicTo(1181.08813f, 924.785583f, 1179.63586f, 924, 1178, 924);
2611 path.lineTo(938, 924);
2612 path.cubicTo(936.364197f, 924, 934.911865f, 924.785583f, 933.999634f, 926);
2613 path.lineTo(1182.00037f, 926);
2614 path.close();
2615 SkPath pathB;
2616 pathB.setFillType(SkPath::kWinding_FillType);
2617 pathB.moveTo(934, 924);
2618 pathB.lineTo(1182, 924);
2619 pathB.lineTo(1182, 926);
2620 pathB.lineTo(934, 926);
2621 pathB.close();
2622 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2623}
2624
2625static void skpagentxsites_com55(skiatest::Reporter* reporter) {
2626 SkPath path;
2627 path.setFillType(SkPath::kEvenOdd_FillType);
2628 path.moveTo(925, 27);
2629 path.cubicTo(924.447693f, 27, 924, 27.4477158f, 924, 28);
2630 path.lineTo(924, 55);
2631 path.cubicTo(924, 55.5522842f, 924.447693f, 56, 925, 56);
2632 path.lineTo(1103, 56);
2633 path.cubicTo(1103.55225f, 56, 1104, 55.5522842f, 1104, 55);
2634 path.lineTo(1104, 28);
2635 path.cubicTo(1104, 27.4477158f, 1103.55225f, 27, 1103, 27);
2636 path.lineTo(925, 27);
2637 path.close();
2638 SkPath pathB;
2639 pathB.setFillType(SkPath::kWinding_FillType);
2640 pathB.moveTo(1103, 27);
2641 pathB.cubicTo(1104.10461f, 27, 1105, 27.8954315f, 1105, 29);
2642 pathB.lineTo(1105, 54);
2643 pathB.cubicTo(1105, 55.1045685f, 1104.10461f, 56, 1103, 56);
2644 pathB.lineTo(926, 56);
2645 pathB.cubicTo(924.895447f, 56, 924, 55.1045685f, 924, 54);
2646 pathB.lineTo(924, 29);
2647 pathB.cubicTo(924, 27.8954315f, 924.895447f, 27, 926, 27);
2648 pathB.lineTo(1103, 27);
2649 pathB.close();
2650 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2651}
2652
2653static void skpbakosoft_com10(skiatest::Reporter* reporter) {
2654 SkPath path;
2655 path.setFillType(SkPath::kEvenOdd_FillType);
2656 path.moveTo(190, 170);
2657 path.cubicTo(178.9543f, 170, 170, 178.9543f, 170, 190);
2658 path.cubicTo(170, 201.0457f, 178.9543f, 210, 190, 210);
2659 path.lineTo(370, 210);
2660 path.cubicTo(381.045685f, 210, 390, 201.0457f, 390, 190);
2661 path.cubicTo(390, 178.9543f, 381.045685f, 170, 370, 170);
2662 path.lineTo(190, 170);
2663 path.close();
2664 SkPath pathB;
2665 pathB.setFillType(SkPath::kWinding_FillType);
2666 pathB.moveTo(210, 190);
2667 pathB.quadTo(210, 198.284271f, 204.142136f, 204.142136f);
2668 pathB.quadTo(198.284271f, 210, 190, 210);
2669 pathB.quadTo(181.715729f, 210, 175.857864f, 204.142136f);
2670 pathB.quadTo(170, 198.284271f, 170, 190);
2671 pathB.quadTo(170, 181.715729f, 175.857864f, 175.857864f);
2672 pathB.quadTo(181.715729f, 170, 190, 170);
2673 pathB.quadTo(198.284271f, 170, 204.142136f, 175.857864f);
2674 pathB.quadTo(210, 181.715729f, 210, 190);
2675 pathB.close();
2676 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2677}
2678
2679static void skpbambootheme_com12(skiatest::Reporter* reporter) {
2680 SkPath path;
2681 path.setFillType(SkPath::kEvenOdd_FillType);
2682 path.moveTo(47.8780937f, 58);
2683 path.lineTo(0, 58);
2684 path.lineTo(-8.65973959e-015f, 96.9914017f);
2685 path.quadTo(20.0654926f, 96.6451874f, 34.3553391f, 82.3553391f);
2686 path.quadTo(44.9466133f, 71.764061f, 47.8780937f, 58);
2687 path.close();
2688 SkPath pathB;
2689 pathB.setFillType(SkPath::kEvenOdd_FillType);
2690 pathB.moveTo(-1, -3);
2691 pathB.lineTo(-1, -3);
2692 pathB.cubicTo(26.6142502f, -3, 49, 19.3857498f, 49, 47);
2693 pathB.lineTo(49, 47);
2694 pathB.cubicTo(49, 74.6142502f, 26.6142502f, 97, -1, 97);
2695 pathB.lineTo(-1, 97);
2696 pathB.cubicTo(-28.6142502f, 97, -51, 74.6142502f, -51, 47);
2697 pathB.lineTo(-51, 47);
2698 pathB.cubicTo(-51, 19.3857498f, -28.6142502f, -3, -1, -3);
2699 pathB.close();
2700 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2701}
2702
2703static void skpakmmos_ru100(skiatest::Reporter* reporter) {
2704 SkPath path;
2705 path.setFillType(SkPath::kEvenOdd_FillType);
2706 path.moveTo(693.000488f, 926);
2707 path.cubicTo(692.164734f, 925.37207f, 691.125793f, 925, 690, 925);
2708 path.lineTo(578, 925);
2709 path.cubicTo(576.874207f, 925, 575.835266f, 925.37207f, 574.999512f, 926);
2710 path.lineTo(693.000488f, 926);
2711 path.close();
2712 SkPath pathB;
2713 pathB.setFillType(SkPath::kWinding_FillType);
2714 pathB.moveTo(575, 925);
2715 pathB.lineTo(693, 925);
2716 pathB.lineTo(693, 926);
2717 pathB.lineTo(575, 926);
2718 pathB.close();
2719 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2720}
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002721
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002722static void skpcarpetplanet_ru22(skiatest::Reporter* reporter) {
2723 SkPath path;
2724 path.setFillType(SkPath::kEvenOdd_FillType);
2725 path.moveTo(195, 785);
2726 path.cubicTo(124.307556f, 785, 67, 841.859863f, 67, 912);
2727 path.lineTo(67, 913);
2728 path.cubicTo(67, 917.388916f, 67.2243805f, 921.725769f, 67.662384f, 926);
2729 path.lineTo(322, 926);
2730 path.lineTo(322, 896.048035f);
2731 path.cubicTo(314.09201f, 833.437622f, 260.247131f, 785, 195, 785);
2732 path.close();
2733 SkPath pathB;
2734 pathB.setFillType(SkPath::kWinding_FillType);
2735 pathB.moveTo(195, 785);
2736 pathB.cubicTo(265.140167f, 785, 322, 842.307556f, 322, 913);
2737 pathB.cubicTo(322, 983.692444f, 265.140167f, 1041, 195, 1041);
2738 pathB.lineTo(194, 1041);
2739 pathB.cubicTo(123.85984f, 1041, 67, 983.692444f, 67, 913);
2740 pathB.cubicTo(67, 842.307556f, 123.85984f, 785, 194, 785);
2741 pathB.lineTo(195, 785);
2742 pathB.close();
2743 testPathOp(reporter, path, pathB, kIntersect_PathOp);
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002744}
2745
caryclark@google.coma2bbc6e2013-11-01 17:36:03 +00002746#define SKPS_WORKING 0
2747#if SKPS_WORKING
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002748static void skpcarrot_is24(skiatest::Reporter* reporter) {
2749 SkPath path;
2750 path.setFillType(SkPath::kEvenOdd_FillType);
2751 path.moveTo(945, 597);
2752 path.quadTo(913.93396f, 597, 891.96698f, 618.96698f);
2753 path.quadTo(870, 640.93396f, 870, 672);
2754 path.quadTo(870, 703.06604f, 891.96698f, 725.03302f);
2755 path.quadTo(913.93396f, 747, 945, 747);
2756 path.quadTo(976.06604f, 747, 998.03302f, 725.03302f);
2757 path.quadTo(1020, 703.06604f, 1020, 672);
2758 path.quadTo(1020, 640.93396f, 998.03302f, 618.96698f);
2759 path.quadTo(976.06604f, 597, 945, 597);
2760 path.close();
2761 SkPath pathB;
2762 pathB.setFillType(SkPath::kWinding_FillType);
2763 pathB.moveTo(945.080994f, 597.161987f);
2764 pathB.cubicTo(903.659973f, 597.161987f, 870.080994f, 630.73999f, 870.080994f, 672.161987f);
2765 pathB.cubicTo(870.080994f, 676.096008f, 870.387024f, 679.957031f, 870.971008f, 683.726013f);
2766 pathB.cubicTo(876.53302f, 719.656006f, 907.593994f, 747.161987f, 945.080994f, 747.161987f);
2767 pathB.cubicTo(982.567993f, 747.161987f, 1013.62903f, 719.656006f, 1019.19104f, 683.726013f);
2768 pathB.cubicTo(1019.77502f, 679.955017f, 1020.08099f, 676.094971f, 1020.08099f, 672.161987f);
2769 pathB.cubicTo(1020.08002f, 630.73999f, 986.502014f, 597.161987f, 945.080994f, 597.161987f);
2770 pathB.close();
2771 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2772}
2773
2774#endif
2775
2776static void skpbangalorenest_com4(skiatest::Reporter* reporter) {
2777 SkPath path;
2778 path.setFillType(SkPath::kEvenOdd_FillType);
2779 path.moveTo(0, 926);
2780 path.lineTo(0, 0);
2781 path.lineTo(1265, 0);
2782 path.lineTo(1265, 926);
2783 path.lineTo(0, 926);
2784 path.close();
2785 SkPath pathB;
2786 pathB.setFillType(SkPath::kWinding_FillType);
2787 pathB.moveTo(0, 290);
2788 pathB.lineTo(-2.64514972e-014f, 146);
2789 pathB.lineTo(30, 146);
2790 pathB.lineTo(30, 290);
2791 pathB.close();
2792 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2793}
2794
2795static void skpbenzoteh_ru152(skiatest::Reporter* reporter) {
2796 SkPath path;
2797 path.setFillType(SkPath::kEvenOdd_FillType);
2798 path.moveTo(883, 23);
2799 path.lineTo(883, 0);
2800 path.lineTo(1122.5f, 0);
2801 path.lineTo(1122.5f, 25.2136822f);
2802 path.quadTo(1122.14441f, 25.9271851f, 1121.53601f, 26.5359993f);
2803 path.quadTo(1120.07104f, 28, 1118, 28);
2804 path.lineTo(888, 28);
2805 path.quadTo(885.928955f, 28, 884.463989f, 26.5359993f);
2806 path.quadTo(883, 25.0710678f, 883, 23);
2807 path.close();
2808 SkPath pathB;
2809 pathB.setFillType(SkPath::kWinding_FillType);
2810 pathB.moveTo(883, 0);
2811 pathB.lineTo(1123, 0);
2812 pathB.lineTo(1123, 23);
2813 pathB.quadTo(1123, 25.0710678f, 1121.53601f, 26.5359993f);
2814 pathB.quadTo(1120.07104f, 28, 1118, 28);
2815 pathB.lineTo(888, 28);
2816 pathB.quadTo(885.928955f, 28, 884.463989f, 26.5359993f);
2817 pathB.quadTo(883, 25.0710678f, 883, 23);
2818 pathB.close();
2819 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2820}
2821
2822static void skpbestred_ru37(skiatest::Reporter* reporter) {
2823 SkPath path;
2824 path.setFillType(SkPath::kEvenOdd_FillType);
2825 path.moveTo(883, 23);
2826 path.lineTo(883, 0);
2827 path.lineTo(1122.5f, 0);
2828 path.lineTo(1122.5f, 25.2136822f);
2829 path.quadTo(1122.14441f, 25.9271851f, 1121.53601f, 26.5359993f);
2830 path.quadTo(1120.07104f, 28, 1118, 28);
2831 path.lineTo(888, 28);
2832 path.quadTo(885.928955f, 28, 884.463989f, 26.5359993f);
2833 path.quadTo(883, 25.0710678f, 883, 23);
2834 path.close();
2835 SkPath pathB;
2836 pathB.setFillType(SkPath::kWinding_FillType);
2837 pathB.moveTo(883, 0);
2838 pathB.lineTo(1123, 0);
2839 pathB.lineTo(1123, 23);
2840 pathB.quadTo(1123, 25.0710678f, 1121.53601f, 26.5359993f);
2841 pathB.quadTo(1120.07104f, 28, 1118, 28);
2842 pathB.lineTo(888, 28);
2843 pathB.quadTo(885.928955f, 28, 884.463989f, 26.5359993f);
2844 pathB.quadTo(883, 25.0710678f, 883, 23);
2845 pathB.close();
2846 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2847}
2848
2849static void skpbingoentertainment_net189(skiatest::Reporter* reporter) {
2850 SkPath path;
2851 path.setFillType(SkPath::kEvenOdd_FillType);
2852 path.moveTo(896, 745.38678f);
2853 path.lineTo(896, 873.38678f);
2854 path.lineTo(922.567993f, 876.683716f);
2855 path.lineTo(922.567993f, 748.683716f);
2856 path.lineTo(896, 745.38678f);
2857 path.close();
2858 SkPath pathB;
2859 pathB.setFillType(SkPath::kWinding_FillType);
2860 pathB.moveTo(899.200928f, 745.783997f);
2861 pathB.cubicTo(897.119385f, 745.525696f, 895.432007f, 752.031982f, 895.432007f, 760.316284f);
2862 pathB.lineTo(895.432007f, 858.316284f);
2863 pathB.cubicTo(895.432007f, 866.600586f, 897.119385f, 873.525696f, 899.200928f, 873.783997f);
2864 pathB.lineTo(918.799133f, 876.216003f);
2865 pathB.cubicTo(920.880615f, 876.474304f, 922.567993f, 869.968018f, 922.567993f, 861.683716f);
2866 pathB.lineTo(922.567993f, 763.683716f);
2867 pathB.cubicTo(922.567993f, 755.399414f, 920.880615f, 748.474304f, 918.799133f, 748.216003f);
2868 pathB.lineTo(899.200928f, 745.783997f);
2869 pathB.close();
2870 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2871}
2872
2873static void skpcarrefour_ro62(skiatest::Reporter* reporter) {
2874 SkPath path;
2875 path.setFillType(SkPath::kEvenOdd_FillType);
2876 path.moveTo(1104, 453);
2877 path.lineTo(399, 453);
2878 path.lineTo(399, 657);
2879 path.cubicTo(399, 661.970581f, 403.029449f, 666, 408, 666);
2880 path.lineTo(1095, 666);
2881 path.cubicTo(1099.97058f, 666, 1104, 661.970581f, 1104, 657);
2882 path.lineTo(1104, 453);
2883 path.close();
2884 SkPath pathB;
2885 pathB.setFillType(SkPath::kInverseWinding_FillType);
2886 pathB.moveTo(400, 453);
2887 pathB.lineTo(1103, 453);
2888 pathB.lineTo(1103, 666);
2889 pathB.lineTo(406, 666);
2890 pathB.cubicTo(402.686279f, 666, 400, 663.313721f, 400, 660);
2891 pathB.lineTo(400, 453);
2892 pathB.close();
2893 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2894}
2895
2896static void skpcaffelavazzait_com_ua21(skiatest::Reporter* reporter) {
2897 SkPath path;
2898 path.setFillType(SkPath::kEvenOdd_FillType);
2899 path.moveTo(883, 23);
2900 path.lineTo(883, 0);
2901 path.lineTo(1122.5f, 0);
2902 path.lineTo(1122.5f, 25.2136822f);
2903 path.quadTo(1122.14441f, 25.9271851f, 1121.53601f, 26.5359993f);
2904 path.quadTo(1120.07104f, 28, 1118, 28);
2905 path.lineTo(888, 28);
2906 path.quadTo(885.928955f, 28, 884.463989f, 26.5359993f);
2907 path.quadTo(883, 25.0710678f, 883, 23);
2908 path.close();
2909 SkPath pathB;
2910 pathB.setFillType(SkPath::kWinding_FillType);
2911 pathB.moveTo(883, 0);
2912 pathB.lineTo(1123, 0);
2913 pathB.lineTo(1123, 23);
2914 pathB.quadTo(1123, 25.0710678f, 1121.53601f, 26.5359993f);
2915 pathB.quadTo(1120.07104f, 28, 1118, 28);
2916 pathB.lineTo(888, 28);
2917 pathB.quadTo(885.928955f, 28, 884.463989f, 26.5359993f);
2918 pathB.quadTo(883, 25.0710678f, 883, 23);
2919 pathB.close();
2920 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2921}
2922
2923static void skpcamcorder_kz21(skiatest::Reporter* reporter) {
2924 SkPath path;
2925 path.setFillType(SkPath::kEvenOdd_FillType);
2926 path.moveTo(883, 23);
2927 path.lineTo(883, 0);
2928 path.lineTo(1122.5f, 0);
2929 path.lineTo(1122.5f, 25.2136822f);
2930 path.quadTo(1122.14441f, 25.9271851f, 1121.53601f, 26.5359993f);
2931 path.quadTo(1120.07104f, 28, 1118, 28);
2932 path.lineTo(888, 28);
2933 path.quadTo(885.928955f, 28, 884.463989f, 26.5359993f);
2934 path.quadTo(883, 25.0710678f, 883, 23);
2935 path.close();
2936 SkPath pathB;
2937 pathB.setFillType(SkPath::kWinding_FillType);
2938 pathB.moveTo(883, 0);
2939 pathB.lineTo(1123, 0);
2940 pathB.lineTo(1123, 23);
2941 pathB.quadTo(1123, 25.0710678f, 1121.53601f, 26.5359993f);
2942 pathB.quadTo(1120.07104f, 28, 1118, 28);
2943 pathB.lineTo(888, 28);
2944 pathB.quadTo(885.928955f, 28, 884.463989f, 26.5359993f);
2945 pathB.quadTo(883, 25.0710678f, 883, 23);
2946 pathB.close();
2947 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2948}
2949
2950static void skpcavablar_net563(skiatest::Reporter* reporter) {
2951 SkPath path;
2952 path.setFillType(SkPath::kEvenOdd_FillType);
2953 path.moveTo(160.000488f, 918);
2954 path.cubicTo(159.164749f, 917.37207f, 158.125824f, 917, 157, 917);
2955 path.lineTo(94, 917);
2956 path.cubicTo(92.874176f, 917, 91.8352661f, 917.37207f, 90.9995193f, 918);
2957 path.lineTo(160.000488f, 918);
2958 path.close();
2959 SkPath pathB;
2960 pathB.setFillType(SkPath::kWinding_FillType);
2961 pathB.moveTo(91, 917);
2962 pathB.lineTo(160, 917);
2963 pathB.lineTo(160, 918);
2964 pathB.lineTo(91, 918);
2965 pathB.close();
2966 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2967}
2968
2969static void skpinsomnia_gr72(skiatest::Reporter* reporter) {
2970 SkPath path;
2971 path.setFillType(SkPath::kEvenOdd_FillType);
2972 path.moveTo(1138, 231);
2973 path.lineTo(1137, 243.625748f);
2974 path.lineTo(1137, 926);
2975 path.lineTo(1139, 926);
2976 path.lineTo(1139, 231);
2977 path.lineTo(1138, 231);
2978 path.close();
2979 SkPath pathB;
2980 pathB.setFillType(SkPath::kWinding_FillType);
2981 pathB.moveTo(1139, 231);
2982 pathB.lineTo(1138, 231);
2983 pathB.lineTo(633, 6101);
2984 pathB.lineTo(1139, 6607);
2985 testPathOp(reporter, path, pathB, kIntersect_PathOp);
2986}
2987
2988static void cubicOp95u(skiatest::Reporter* reporter) {
2989 SkPath path, pathB;
2990 path.setFillType(SkPath::kEvenOdd_FillType);
2991 path.moveTo(0, 2);
2992 path.cubicTo(2, 3, 5, 1, 3, 2);
2993 path.close();
2994 pathB.setFillType(SkPath::kEvenOdd_FillType);
2995 pathB.moveTo(1, 5);
2996 pathB.cubicTo(2, 3, 2, 0, 3, 2);
2997 pathB.close();
2998 testPathOp(reporter, path, pathB, kUnion_PathOp);
2999}
3000
3001static void cubicOp96d(skiatest::Reporter* reporter) {
3002 SkPath path, pathB;
3003 path.setFillType(SkPath::kEvenOdd_FillType);
3004 path.moveTo(1, 6);
3005 path.cubicTo(0, 3, 6, 3, 5, 0);
3006 path.close();
3007 pathB.setFillType(SkPath::kEvenOdd_FillType);
3008 pathB.moveTo(3, 6);
3009 pathB.cubicTo(0, 5, 6, 1, 3, 0);
3010 pathB.close();
3011 testPathOp(reporter, path, pathB, kDifference_PathOp);
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00003012}
3013
skia.committer@gmail.comf54ad6f2013-11-02 07:02:02 +00003014static void cubicOp97x(skiatest::Reporter* reporter) {
3015 SkPath path, pathB;
3016 path.setFillType(SkPath::kEvenOdd_FillType);
3017 path.moveTo(0, 2);
3018 path.cubicTo(0, 6, 2, 1, 2, 1);
3019 path.close();
3020 pathB.setFillType(SkPath::kEvenOdd_FillType);
3021 pathB.moveTo(1, 2);
3022 pathB.cubicTo(1, 2, 2, 0, 6, 0);
3023 pathB.close();
3024 testPathOp(reporter, path, pathB, kXOR_PathOp);
caryclark@google.coma2bbc6e2013-11-01 17:36:03 +00003025}
3026
skia.committer@gmail.comf54ad6f2013-11-02 07:02:02 +00003027static void cubicOp98x(skiatest::Reporter* reporter) {
3028 SkPath path, pathB;
3029 path.setFillType(SkPath::kEvenOdd_FillType);
3030 path.moveTo(0, 3);
3031 path.cubicTo(3, 6, 4, 1, 6, 3);
3032 path.close();
3033 pathB.setFillType(SkPath::kEvenOdd_FillType);
3034 pathB.moveTo(1, 4);
3035 pathB.cubicTo(3, 6, 3, 0, 6, 3);
3036 pathB.close();
3037 testPathOp(reporter, path, pathB, kXOR_PathOp);
caryclark@google.coma2bbc6e2013-11-01 17:36:03 +00003038}
3039
commit-bot@chromium.org866f4e32013-11-21 17:04:29 +00003040static void cubicOp99(skiatest::Reporter* reporter) {
3041 SkPath path, pathB;
3042 path.setFillType(SkPath::kWinding_FillType);
3043 path.moveTo(3,6);
3044 path.cubicTo(0,3, 6,5, 5,4);
3045 path.close();
3046 pathB.setFillType(SkPath::kWinding_FillType);
3047 pathB.moveTo(5,6);
3048 pathB.cubicTo(4,5, 6,3, 3,0);
3049 pathB.close();
3050 testPathOp(reporter, path, pathB, kIntersect_PathOp);
3051}
3052
3053static void cubicOp100(skiatest::Reporter* reporter) {
3054 SkPath path, pathB;
3055 path.setFillType(SkPath::kWinding_FillType);
3056 path.moveTo(0,1);
3057 path.cubicTo(0,2, 2,1, 4,2);
3058 path.close();
3059 pathB.setFillType(SkPath::kWinding_FillType);
3060 pathB.moveTo(1,2);
3061 pathB.cubicTo(2,4, 1,0, 2,0);
3062 pathB.close();
3063 testPathOp(reporter, path, pathB, kDifference_PathOp);
3064}
3065
3066static void cubicOp101(skiatest::Reporter* reporter) {
3067 SkPath path, pathB;
3068 path.setFillType(SkPath::kWinding_FillType);
3069 path.moveTo(0, 1);
3070 path.cubicTo(2, 3, 2, 1, 5, 3);
3071 path.close();
3072 pathB.setFillType(SkPath::kWinding_FillType);
3073 pathB.moveTo(1, 2);
3074 pathB.cubicTo(3, 5, 1, 0, 3, 2);
3075 pathB.close();
3076 testPathOp(reporter, path, pathB, kIntersect_PathOp);
3077}
3078
3079static void (*firstTest)(skiatest::Reporter* ) = 0;
caryclark@google.com818b0cc2013-04-08 11:50:46 +00003080
3081static struct TestDesc tests[] = {
commit-bot@chromium.org866f4e32013-11-21 17:04:29 +00003082 TEST(cubicOp101),
3083 TEST(cubicOp100),
3084 TEST(cubicOp99),
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00003085#if ISSUE_1435_WORKING
3086 TEST(issue1435),
3087#endif
3088#if SKPS_WORKING
3089 TEST(skpcarrot_is24),
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00003090#endif
3091#if ISSUE_1417_WORKING_ON_LINUX_32
3092 TEST(issue1417),
3093#endif
caryclark@google.coma2bbc6e2013-11-01 17:36:03 +00003094 TEST(cubicOp98x),
3095 TEST(cubicOp97x),
3096 TEST(skpcarpetplanet_ru22), // cubic/cubic intersect detects unwanted coincidence
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00003097 TEST(cubicOp96d),
3098 TEST(cubicOp95u),
3099 TEST(skpadbox_lt15),
3100 TEST(skpagentxsites_com55),
3101 TEST(skpadventistmission_org572),
3102 TEST(skpadspert_net23),
3103 TEST(skpadoption_org196),
3104 TEST(skpbambootheme_com12),
3105 TEST(skpbakosoft_com10),
3106 TEST(skpakmmos_ru100),
3107 TEST(skpbangalorenest_com4),
3108 TEST(skpbingoentertainment_net189),
3109 TEST(skpbestred_ru37),
3110 TEST(skpbenzoteh_ru152),
3111 TEST(skpcamcorder_kz21),
3112 TEST(skpcaffelavazzait_com_ua21),
3113 TEST(skpcarrefour_ro62),
3114 TEST(skpcavablar_net563),
3115 TEST(skpinsomnia_gr72),
3116 TEST(skpadbox_lt8),
3117 TEST(skpact_com43),
3118 TEST(skpacesoftech_com47),
3119 TEST(skpabcspark_ca103),
3120 TEST(cubicOp94u),
3121 TEST(cubicOp93d),
3122 TEST(cubicOp92i),
3123 TEST(skpadithya_putr4_blogspot_com551),
3124 TEST(skpadindex_de4),
3125 TEST(skpadspert_de11),
3126 TEST(skpaiaigames_com870),
3127 TEST(skpaaalgarve_org53),
3128 TEST(skpkkiste_to716),
3129 TEST(bufferOverflow),
caryclark@google.com570863f2013-09-16 15:55:01 +00003130 TEST(cubicOp91u),
3131 TEST(cubicOp90u),
3132 TEST(cubicOp89u),
3133 TEST(cubicOp88u),
3134 TEST(cubicOp87u),
3135 TEST(cubicOp86i),
3136 TEST(loopEdge2),
3137 TEST(loopEdge1),
3138 TEST(rectOp3x),
3139 TEST(rectOp2i),
3140 TEST(rectOp1i),
3141 TEST(issue1418b),
caryclark@google.com4fdbb222013-07-23 15:27:41 +00003142 TEST(cubicOp85i),
caryclark@google.com4fdbb222013-07-23 15:27:41 +00003143 TEST(issue1418),
3144 TEST(skpkkiste_to98),
caryclark@google.comfa2aeee2013-07-15 13:29:13 +00003145 TEST(skpahrefs_com29),
3146 TEST(cubicOp85d),
3147 TEST(skpahrefs_com88),
caryclark@google.com07e97fc2013-07-08 17:17:02 +00003148 TEST(skphealth_com76),
3149 TEST(skpancestry_com1),
3150 TEST(skpbyte_com1),
3151 TEST(skpeldorado_com_ua1),
3152 TEST(skp96prezzi1),
caryclark@google.comcffbcc32013-06-04 17:59:42 +00003153 TEST(skpClip2),
caryclark@google.comcffbcc32013-06-04 17:59:42 +00003154 TEST(skpClip1),
3155 TEST(cubicOp84d),
3156 TEST(cubicOp83i),
reed@google.com277c3f82013-05-31 15:17:50 +00003157 TEST(cubicOp82i),
3158 TEST(cubicOp81d),
3159 TEST(cubicOp80i),
3160 TEST(cubicOp79u),
reed@google.com277c3f82013-05-31 15:17:50 +00003161 TEST(cubicOp78u),
3162 TEST(cubicOp77i),
caryclark@google.comcffbcc32013-06-04 17:59:42 +00003163 TEST(cubicOp76u),
reed@google.com277c3f82013-05-31 15:17:50 +00003164 TEST(cubicOp75d),
caryclark@google.comcffbcc32013-06-04 17:59:42 +00003165 TEST(cubicOp74d),
reed@google.com277c3f82013-05-31 15:17:50 +00003166 TEST(cubicOp73d),
3167 TEST(cubicOp72i),
3168 TEST(cubicOp71d),
caryclark@google.coma5e55922013-05-07 18:51:31 +00003169 TEST(skp5),
3170 TEST(skp4),
3171 TEST(skp3),
3172 TEST(skp2),
3173 TEST(skp1),
caryclark@google.com6dc7df62013-04-25 11:51:54 +00003174 TEST(rRect1),
caryclark@google.coma5e55922013-05-07 18:51:31 +00003175 TEST(cubicOp70d),
caryclark@google.com03610322013-04-18 15:58:21 +00003176 TEST(cubicOp69d),
3177 TEST(cubicOp68u),
caryclark@google.comb3f09212013-04-17 15:49:16 +00003178 TEST(cubicOp67u),
3179 TEST(cubicOp66u),
caryclark@google.com818b0cc2013-04-08 11:50:46 +00003180 TEST(rectOp1d),
3181 TEST(cubicOp65d),
3182 TEST(cubicOp64d),
3183 TEST(cubicOp63d),
3184 TEST(cubicOp62d),
3185 TEST(cubicOp61d),
3186 TEST(cubicOp60d),
3187 TEST(cubicOp59d),
3188 TEST(cubicOp58d),
3189 TEST(cubicOp57d),
3190 TEST(cubicOp56d),
3191 TEST(cubicOp55d),
3192 TEST(cubicOp54d),
3193 TEST(cubicOp53d),
3194 TEST(cubicOp52d),
3195 TEST(cubicOp51d),
3196 TEST(cubicOp50d),
3197 TEST(cubicOp49d),
3198 TEST(cubicOp48d),
3199 TEST(cubicOp47d),
3200 TEST(cubicOp46d),
3201 TEST(cubicOp45d),
3202 TEST(cubicOp44d),
3203 TEST(cubicOp43d),
3204 TEST(cubicOp42d),
3205 TEST(cubicOp41i),
3206 TEST(cubicOp40d),
3207 TEST(cubicOp39d),
3208 TEST(cubicOp38d),
3209 TEST(cubicOp37d),
3210 TEST(cubicOp36u),
3211 TEST(cubicOp35d),
3212 TEST(cubicOp34d),
3213 TEST(cubicOp33i),
3214 TEST(cubicOp32d),
3215 TEST(cubicOp31d),
3216 TEST(cubicOp31x),
3217 TEST(cubicOp31u),
3218 TEST(cubicOp30d),
3219 TEST(cubicOp29d),
3220 TEST(cubicOp28u),
3221 TEST(cubicOp27d),
3222 TEST(cubicOp26d),
3223 TEST(cubicOp25i),
3224 TEST(testOp8d),
3225 TEST(testDiff1),
3226 TEST(testIntersect1),
3227 TEST(testUnion1),
3228 TEST(testXor1),
3229 TEST(testDiff2),
3230 TEST(testIntersect2),
3231 TEST(testUnion2),
3232 TEST(testXor2),
3233 TEST(testOp1d),
3234 TEST(testOp2d),
3235 TEST(testOp3d),
3236 TEST(testOp1u),
3237 TEST(testOp4d),
3238 TEST(testOp5d),
3239 TEST(testOp6d),
3240 TEST(testOp7d),
3241 TEST(testOp2u),
3242
3243 TEST(cubicOp24d),
3244 TEST(cubicOp23d),
3245 TEST(cubicOp22d),
3246 TEST(cubicOp21d),
3247 TEST(cubicOp20d),
3248 TEST(cubicOp19i),
3249 TEST(cubicOp18d),
3250 TEST(cubicOp17d),
3251 TEST(cubicOp16d),
3252 TEST(cubicOp15d),
3253 TEST(cubicOp14d),
3254 TEST(cubicOp13d),
3255 TEST(cubicOp12d),
3256 TEST(cubicOp11d),
3257 TEST(cubicOp10d),
3258 TEST(cubicOp1i),
3259 TEST(cubicOp9d),
3260 TEST(quadOp9d),
3261 TEST(lineOp9d),
3262 TEST(cubicOp8d),
3263 TEST(cubicOp7d),
3264 TEST(cubicOp6d),
3265 TEST(cubicOp5d),
3266 TEST(cubicOp3d),
3267 TEST(cubicOp2d),
3268 TEST(cubicOp1d),
3269};
3270
caryclark@google.comad65a3e2013-04-15 19:13:59 +00003271static const size_t testCount = SK_ARRAY_COUNT(tests);
caryclark@google.com818b0cc2013-04-08 11:50:46 +00003272
3273static struct TestDesc subTests[] = {
caryclark@google.coma5e55922013-05-07 18:51:31 +00003274 TEST(cubicOp6d),
3275 TEST(cubicOp8d),
3276 TEST(cubicOp70d),
3277 TEST(cubicOp16d),
3278 TEST(skp5),
caryclark@google.com818b0cc2013-04-08 11:50:46 +00003279};
3280
caryclark@google.comad65a3e2013-04-15 19:13:59 +00003281static const size_t subTestCount = SK_ARRAY_COUNT(subTests);
caryclark@google.com818b0cc2013-04-08 11:50:46 +00003282
3283static void (*firstSubTest)(skiatest::Reporter* ) = 0;
3284
3285static bool runSubTestsFirst = false;
3286static bool runReverse = false;
3287static void (*stopTest)(skiatest::Reporter* ) = 0;
3288
tfarina@chromium.org78e7b4e2014-01-02 21:45:03 +00003289DEF_TEST(PathOpsOp, reporter) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +00003290#ifdef SK_DEBUG
caryclark@google.com570863f2013-09-16 15:55:01 +00003291 SkPathOpsDebug::gMaxWindSum = 4;
3292 SkPathOpsDebug::gMaxWindValue = 4;
caryclark@google.com818b0cc2013-04-08 11:50:46 +00003293#endif
caryclark@google.com07e97fc2013-07-08 17:17:02 +00003294#if DEBUG_SHOW_TEST_NAME
3295 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH);
3296#endif
caryclark@google.com818b0cc2013-04-08 11:50:46 +00003297 if (runSubTestsFirst) {
3298 RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, runReverse);
3299 }
3300 RunTestSet(reporter, tests, testCount, firstTest, stopTest, runReverse);
3301 if (!runSubTestsFirst) {
3302 RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, runReverse);
3303 }
3304#ifdef SK_DEBUG
caryclark@google.com570863f2013-09-16 15:55:01 +00003305 SkPathOpsDebug::gMaxWindSum = SK_MaxS32;
3306 SkPathOpsDebug::gMaxWindValue = SK_MaxS32;
caryclark@google.com818b0cc2013-04-08 11:50:46 +00003307#endif
3308}