blob: 48ed866a904d085c23c1acc7ecf212c24ab2712e [file] [log] [blame]
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001/*
2 * Copyright 2012 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7#include "PathOpsExtendedTest.h"
8
9#define TEST(name) { name, #name }
10
11static void cubicOp1d(skiatest::Reporter* reporter) {
12 SkPath path, pathB;
13 path.setFillType(SkPath::kWinding_FillType);
14 path.moveTo(0,1);
15 path.cubicTo(0,2, 1,0, 1,0);
16 path.close();
17 pathB.setFillType(SkPath::kWinding_FillType);
18 pathB.moveTo(0,1);
19 pathB.cubicTo(0,1, 1,0, 2,0);
20 pathB.close();
21 testPathOp(reporter, path, pathB, kDifference_PathOp);
22}
23
24static void cubicOp2d(skiatest::Reporter* reporter) {
25 SkPath path, pathB;
26 path.setFillType(SkPath::kWinding_FillType);
27 path.moveTo(0,2);
28 path.cubicTo(0,1, 1,0, 1,0);
29 path.close();
30 pathB.setFillType(SkPath::kWinding_FillType);
31 pathB.moveTo(0,1);
32 pathB.cubicTo(0,1, 2,0, 1,0);
33 pathB.close();
34 testPathOp(reporter, path, pathB, kDifference_PathOp);
35}
36
37static void cubicOp3d(skiatest::Reporter* reporter) {
38 SkPath path, pathB;
39 path.setFillType(SkPath::kWinding_FillType);
40 path.moveTo(0,1);
41 path.cubicTo(2,3, 1,0, 1,0);
42 path.close();
43 pathB.setFillType(SkPath::kWinding_FillType);
44 pathB.moveTo(0,1);
45 pathB.cubicTo(0,1, 1,0, 3,2);
46 pathB.close();
47 testPathOp(reporter, path, pathB, kDifference_PathOp);
48}
49
50static void cubicOp5d(skiatest::Reporter* reporter) {
51 SkPath path, pathB;
52 path.setFillType(SkPath::kWinding_FillType);
53 path.moveTo(0,1);
54 path.cubicTo(0,2, 1,0, 2,0);
55 path.close();
56 pathB.setFillType(SkPath::kWinding_FillType);
57 pathB.moveTo(0,1);
58 pathB.cubicTo(0,2, 1,0, 2,0);
59 pathB.close();
60 testPathOp(reporter, path, pathB, kDifference_PathOp);
61}
62
63static void cubicOp6d(skiatest::Reporter* reporter) {
64 SkPath path, pathB;
65 path.setFillType(SkPath::kWinding_FillType);
66 path.moveTo(0,1);
67 path.cubicTo(0,6, 1,0, 3,0);
68 path.close();
69 pathB.setFillType(SkPath::kWinding_FillType);
70 pathB.moveTo(0,1);
71 pathB.cubicTo(0,3, 1,0, 6,0);
72 pathB.close();
73 testPathOp(reporter, path, pathB, kDifference_PathOp);
74}
75
76static void cubicOp7d(skiatest::Reporter* reporter) {
77 SkPath path, pathB;
78 path.setFillType(SkPath::kWinding_FillType);
79 path.moveTo(0,1);
80 path.cubicTo(3,4, 1,0, 3,0);
81 path.close();
82 pathB.setFillType(SkPath::kWinding_FillType);
83 pathB.moveTo(0,1);
84 pathB.cubicTo(0,3, 1,0, 4,3);
85 pathB.close();
86 testPathOp(reporter, path, pathB, kDifference_PathOp);
87}
88
89static void cubicOp8d(skiatest::Reporter* reporter) {
90 SkPath path, pathB;
91 path.setFillType(SkPath::kWinding_FillType);
92 path.moveTo(0,1);
93 path.cubicTo(0,5, 1,0, 4,0);
94 path.close();
95 pathB.setFillType(SkPath::kWinding_FillType);
96 pathB.moveTo(0,1);
97 pathB.cubicTo(0,4, 1,0, 5,0);
98 pathB.close();
99 testPathOp(reporter, path, pathB, kDifference_PathOp);
100}
101
102static void cubicOp9d(skiatest::Reporter* reporter) {
103 SkPath path, pathB;
104 path.setFillType(SkPath::kWinding_FillType);
105 path.moveTo(0,1);
106 path.cubicTo(1,6, 1,0, 2,1);
107 path.close();
108 pathB.setFillType(SkPath::kWinding_FillType);
109 pathB.moveTo(0,1);
110 pathB.cubicTo(1,2, 1,0, 6,1);
111 pathB.close();
112 testPathOp(reporter, path, pathB, kDifference_PathOp);
113}
114
115static void quadOp9d(skiatest::Reporter* reporter) {
116 SkPath path, pathB;
117 path.setFillType(SkPath::kWinding_FillType);
118 path.moveTo(0,1);
119 path.quadTo(1,6, 1.5f,1);
120 path.quadTo(1.5f,0.5f, 2,1);
121 path.close();
122 pathB.setFillType(SkPath::kWinding_FillType);
123 pathB.moveTo(0,1);
124 pathB.quadTo(1,2, 1.4f,1);
125 pathB.quadTo(3,0.4f, 6,1);
126 pathB.close();
127 testPathOp(reporter, path, pathB, kDifference_PathOp);
128}
129
130static void lineOp9d(skiatest::Reporter* reporter) {
131 SkPath path, pathB;
132 path.setFillType(SkPath::kWinding_FillType);
133 path.moveTo(0,1);
134 path.lineTo(1,6);
135 path.lineTo(1.5f,1);
136 path.lineTo(1.8f,0.8f);
137 path.lineTo(2,1);
138 path.close();
139 pathB.setFillType(SkPath::kWinding_FillType);
140 pathB.moveTo(0,1);
141 pathB.lineTo(1,2);
142 pathB.lineTo(1.4f,1);
143 pathB.lineTo(3,0.4f);
144 pathB.lineTo(6,1);
145 pathB.close();
146 testPathOp(reporter, path, pathB, kDifference_PathOp);
147}
148
149static void cubicOp1i(skiatest::Reporter* reporter) {
150 SkPath path, pathB;
151 path.setFillType(SkPath::kWinding_FillType);
152 path.moveTo(0,1);
153 path.cubicTo(1,2, 1,0, 2,1);
154 path.close();
155 pathB.setFillType(SkPath::kWinding_FillType);
156 pathB.moveTo(0,1);
157 pathB.cubicTo(1,2, 1,0, 2,1);
158 pathB.close();
159 testPathOp(reporter, path, pathB, kIntersect_PathOp);
160}
161
162static void cubicOp10d(skiatest::Reporter* reporter) {
163 SkPath path, pathB;
164 path.setFillType(SkPath::kWinding_FillType);
165 path.moveTo(0,1);
166 path.cubicTo(1,3, 1,0, 4,1);
167 path.close();
168 pathB.setFillType(SkPath::kWinding_FillType);
169 pathB.moveTo(0,1);
170 pathB.cubicTo(1,4, 1,0, 3,1);
171 pathB.close();
172 testPathOp(reporter, path, pathB, kDifference_PathOp);
173}
174
175static void cubicOp11d(skiatest::Reporter* reporter) {
176 SkPath path, pathB;
177 path.setFillType(SkPath::kWinding_FillType);
178 path.moveTo(0,1);
179 path.cubicTo(3,4, 1,0, 5,1);
180 path.close();
181 pathB.setFillType(SkPath::kWinding_FillType);
182 pathB.moveTo(0,1);
183 pathB.cubicTo(1,5, 1,0, 4,3);
184 pathB.close();
185 testPathOp(reporter, path, pathB, kDifference_PathOp);
186}
187
188static void cubicOp12d(skiatest::Reporter* reporter) {
189 SkPath path, pathB;
190 path.setFillType(SkPath::kWinding_FillType);
191 path.moveTo(0,1);
192 path.cubicTo(1,6, 1,0, 1,0);
193 path.close();
194 pathB.setFillType(SkPath::kWinding_FillType);
195 pathB.moveTo(0,1);
196 pathB.cubicTo(0,1, 1,0, 6,1);
197 pathB.close();
198 testPathOp(reporter, path, pathB, kDifference_PathOp);
199}
200
201static void cubicOp13d(skiatest::Reporter* reporter) {
202 SkPath path, pathB;
203 path.setFillType(SkPath::kWinding_FillType);
204 path.moveTo(0,1);
205 path.cubicTo(4,5, 1,0, 5,3);
206 path.close();
207 pathB.setFillType(SkPath::kWinding_FillType);
208 pathB.moveTo(0,1);
209 pathB.cubicTo(3,5, 1,0, 5,4);
210 pathB.close();
211 testPathOp(reporter, path, pathB, kDifference_PathOp);
212}
213
214static void cubicOp14d(skiatest::Reporter* reporter) {
215 SkPath path, pathB;
216 path.setFillType(SkPath::kWinding_FillType);
217 path.moveTo(0,1);
218 path.cubicTo(0,2, 2,0, 2,1);
219 path.close();
220 pathB.setFillType(SkPath::kWinding_FillType);
221 pathB.moveTo(0,2);
222 pathB.cubicTo(1,2, 1,0, 2,0);
223 pathB.close();
224 testPathOp(reporter, path, pathB, kDifference_PathOp);
225}
226
227static void cubicOp15d(skiatest::Reporter* reporter) {
228 SkPath path, pathB;
229 path.setFillType(SkPath::kWinding_FillType);
230 path.moveTo(0,1);
231 path.cubicTo(3,6, 2,0, 2,1);
232 path.close();
233 pathB.setFillType(SkPath::kWinding_FillType);
234 pathB.moveTo(0,2);
235 pathB.cubicTo(1,2, 1,0, 6,3);
236 pathB.close();
237 testPathOp(reporter, path, pathB, kDifference_PathOp);
238}
239
240static void cubicOp16d(skiatest::Reporter* reporter) {
241 SkPath path, pathB;
242 path.setFillType(SkPath::kWinding_FillType);
243 path.moveTo(0,2);
244 path.cubicTo(0,1, 3,0, 1,0);
245 path.close();
246 pathB.setFillType(SkPath::kWinding_FillType);
247 pathB.moveTo(0,3);
248 pathB.cubicTo(0,1, 2,0, 1,0);
249 pathB.close();
250 testPathOp(reporter, path, pathB, kDifference_PathOp);
251}
252
253static void cubicOp17d(skiatest::Reporter* reporter) {
254 SkPath path, pathB;
255 path.setFillType(SkPath::kWinding_FillType);
256 path.moveTo(0,2);
257 path.cubicTo(0,2, 4,0, 2,1);
258 path.close();
259 pathB.setFillType(SkPath::kWinding_FillType);
260 pathB.moveTo(0,4);
261 pathB.cubicTo(1,2, 2,0, 2,0);
262 pathB.close();
263 testPathOp(reporter, path, pathB, kDifference_PathOp);
264}
265
266static void cubicOp18d(skiatest::Reporter* reporter) {
267 SkPath path, pathB;
268 path.setFillType(SkPath::kWinding_FillType);
269 path.moveTo(0,1);
270 path.cubicTo(3,5, 2,0, 2,1);
271 path.close();
272 pathB.setFillType(SkPath::kWinding_FillType);
273 pathB.moveTo(0,2);
274 pathB.cubicTo(1,2, 1,0, 5,3);
275 pathB.close();
276 testPathOp(reporter, path, pathB, kDifference_PathOp);
277}
278
279static void cubicOp19i(skiatest::Reporter* reporter) {
280 SkPath path, pathB;
281 path.setFillType(SkPath::kWinding_FillType);
282 path.moveTo(0,2);
283 path.cubicTo(0,1, 2,1, 6,2);
284 path.close();
285 pathB.setFillType(SkPath::kWinding_FillType);
286 pathB.moveTo(1,2);
287 pathB.cubicTo(2,6, 2,0, 1,0);
288 pathB.close();
289 testPathOp(reporter, path, pathB, kIntersect_PathOp);
290}
291
292static void cubicOp20d(skiatest::Reporter* reporter) {
293 SkPath path, pathB;
294 path.setFillType(SkPath::kWinding_FillType);
295 path.moveTo(0,1);
296 path.cubicTo(0,1, 6,0, 2,1);
297 path.close();
298 pathB.setFillType(SkPath::kWinding_FillType);
299 pathB.moveTo(0,6);
300 pathB.cubicTo(1,2, 1,0, 1,0);
301 pathB.close();
302 testPathOp(reporter, path, pathB, kDifference_PathOp);
303}
304
305static void cubicOp21d(skiatest::Reporter* reporter) {
306 SkPath path, pathB;
307 path.setFillType(SkPath::kWinding_FillType);
308 path.moveTo(0,1);
309 path.cubicTo(0,1, 2,1, 6,5);
310 path.close();
311 pathB.setFillType(SkPath::kWinding_FillType);
312 pathB.moveTo(1,2);
313 pathB.cubicTo(5,6, 1,0, 1,0);
314 pathB.close();
315 testPathOp(reporter, path, pathB, kDifference_PathOp);
316}
317
318static void cubicOp22d(skiatest::Reporter* reporter) {
319 SkPath path, pathB;
320 path.setFillType(SkPath::kWinding_FillType);
321 path.moveTo(0,1);
322 path.cubicTo(2,3, 3,0, 2,1);
323 path.close();
324 pathB.setFillType(SkPath::kWinding_FillType);
325 pathB.moveTo(0,3);
326 pathB.cubicTo(1,2, 1,0, 3,2);
327 pathB.close();
328 testPathOp(reporter, path, pathB, kDifference_PathOp);
329}
330
331static void cubicOp23d(skiatest::Reporter* reporter) {
332 SkPath path, pathB;
333 path.setFillType(SkPath::kWinding_FillType);
334 path.moveTo(0,1);
335 path.cubicTo(1,2, 4,0, 2,1);
336 path.close();
337 pathB.setFillType(SkPath::kWinding_FillType);
338 pathB.moveTo(0,4);
339 pathB.cubicTo(1,2, 1,0, 2,1);
340 pathB.close();
341 testPathOp(reporter, path, pathB, kDifference_PathOp);
342}
343
344static void cubicOp24d(skiatest::Reporter* reporter) {
345 SkPath path, pathB;
346 path.setFillType(SkPath::kWinding_FillType);
347 path.moveTo(0,1);
348 path.cubicTo(1,2, 2,0, 3,2);
349 path.close();
350 pathB.setFillType(SkPath::kWinding_FillType);
351 pathB.moveTo(0,2);
352 pathB.cubicTo(2,3, 1,0, 2,1);
353 pathB.close();
354 testPathOp(reporter, path, pathB, kDifference_PathOp);
355}
356
357static void testIntersect1(skiatest::Reporter* reporter) {
358 SkPath one, two;
359 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
360 two.addRect(3, 3, 9, 9, SkPath::kCW_Direction);
361 testPathOp(reporter, one, two, kIntersect_PathOp);
362}
363
364static void testUnion1(skiatest::Reporter* reporter) {
365 SkPath one, two;
366 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
367 two.addRect(3, 3, 9, 9, SkPath::kCW_Direction);
368 testPathOp(reporter, one, two, kUnion_PathOp);
369}
370
371static void testDiff1(skiatest::Reporter* reporter) {
372 SkPath one, two;
373 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
374 two.addRect(3, 3, 9, 9, SkPath::kCW_Direction);
375 testPathOp(reporter, one, two, kDifference_PathOp);
376}
377
378static void testXor1(skiatest::Reporter* reporter) {
379 SkPath one, two;
380 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
381 two.addRect(3, 3, 9, 9, SkPath::kCW_Direction);
382 testPathOp(reporter, one, two, kXOR_PathOp);
383}
384
385static void testIntersect2(skiatest::Reporter* reporter) {
386 SkPath one, two;
387 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
388 two.addRect(0, 3, 9, 9, SkPath::kCW_Direction);
389 testPathOp(reporter, one, two, kIntersect_PathOp);
390}
391
392static void testUnion2(skiatest::Reporter* reporter) {
393 SkPath one, two;
394 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
395 two.addRect(0, 3, 9, 9, SkPath::kCW_Direction);
396 testPathOp(reporter, one, two, kUnion_PathOp);
397}
398
399static void testDiff2(skiatest::Reporter* reporter) {
400 SkPath one, two;
401 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
402 two.addRect(0, 3, 9, 9, SkPath::kCW_Direction);
403 testPathOp(reporter, one, two, kDifference_PathOp);
404}
405
406static void testXor2(skiatest::Reporter* reporter) {
407 SkPath one, two;
408 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
409 two.addRect(0, 3, 9, 9, SkPath::kCW_Direction);
410 testPathOp(reporter, one, two, kXOR_PathOp);
411}
412
413static void testOp1d(skiatest::Reporter* reporter) {
414 SkPath path, pathB;
415 path.setFillType(SkPath::kWinding_FillType);
416 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
417 path.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
418 pathB.setFillType(SkPath::kWinding_FillType);
419 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
420 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
421 testPathOp(reporter, path, pathB, kDifference_PathOp);
422}
423
424static void testOp2d(skiatest::Reporter* reporter) {
425 SkPath path, pathB;
426 path.setFillType(SkPath::kWinding_FillType);
427 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
428 path.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
429 pathB.setFillType(SkPath::kEvenOdd_FillType);
430 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
431 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
432 testPathOp(reporter, path, pathB, kDifference_PathOp);
433}
434
435static void testOp3d(skiatest::Reporter* reporter) {
436 SkPath path, pathB;
437 path.setFillType(SkPath::kWinding_FillType);
438 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
439 path.addRect(1, 1, 2, 2, SkPath::kCW_Direction);
440 pathB.setFillType(SkPath::kWinding_FillType);
441 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
442 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
443 testPathOp(reporter, path, pathB, kDifference_PathOp);
444}
445
446static void testOp1u(skiatest::Reporter* reporter) {
447 SkPath path, pathB;
448 path.setFillType(SkPath::kWinding_FillType);
449 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
450 path.addRect(0, 0, 3, 3, SkPath::kCW_Direction);
451 pathB.setFillType(SkPath::kWinding_FillType);
452 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
453 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
454 testPathOp(reporter, path, pathB, kUnion_PathOp);
455}
456
457static void testOp4d(skiatest::Reporter* reporter) {
458 SkPath path, pathB;
459 path.setFillType(SkPath::kWinding_FillType);
460 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
461 path.addRect(2, 2, 4, 4, SkPath::kCW_Direction);
462 pathB.setFillType(SkPath::kWinding_FillType);
463 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
464 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
465 testPathOp(reporter, path, pathB, kDifference_PathOp);
466}
467
468static void testOp5d(skiatest::Reporter* reporter) {
469 SkPath path, pathB;
470 path.setFillType(SkPath::kEvenOdd_FillType);
471 path.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
472 path.addRect(0, 0, 3, 3, SkPath::kCW_Direction);
473 pathB.setFillType(SkPath::kEvenOdd_FillType);
474 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
475 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
476 testPathOp(reporter, path, pathB, kDifference_PathOp);
477}
478
479static void testOp6d(skiatest::Reporter* reporter) {
480 SkPath path, pathB;
481 path.setFillType(SkPath::kEvenOdd_FillType);
482 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
483 path.addRect(0, 0, 3, 3, SkPath::kCW_Direction);
484 pathB.setFillType(SkPath::kWinding_FillType);
485 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
486 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
487 testPathOp(reporter, path, pathB, kDifference_PathOp);
488}
489
490static void testOp7d(skiatest::Reporter* reporter) {
491 SkPath path, pathB;
492 path.setFillType(SkPath::kEvenOdd_FillType);
493 path.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
494 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
495 pathB.setFillType(SkPath::kEvenOdd_FillType);
496 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
497 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
498 testPathOp(reporter, path, pathB, kDifference_PathOp);
499}
500
501static void testOp2u(skiatest::Reporter* reporter) {
502 SkPath path, pathB;
503 path.setFillType(SkPath::kEvenOdd_FillType);
504 path.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
505 path.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
506 pathB.setFillType(SkPath::kWinding_FillType);
507 pathB.addRect(0, 0, 3, 3, SkPath::kCW_Direction);
508 pathB.addRect(1, 1, 2, 2, SkPath::kCW_Direction);
509 testPathOp(reporter, path, pathB, kUnion_PathOp);
510}
511
512static void testOp8d(skiatest::Reporter* reporter) {
513 SkPath path, pathB;
514 path.addRect(0, 0, 640, 480);
515 pathB.moveTo(577330, 1971.72f);
516 pathB.cubicTo(10.7082f, -116.596f, 262.057f, 45.6468f, 294.694f, 1.96237f);
517 pathB.close();
518 testPathOp(reporter, path, pathB, kDifference_PathOp);
519}
520static void cubicOp25i(skiatest::Reporter* reporter) {
521 SkPath path, pathB;
522 path.setFillType(SkPath::kWinding_FillType);
523 path.moveTo(0,1);
524 path.cubicTo(2,4, 5,0, 3,2);
525 path.close();
526 pathB.setFillType(SkPath::kWinding_FillType);
527 pathB.moveTo(0,5);
528 pathB.cubicTo(2,3, 1,0, 4,2);
529 pathB.close();
530 testPathOp(reporter, path, pathB, kIntersect_PathOp);
531}
532
533static void cubicOp26d(skiatest::Reporter* reporter) {
534 SkPath path, pathB;
535 path.setFillType(SkPath::kWinding_FillType);
536 path.moveTo(0,1);
537 path.cubicTo(3,4, 4,0, 3,2);
538 path.close();
539 pathB.setFillType(SkPath::kWinding_FillType);
540 pathB.moveTo(0,4);
541 pathB.cubicTo(2,3, 1,0, 4,3);
542 pathB.close();
543 testPathOp(reporter, path, pathB, kDifference_PathOp);
544}
545
546static void cubicOp27d(skiatest::Reporter* reporter) {
547 SkPath path, pathB;
548 path.setFillType(SkPath::kWinding_FillType);
549 path.moveTo(0,1);
550 path.cubicTo(3,6, 1,0, 5,2);
551 path.close();
552 pathB.setFillType(SkPath::kWinding_FillType);
553 pathB.moveTo(0,1);
554 pathB.cubicTo(2,5, 1,0, 6,3);
555 pathB.close();
556 testPathOp(reporter, path, pathB, kDifference_PathOp);
557}
558
559static void cubicOp28u(skiatest::Reporter* reporter) {
560 SkPath path, pathB;
561 path.setFillType(SkPath::kWinding_FillType);
562 path.moveTo(0,1);
563 path.cubicTo(1,4, 6,0, 3,2);
564 path.close();
565 pathB.setFillType(SkPath::kWinding_FillType);
566 pathB.moveTo(0,6);
567 pathB.cubicTo(2,3, 1,0, 4,1);
568 pathB.close();
569 testPathOp(reporter, path, pathB, kUnion_PathOp);
570}
571
572static void cubicOp29d(skiatest::Reporter* reporter) {
573 SkPath path, pathB;
574 path.setFillType(SkPath::kWinding_FillType);
575 path.moveTo(0,1);
576 path.cubicTo(2,5, 6,0, 4,2);
577 path.close();
578 pathB.setFillType(SkPath::kWinding_FillType);
579 pathB.moveTo(0,6);
580 pathB.cubicTo(2,4, 1,0, 5,2);
581 pathB.close();
582 testPathOp(reporter, path, pathB, kDifference_PathOp);
583}
584
585static void cubicOp30d(skiatest::Reporter* reporter) {
586 SkPath path, pathB;
587 path.setFillType(SkPath::kWinding_FillType);
588 path.moveTo(0,1);
589 path.cubicTo(2,5, 6,0, 5,3);
590 path.close();
591 pathB.setFillType(SkPath::kWinding_FillType);
592 pathB.moveTo(0,6);
593 pathB.cubicTo(3,5, 1,0, 5,2);
594 pathB.close();
595 testPathOp(reporter, path, pathB, kDifference_PathOp);
596}
597
598static void cubicOp31d(skiatest::Reporter* reporter) {
599 SkPath path, pathB;
600 path.setFillType(SkPath::kWinding_FillType);
601 path.moveTo(0,2);
602 path.cubicTo(0,3, 2,1, 4,0);
603 path.close();
604 pathB.setFillType(SkPath::kWinding_FillType);
605 pathB.moveTo(1,2);
606 pathB.cubicTo(0,4, 2,0, 3,0);
607 pathB.close();
608 testPathOp(reporter, path, pathB, kDifference_PathOp);
609}
610
611static void cubicOp31u(skiatest::Reporter* reporter) {
612 SkPath path, pathB;
613 path.setFillType(SkPath::kWinding_FillType);
614 path.moveTo(0,2);
615 path.cubicTo(0,3, 2,1, 4,0);
616 path.close();
617 pathB.setFillType(SkPath::kWinding_FillType);
618 pathB.moveTo(1,2);
619 pathB.cubicTo(0,4, 2,0, 3,0);
620 pathB.close();
621 testPathOp(reporter, path, pathB, kUnion_PathOp);
622}
623
624static void cubicOp31x(skiatest::Reporter* reporter) {
625 SkPath path, pathB;
626 path.setFillType(SkPath::kWinding_FillType);
627 path.moveTo(0,2);
628 path.cubicTo(0,3, 2,1, 4,0);
629 path.close();
630 pathB.setFillType(SkPath::kWinding_FillType);
631 pathB.moveTo(1,2);
632 pathB.cubicTo(0,4, 2,0, 3,0);
633 pathB.close();
634 testPathOp(reporter, path, pathB, kXOR_PathOp);
635}
636
637static void cubicOp32d(skiatest::Reporter* reporter) {
638 SkPath path, pathB;
639 path.setFillType(SkPath::kWinding_FillType);
640 path.moveTo(0,1);
641 path.cubicTo(1,2, 6,0, 3,1);
642 path.close();
643 pathB.setFillType(SkPath::kWinding_FillType);
644 pathB.moveTo(0,6);
645 pathB.cubicTo(1,3, 1,0, 2,1);
646 pathB.close();
647 testPathOp(reporter, path, pathB, kDifference_PathOp);
648}
649
650static void cubicOp33i(skiatest::Reporter* reporter) {
651 SkPath path, pathB;
652 path.setFillType(SkPath::kWinding_FillType);
653 path.moveTo(0,1);
654 path.cubicTo(1,2, 6,0, 3,1);
655 path.close();
656 pathB.setFillType(SkPath::kWinding_FillType);
657 pathB.moveTo(0,6);
658 pathB.cubicTo(1,3, 1,0, 2,1);
659 pathB.close();
660 testPathOp(reporter, path, pathB, kIntersect_PathOp);
661}
662
663static void cubicOp34d(skiatest::Reporter* reporter) {
664 SkPath path, pathB;
665 path.setFillType(SkPath::kWinding_FillType);
666 path.moveTo(0,1);
667 path.cubicTo(3,5, 2,1, 3,1);
668 path.close();
669 pathB.setFillType(SkPath::kWinding_FillType);
670 pathB.moveTo(1,2);
671 pathB.cubicTo(1,3, 1,0, 5,3);
672 pathB.close();
673 testPathOp(reporter, path, pathB, kDifference_PathOp);
674}
675
676static void cubicOp35d(skiatest::Reporter* reporter) {
677 SkPath path, pathB;
678 path.setFillType(SkPath::kWinding_FillType);
679 path.moveTo(0,1);
680 path.cubicTo(1,5, 2,1, 4,0);
681 path.close();
682 pathB.setFillType(SkPath::kWinding_FillType);
683 pathB.moveTo(1,2);
684 pathB.cubicTo(0,4, 1,0, 5,1);
685 pathB.close();
686 testPathOp(reporter, path, pathB, kDifference_PathOp);
687}
688
689static void cubicOp36u(skiatest::Reporter* reporter) {
690 SkPath path, pathB;
691 path.setFillType(SkPath::kWinding_FillType);
692 path.moveTo(0,1);
693 path.cubicTo(1,6, 2,0, 5,1);
694 path.close();
695 pathB.setFillType(SkPath::kWinding_FillType);
696 pathB.moveTo(0,2);
697 pathB.cubicTo(1,5, 1,0, 6,1);
698 pathB.close();
699 testPathOp(reporter, path, pathB, kUnion_PathOp);
700}
701
702static void cubicOp37d(skiatest::Reporter* reporter) {
703 SkPath path, pathB;
704 path.setFillType(SkPath::kWinding_FillType);
705 path.moveTo(0,1);
706 path.cubicTo(2,6, 6,1, 4,3);
707 path.close();
708 pathB.setFillType(SkPath::kWinding_FillType);
709 pathB.moveTo(1,6);
710 pathB.cubicTo(3,4, 1,0, 6,2);
711 pathB.close();
712 testPathOp(reporter, path, pathB, kDifference_PathOp);
713}
714
715#if 1
716// 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}
733#endif
734
735static void cubicOp39d(skiatest::Reporter* reporter) {
736 SkPath path, pathB;
737 path.setFillType(SkPath::kWinding_FillType);
738 path.moveTo(0,1);
739 path.cubicTo(2,3, 5,1, 4,3);
740 path.close();
741 pathB.setFillType(SkPath::kWinding_FillType);
742 pathB.moveTo(1,5);
743 pathB.cubicTo(3,4, 1,0, 3,2);
744 pathB.close();
745 testPathOp(reporter, path, pathB, kDifference_PathOp);
746}
747
748static void cubicOp40d(skiatest::Reporter* reporter) {
749 SkPath path, pathB;
750 path.setFillType(SkPath::kWinding_FillType);
751 path.moveTo(0,1);
752 path.cubicTo(1,5, 3,2, 4,2);
753 path.close();
754 pathB.setFillType(SkPath::kWinding_FillType);
755 pathB.moveTo(2,3);
756 pathB.cubicTo(2,4, 1,0, 5,1);
757 pathB.close();
758 testPathOp(reporter, path, pathB, kDifference_PathOp);
759}
760
761static void cubicOp41i(skiatest::Reporter* reporter) {
762 SkPath path, pathB;
763 path.setFillType(SkPath::kWinding_FillType);
764 path.moveTo(0,1);
765 path.cubicTo(2,6, 4,3, 6,4);
766 path.close();
767 pathB.setFillType(SkPath::kWinding_FillType);
768 pathB.moveTo(3,4);
769 pathB.cubicTo(4,6, 1,0, 6,2);
770 pathB.close();
771 testPathOp(reporter, path, pathB, kIntersect_PathOp);
772}
773
774static void cubicOp42d(skiatest::Reporter* reporter) {
775 SkPath path, pathB;
776 path.setFillType(SkPath::kWinding_FillType);
777 path.moveTo(0,1);
778 path.cubicTo(1,2, 6,5, 5,4);
779 path.close();
780 pathB.setFillType(SkPath::kWinding_FillType);
781 pathB.moveTo(5,6);
782 pathB.cubicTo(4,5, 1,0, 2,1);
783 pathB.close();
784 testPathOp(reporter, path, pathB, kDifference_PathOp);
785}
786
787static void cubicOp43d(skiatest::Reporter* reporter) {
788 SkPath path, pathB;
789 path.setFillType(SkPath::kWinding_FillType);
790 path.moveTo(0,2);
791 path.cubicTo(1,2, 4,0, 3,1);
792 path.close();
793 pathB.setFillType(SkPath::kWinding_FillType);
794 pathB.moveTo(0,4);
795 pathB.cubicTo(1,3, 2,0, 2,1);
796 pathB.close();
797 testPathOp(reporter, path, pathB, kDifference_PathOp);
798}
799
800static void cubicOp44d(skiatest::Reporter* reporter) {
801 SkPath path, pathB;
802 path.setFillType(SkPath::kWinding_FillType);
803 path.moveTo(0,2);
804 path.cubicTo(3,6, 4,0, 3,2);
805 path.close();
806 pathB.setFillType(SkPath::kWinding_FillType);
807 pathB.moveTo(0,4);
808 pathB.cubicTo(2,3, 2,0, 6,3);
809 pathB.close();
810 testPathOp(reporter, path, pathB, kDifference_PathOp);
811}
812
813static void cubicOp45d(skiatest::Reporter* reporter) {
814 SkPath path, pathB;
815 path.setFillType(SkPath::kWinding_FillType);
816 path.moveTo(0,2);
817 path.cubicTo(2,4, 4,0, 3,2);
818 path.close();
819 pathB.setFillType(SkPath::kWinding_FillType);
820 pathB.moveTo(0,4);
821 pathB.cubicTo(2,3, 2,0, 4,2);
822 pathB.close();
823 testPathOp(reporter, path, pathB, kDifference_PathOp);
824}
825
826static void cubicOp46d(skiatest::Reporter* reporter) {
827 SkPath path, pathB;
828 path.setFillType(SkPath::kWinding_FillType);
829 path.moveTo(0,2);
830 path.cubicTo(3,5, 5,0, 4,2);
831 path.close();
832 pathB.setFillType(SkPath::kWinding_FillType);
833 pathB.moveTo(0,5);
834 pathB.cubicTo(2,4, 2,0, 5,3);
835 pathB.close();
836 testPathOp(reporter, path, pathB, kDifference_PathOp);
837}
838
839static void cubicOp47d(skiatest::Reporter* reporter) {
840 SkPath path, pathB;
841 path.setFillType(SkPath::kWinding_FillType);
842 path.moveTo(0,1);
843 path.cubicTo(1,6, 6,2, 5,4);
844 path.close();
845 pathB.setFillType(SkPath::kWinding_FillType);
846 pathB.moveTo(2,6);
847 pathB.cubicTo(4,5, 1,0, 6,1);
848 pathB.close();
849 testPathOp(reporter, path, pathB, kDifference_PathOp);
850}
851
852static void cubicOp48d(skiatest::Reporter* reporter) {
853 SkPath path, pathB;
854 path.setFillType(SkPath::kWinding_FillType);
855 path.moveTo(0,2);
856 path.cubicTo(2,3, 5,1, 3,2);
857 path.close();
858 pathB.setFillType(SkPath::kWinding_FillType);
859 pathB.moveTo(1,5);
860 pathB.cubicTo(2,3, 2,0, 3,2);
861 pathB.close();
862 testPathOp(reporter, path, pathB, kDifference_PathOp);
863}
864
865static void cubicOp49d(skiatest::Reporter* reporter) {
866 SkPath path, pathB;
867 path.setFillType(SkPath::kWinding_FillType);
868 path.moveTo(0,2);
869 path.cubicTo(1,5, 3,2, 4,1);
870 path.close();
871 pathB.setFillType(SkPath::kWinding_FillType);
872 pathB.moveTo(2,3);
873 pathB.cubicTo(1,4, 2,0, 5,1);
874 pathB.close();
875 testPathOp(reporter, path, pathB, kDifference_PathOp);
876}
877
878static void cubicOp50d(skiatest::Reporter* reporter) {
879 SkPath path, pathB;
880 path.setFillType(SkPath::kWinding_FillType);
881 path.moveTo(0,3);
882 path.cubicTo(1,6, 5,0, 5,1);
883 path.close();
884 pathB.setFillType(SkPath::kWinding_FillType);
885 pathB.moveTo(0,5);
886 pathB.cubicTo(1,5, 3,0, 6,1);
887 pathB.close();
888 testPathOp(reporter, path, pathB, kDifference_PathOp);
889}
890
891static void cubicOp51d(skiatest::Reporter* reporter) {
892 SkPath path, pathB;
893 path.setFillType(SkPath::kWinding_FillType);
894 path.moveTo(0,3);
895 path.cubicTo(1,2, 4,1, 6,0);
896 path.close();
897 pathB.setFillType(SkPath::kWinding_FillType);
898 pathB.moveTo(1,4);
899 pathB.cubicTo(0,6, 3,0, 2,1);
900 pathB.close();
901 testPathOp(reporter, path, pathB, kDifference_PathOp);
902}
903
904static void cubicOp52d(skiatest::Reporter* reporter) {
905 SkPath path, pathB;
906 path.setFillType(SkPath::kWinding_FillType);
907 path.moveTo(0,2);
908 path.cubicTo(1,2, 5,4, 4,3);
909 path.close();
910 pathB.setFillType(SkPath::kWinding_FillType);
911 pathB.moveTo(4,5);
912 pathB.cubicTo(3,4, 2,0, 2,1);
913 pathB.close();
914 testPathOp(reporter, path, pathB, kDifference_PathOp);
915}
916
917static void cubicOp53d(skiatest::Reporter* reporter) {
918 SkPath path, pathB;
919 path.setFillType(SkPath::kWinding_FillType);
920 path.moveTo(0,3);
921 path.cubicTo(1,2, 5,3, 2,1);
922 path.close();
923 pathB.setFillType(SkPath::kWinding_FillType);
924 pathB.moveTo(3,5);
925 pathB.cubicTo(1,2, 3,0, 2,1);
926 pathB.close();
927 testPathOp(reporter, path, pathB, kDifference_PathOp);
928}
929
930static void cubicOp54d(skiatest::Reporter* reporter) {
931 SkPath path, pathB;
932 path.setFillType(SkPath::kWinding_FillType);
933 path.moveTo(0,4);
934 path.cubicTo(1,3, 5,4, 4,2);
935 path.close();
936 pathB.setFillType(SkPath::kWinding_FillType);
937 pathB.moveTo(4,5);
938 pathB.cubicTo(2,4, 4,0, 3,1);
939 pathB.close();
940 testPathOp(reporter, path, pathB, kDifference_PathOp);
941}
942
943static void cubicOp55d(skiatest::Reporter* reporter) {
944 SkPath path, pathB;
945 path.setFillType(SkPath::kWinding_FillType);
946 path.moveTo(0,5);
947 path.cubicTo(1,3, 3,2, 5,0);
948 path.close();
949 pathB.setFillType(SkPath::kWinding_FillType);
950 pathB.moveTo(2,3);
951 pathB.cubicTo(0,5, 5,0, 3,1);
952 pathB.close();
953 testPathOp(reporter, path, pathB, kDifference_PathOp);
954}
955
956static void cubicOp56d(skiatest::Reporter* reporter) {
957 SkPath path, pathB;
958 path.setFillType(SkPath::kWinding_FillType);
959 path.moveTo(0,1);
960 path.cubicTo(2,6, 5,0, 2,1);
961 path.close();
962 pathB.setFillType(SkPath::kWinding_FillType);
963 pathB.moveTo(0,5);
964 pathB.cubicTo(1,2, 1,0, 6,2);
965 pathB.close();
966 testPathOp(reporter, path, pathB, kDifference_PathOp);
967}
968
969static void cubicOp57d(skiatest::Reporter* reporter) {
970 SkPath path, pathB;
971 path.setFillType(SkPath::kWinding_FillType);
972 path.moveTo(0,5);
973 path.cubicTo(0,5, 5,4, 6,4);
974 path.close();
975 pathB.setFillType(SkPath::kWinding_FillType);
976 pathB.moveTo(4,5);
977 pathB.cubicTo(4,6, 5,0, 5,0);
978 pathB.close();
979 testPathOp(reporter, path, pathB, kDifference_PathOp);
980}
981
982static void cubicOp58d(skiatest::Reporter* reporter) {
983 SkPath path, pathB;
984 path.setFillType(SkPath::kWinding_FillType);
985 path.moveTo(0,5);
986 path.cubicTo(3,4, 6,5, 5,3);
987 path.close();
988 pathB.setFillType(SkPath::kWinding_FillType);
989 pathB.moveTo(5,6);
990 pathB.cubicTo(3,5, 5,0, 4,3);
991 pathB.close();
992 testPathOp(reporter, path, pathB, kDifference_PathOp);
993}
994
995static void cubicOp59d(skiatest::Reporter* reporter) {
996 SkPath path, pathB;
997 path.setFillType(SkPath::kWinding_FillType);
998 path.moveTo(0,1);
999 path.cubicTo(5,6, 4,0, 4,1);
1000 path.close();
1001 pathB.setFillType(SkPath::kWinding_FillType);
1002 pathB.moveTo(0,4);
1003 pathB.cubicTo(1,4, 1,0, 6,5);
1004 pathB.close();
1005 testPathOp(reporter, path, pathB, kDifference_PathOp);
1006}
1007
1008static void cubicOp60d(skiatest::Reporter* reporter) {
1009 SkPath path, pathB;
1010 path.setFillType(SkPath::kWinding_FillType);
1011 path.moveTo(0,2);
1012 path.cubicTo(4,6, 6,0, 5,2);
1013 path.close();
1014 pathB.setFillType(SkPath::kWinding_FillType);
1015 pathB.moveTo(0,6);
1016 pathB.cubicTo(2,5, 2,0, 6,4);
1017 pathB.close();
1018 testPathOp(reporter, path, pathB, kDifference_PathOp);
1019}
1020
1021static void cubicOp61d(skiatest::Reporter* reporter) {
1022 SkPath path, pathB;
1023 path.setFillType(SkPath::kWinding_FillType);
1024 path.moveTo(1,2);
1025 path.cubicTo(0,5, 3,2, 6,1);
1026 path.close();
1027 pathB.setFillType(SkPath::kWinding_FillType);
1028 pathB.moveTo(2,3);
1029 pathB.cubicTo(1,6, 2,1, 5,0);
1030 pathB.close();
1031 testPathOp(reporter, path, pathB, kDifference_PathOp);
1032}
1033
1034static void cubicOp62d(skiatest::Reporter* reporter) {
1035 SkPath path, pathB;
1036 path.setFillType(SkPath::kWinding_FillType);
1037 path.moveTo(1,3);
1038 path.cubicTo(5,6, 5,3, 5,4);
1039 path.close();
1040 pathB.setFillType(SkPath::kWinding_FillType);
1041 pathB.moveTo(3,5);
1042 pathB.cubicTo(4,5, 3,1, 6,5);
1043 pathB.close();
1044 testPathOp(reporter, path, pathB, kDifference_PathOp);
1045}
1046
1047static void cubicOp63d(skiatest::Reporter* reporter) {
1048 SkPath path, pathB;
1049 path.setFillType(SkPath::kWinding_FillType);
1050 path.moveTo(2,3);
1051 path.cubicTo(0,4, 3,2, 5,3);
1052 path.close();
1053 pathB.setFillType(SkPath::kWinding_FillType);
1054 pathB.moveTo(2,3);
1055 pathB.cubicTo(3,5, 3,2, 4,0);
1056 pathB.close();
1057 testPathOp(reporter, path, pathB, kDifference_PathOp);
1058}
1059
1060static void cubicOp64d(skiatest::Reporter* reporter) {
1061 SkPath path, pathB;
1062 path.moveTo(0,1);
1063 path.cubicTo(0,1, 1,0, 3,0);
1064 path.lineTo(0,1);
1065 path.close();
1066 pathB.moveTo(0,1);
1067 pathB.cubicTo(0,3, 1,0, 1,0);
1068 pathB.lineTo(0,1);
1069 pathB.close();
1070 testPathOp(reporter, path, pathB, kDifference_PathOp);
1071}
1072
1073static void cubicOp65d(skiatest::Reporter* reporter) {
1074 SkPath path, pathB;
1075 path.moveTo(0,1);
1076 path.cubicTo(1,5, 1,0, 1,0);
1077 path.lineTo(0,1);
1078 path.close();
1079 pathB.moveTo(0,1);
1080 pathB.cubicTo(0,1, 1,0, 5,1);
1081 pathB.lineTo(0,1);
1082 pathB.close();
1083 testPathOp(reporter, path, pathB, kDifference_PathOp);
1084}
1085
1086static void rectOp1d(skiatest::Reporter* reporter) {
1087 SkPath path, pathB;
1088 path.moveTo(0,1);
1089 path.cubicTo(0,1, 1,0, 3,0);
1090 path.lineTo(0,1);
1091 path.close();
1092 pathB.moveTo(0,1);
1093 pathB.cubicTo(0,3, 1,0, 1,0);
1094 pathB.lineTo(0,1);
1095 pathB.close();
1096 testPathOp(reporter, path, pathB, kDifference_PathOp);
1097}
1098
caryclark@google.comb3f09212013-04-17 15:49:16 +00001099static void cubicOp66u(skiatest::Reporter* reporter) {
1100 SkPath path, pathB;
1101 path.setFillType(SkPath::kWinding_FillType);
1102 path.moveTo(0,1);
1103 path.cubicTo(2,6, 4,2, 5,3);
1104 path.close();
1105 pathB.setFillType(SkPath::kWinding_FillType);
1106 pathB.moveTo(2,4);
1107 pathB.cubicTo(3,5, 1,0, 6,2);
1108 pathB.close();
1109 testPathOp(reporter, path, pathB, kUnion_PathOp);
1110}
1111
1112static void cubicOp67u(skiatest::Reporter* reporter) {
1113 SkPath path, pathB;
1114 path.moveTo(3,5);
1115 path.cubicTo(1,6, 5,0, 3,1);
1116 path.lineTo(3,5);
1117 path.close();
1118 pathB.moveTo(0,5);
1119 pathB.cubicTo(1,3, 5,3, 6,1);
1120 pathB.lineTo(0,5);
1121 pathB.close();
1122 testPathOp(reporter, path, pathB, kUnion_PathOp);
1123}
1124
caryclark@google.com03610322013-04-18 15:58:21 +00001125static void cubicOp68u(skiatest::Reporter* reporter) {
1126 SkPath path, pathB;
1127 path.moveTo(0,5);
1128 path.cubicTo(4,5, 4,1, 5,0);
1129 path.close();
1130 pathB.moveTo(1,4);
1131 pathB.cubicTo(0,5, 5,0, 5,4);
1132 pathB.close();
1133 testPathOp(reporter, path, pathB, kUnion_PathOp);
1134}
1135
1136static void cubicOp69d(skiatest::Reporter* reporter) {
1137 SkPath path, pathB;
1138 path.moveTo(1,3);
1139 path.cubicTo(0,1, 3,1, 2,0);
1140 path.close();
1141 pathB.moveTo(1,3);
1142 pathB.cubicTo(0,2, 3,1, 1,0);
1143 pathB.close();
1144 testPathOp(reporter, path, pathB, kDifference_PathOp);
1145}
1146
reed@google.com277c3f82013-05-31 15:17:50 +00001147
caryclark@google.com6dc7df62013-04-25 11:51:54 +00001148SkPathOp ops[] = {
1149 kUnion_PathOp,
1150 kXOR_PathOp,
1151 kReverseDifference_PathOp,
1152 kXOR_PathOp,
1153 kReverseDifference_PathOp,
1154};
1155
1156static void rRect1(skiatest::Reporter* reporter) {
caryclark@google.coma5e55922013-05-07 18:51:31 +00001157 SkScalar xA = SkFloatToScalar(0.65f);
1158 SkScalar xB = SkFloatToScalar(10.65f);
1159 SkScalar xC = SkFloatToScalar(20.65f);
1160 SkScalar xD = SkFloatToScalar(30.65f);
1161 SkScalar xE = SkFloatToScalar(40.65f);
1162 SkScalar xF = SkFloatToScalar(50.65f);
caryclark@google.com6dc7df62013-04-25 11:51:54 +00001163
caryclark@google.coma5e55922013-05-07 18:51:31 +00001164 SkScalar yA = SkFloatToScalar(0.65f);
1165 SkScalar yB = SkFloatToScalar(10.65f);
1166 SkScalar yC = SkFloatToScalar(20.65f);
1167 SkScalar yD = SkFloatToScalar(30.65f);
1168 SkScalar yE = SkFloatToScalar(40.65f);
1169 SkScalar yF = SkFloatToScalar(50.65f);
1170 SkPath paths[5];
1171 SkRect rects[5];
1172 rects[0].set(xB, yB, xE, yE);
1173 paths[0].addRoundRect(rects[0], SkIntToScalar(5), SkIntToScalar(5)); // red
1174 rects[1].set(xA, yA, xD, yD);
1175 paths[1].addRoundRect(rects[1], SkIntToScalar(5), SkIntToScalar(5)); // green
1176 rects[2].set(xC, yA, xF, yD);
1177 paths[2].addRoundRect(rects[2], SkIntToScalar(5), SkIntToScalar(5)); // blue
1178 rects[3].set(xA, yC, xD, yF);
1179 paths[3].addRoundRect(rects[3], SkIntToScalar(5), SkIntToScalar(5)); // yellow
1180 rects[4].set(xC, yC, xF, yF);
1181 paths[4].addRoundRect(rects[4], SkIntToScalar(5), SkIntToScalar(5)); // cyan
1182 SkPath path;
1183 path.setFillType(SkPath::kInverseEvenOdd_FillType);
1184 for (int index = 0; index < 5; ++index) {
1185 testPathOp(reporter, path, paths[index], ops[index]);
1186 Op(path, paths[index], ops[index], &path);
1187 }
1188}
1189
1190static void skp1(skiatest::Reporter* reporter) {
1191 SkPath path;
1192 path.setFillType(SkPath::kEvenOdd_FillType);
1193 path.moveTo(189,7);
1194 path.cubicTo(189,5.34314585f, 190.34314f,4, 192,4);
1195 path.lineTo(243,4);
1196 path.cubicTo(244.65686f,4, 246,5.34314585f, 246,7);
1197 path.lineTo(246,21);
1198 path.cubicTo(246,22.6568546f, 244.65686f,24, 243,24);
1199 path.lineTo(192,24);
1200 path.cubicTo(190.34314f,24, 189,22.6568546f, 189,21);
1201 path.lineTo(189,7);
1202 path.close();
1203 path.moveTo(191,8);
1204 path.cubicTo(191,6.89543009f, 191.895432f,6, 193,6);
1205 path.lineTo(242,6);
1206 path.cubicTo(243.104568f,6, 244,6.89543009f, 244,8);
1207 path.lineTo(244,20);
1208 path.cubicTo(244,21.1045704f, 243.104568f,22, 242,22);
1209 path.lineTo(193,22);
1210 path.cubicTo(191.895432f,22, 191,21.1045704f, 191,20);
1211 path.lineTo(191,8);
1212 path.close();
1213 SkPath pathB;
1214 pathB.setFillType(SkPath::kWinding_FillType);
1215 pathB.moveTo(189,4);
1216 pathB.lineTo(199,14);
1217 pathB.lineTo(236,14);
1218 pathB.lineTo(246,4);
1219 pathB.lineTo(189,4);
1220 pathB.close();
1221 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1222}
1223
1224static void skp2(skiatest::Reporter* reporter) {
1225 SkPath path;
1226 path.setFillType(SkPath::kEvenOdd_FillType);
1227 path.moveTo(253.000000f, 11757.0000f);
1228 path.lineTo(253.000000f, 222.000000f);
1229 path.lineTo(823.000000f, 222.000000f);
1230 path.lineTo(823.000000f, 11757.0000f);
1231 path.lineTo(253.000000f, 11757.0000f);
1232 path.close();
1233 SkPath pathB;
1234 pathB.setFillType(SkPath::kWinding_FillType);
1235 pathB.moveTo(258.000000f, 1028.00000f);
1236 pathB.lineTo(258.000000f, 1027.00000f);
1237 pathB.lineTo(823.000000f, 1027.00000f);
1238 pathB.lineTo(823.000000f, 1028.00000f);
1239 pathB.lineTo(258.000000f, 1028.00000f);
1240 pathB.close();
1241 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1242}
1243
1244static void skp3(skiatest::Reporter* reporter) {
1245 SkPath path;
1246 path.setFillType(SkPath::kEvenOdd_FillType);
1247 path.moveTo(717.000000f, 507.000000f);
1248 path.lineTo(717.000000f, 425.000000f);
1249 path.lineTo(973.000000f, 425.000000f);
1250 path.lineTo(973.000000f, 507.000000f);
1251 path.quadTo(973.000000f, 508.242645f, 972.121582f, 509.121613f);
1252 path.quadTo(971.242615f, 510.000000f, 970.000000f, 510.000000f);
1253 path.lineTo(720.000000f, 510.000000f);
1254 path.quadTo(718.757385f, 510.000000f, 717.878418f, 509.121613f);
1255 path.quadTo(717.000000f, 508.242645f, 717.000000f, 507.000000f);
1256 path.close();
1257 path.moveTo(719.000000f, 426.000000f);
1258 path.lineTo(971.000000f, 426.000000f);
1259 path.lineTo(971.000000f, 506.000000f);
1260 path.cubicTo(971.000000f, 507.104584f, 970.104553f, 508.000000f, 969.000000f, 508.000000f);
1261 path.lineTo(721.000000f, 508.000000f);
1262 path.cubicTo(719.895447f, 508.000000f, 719.000000f, 507.104584f, 719.000000f, 506.000000f);
1263 path.lineTo(719.000000f, 426.000000f);
1264 path.close();
1265 SkPath pathB;
1266 pathB.setFillType(SkPath::kWinding_FillType);
1267 pathB.moveTo(717.000000f, 510.000000f);
1268 pathB.lineTo(760.000000f, 467.000000f);
1269 pathB.lineTo(930.000000f, 467.000000f);
1270 pathB.lineTo(973.000000f, 510.000000f);
1271 pathB.lineTo(717.000000f, 510.000000f);
1272 pathB.close();
1273 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1274}
1275
1276static void skp4(skiatest::Reporter* reporter) {
1277 SkPath path;
1278 path.setFillType(SkPath::kEvenOdd_FillType);
1279 path.moveTo(230.756805f, 591.756775f);
1280 path.quadTo(232.514725f, 590.000000f, 235.000000f, 590.000000f);
1281 path.lineTo(300.000000f, 590.000000f);
1282 path.quadTo(302.485291f, 590.000000f, 304.243195f, 591.756775f);
1283 path.quadTo(306.000000f, 593.514709f, 306.000000f, 596.000000f);
1284 path.lineTo(306.000000f, 617.000000f);
1285 path.lineTo(229.000000f, 617.000000f);
1286 path.lineTo(229.000000f, 596.000000f);
1287 path.quadTo(229.000000f, 593.514709f, 230.756805f, 591.756775f);
1288 path.close();
1289 path.moveTo(231.000000f, 597.000000f);
1290 path.cubicTo(231.000000f, 594.238586f, 233.238571f, 592.000000f, 236.000000f, 592.000000f);
1291 path.lineTo(299.000000f, 592.000000f);
1292 path.cubicTo(301.761414f, 592.000000f, 304.000000f, 594.238586f, 304.000000f, 597.000000f);
1293 path.lineTo(304.000000f, 616.000000f);
1294 path.lineTo(231.000000f, 616.000000f);
1295 path.lineTo(231.000000f, 597.000000f);
1296 path.close();
1297 SkPath pathB;
1298 pathB.setFillType(SkPath::kWinding_FillType);
1299 pathB.moveTo(306.000000f, 590.000000f);
1300 pathB.lineTo(292.000000f, 604.000000f);
1301 pathB.lineTo(305.000000f, 617.000000f);
1302 pathB.lineTo(306.000000f, 617.000000f);
1303 pathB.lineTo(306.000000f, 590.000000f);
1304 pathB.close();
1305 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1306}
1307
1308static void skp5(skiatest::Reporter* reporter) {
1309 SkPath path;
1310 path.setFillType(SkPath::kEvenOdd_FillType);
1311 path.moveTo(18.0000000f, 226.000000f);
1312 path.quadTo(14.6862917f, 226.000000f, 12.3423996f, 228.342407f);
1313 path.quadTo(10.0000000f, 230.686295f, 10.0000000f, 234.000000f);
1314 path.lineTo(10.0000000f, 253.000000f);
1315 path.lineTo(1247.00000f, 253.000000f);
1316 path.lineTo(1247.00000f, 234.000000f);
1317 path.quadTo(1247.00000f, 230.686295f, 1244.65759f, 228.342407f);
1318 path.quadTo(1242.31372f, 226.000000f, 1239.00000f, 226.000000f);
1319 path.lineTo(18.0000000f, 226.000000f);
1320 path.close();
1321 SkPath pathB;
1322 pathB.setFillType(SkPath::kInverseWinding_FillType);
1323 pathB.moveTo(18.0000000f, 226.000000f);
1324 pathB.lineTo(1239.00000f, 226.000000f);
1325 pathB.cubicTo(1243.41833f, 226.000000f, 1247.00000f, 229.581726f, 1247.00000f, 234.000000f);
1326 pathB.lineTo(1247.00000f, 252.000000f);
1327 pathB.lineTo(10.0000000f, 252.000000f);
1328 pathB.lineTo(10.0000000f, 234.000000f);
1329 pathB.cubicTo(10.0000000f, 229.581726f, 13.5817204f, 226.000000f, 18.0000000f, 226.000000f);
1330 pathB.close();
1331 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1332}
1333
1334static void cubicOp70d(skiatest::Reporter* reporter) {
1335 SkPath path, pathB;
1336 path.setFillType(SkPath::kWinding_FillType);
1337 path.moveTo(0,1);
1338 path.cubicTo(0,5, 4,0, 5,0);
1339 path.close();
1340 pathB.setFillType(SkPath::kWinding_FillType);
1341 pathB.moveTo(0,4);
1342 pathB.cubicTo(0,5, 1,0, 5,0);
1343 pathB.close();
1344 testPathOp(reporter, path, pathB, kDifference_PathOp);
caryclark@google.com6dc7df62013-04-25 11:51:54 +00001345}
1346
reed@google.com277c3f82013-05-31 15:17:50 +00001347static void cubicOp71d(skiatest::Reporter* reporter) {
1348 SkPath path, pathB;
1349 path.setFillType(SkPath::kWinding_FillType);
1350 path.moveTo(0,1);
1351 path.cubicTo(0,5, 4,1, 6,4);
1352 path.close();
1353 pathB.setFillType(SkPath::kWinding_FillType);
1354 pathB.moveTo(1,4);
1355 pathB.cubicTo(4,6, 1,0, 5,0);
1356 pathB.close();
1357 testPathOp(reporter, path, pathB, kDifference_PathOp);
1358}
1359
1360static void cubicOp72i(skiatest::Reporter* reporter) {
1361 SkPath path, pathB;
1362 path.setFillType(SkPath::kWinding_FillType);
1363 path.moveTo(0,1);
1364 path.cubicTo(0,5, 5,2, 5,4);
1365 path.close();
1366 pathB.setFillType(SkPath::kWinding_FillType);
1367 pathB.moveTo(2,5);
1368 pathB.cubicTo(4,5, 1,0, 5,0);
1369 pathB.close();
1370 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1371}
1372
1373static void cubicOp73d(skiatest::Reporter* reporter) {
1374 SkPath path, pathB;
1375 path.setFillType(SkPath::kWinding_FillType);
1376 path.moveTo(0,1);
1377 path.cubicTo(3,4, 4,0, 6,4);
1378 path.lineTo(0,1);
1379 path.close();
1380 pathB.setFillType(SkPath::kWinding_FillType);
1381 pathB.moveTo(0,4);
1382 pathB.cubicTo(4,6, 1,0, 4,3);
1383 pathB.lineTo(0,4);
1384 pathB.close();
1385 testPathOp(reporter, path, pathB, kDifference_PathOp);
1386}
1387
1388static void cubicOp75d(skiatest::Reporter* reporter) {
1389 SkPath path, pathB;
1390 path.setFillType(SkPath::kWinding_FillType);
1391 path.moveTo(0,1);
1392 path.cubicTo(0,4, 5,1, 6,4);
1393 path.lineTo(0,1);
1394 path.close();
1395 pathB.setFillType(SkPath::kWinding_FillType);
1396 pathB.moveTo(1,5);
1397 pathB.cubicTo(4,6, 1,0, 4,0);
1398 pathB.lineTo(1,5);
1399 pathB.close();
1400 testPathOp(reporter, path, pathB, kDifference_PathOp);
1401}
1402
1403static void cubicOp77i(skiatest::Reporter* reporter) {
1404 SkPath path, pathB;
1405 path.setFillType(SkPath::kEvenOdd_FillType);
1406 path.moveTo(0,1);
1407 path.cubicTo(1,3, 2,0, 3,2);
1408 path.lineTo(0,1);
1409 path.close();
1410 pathB.setFillType(SkPath::kEvenOdd_FillType);
1411 pathB.moveTo(0,2);
1412 pathB.cubicTo(2,3, 1,0, 3,1);
1413 pathB.lineTo(0,2);
1414 pathB.close();
1415 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1416}
1417
1418static void cubicOp78u(skiatest::Reporter* reporter) {
1419 SkPath path, pathB;
1420 path.setFillType(SkPath::kEvenOdd_FillType);
1421 path.moveTo(1,6);
1422 path.cubicTo(1,6, 5,0, 6,1);
1423 path.lineTo(1,6);
1424 path.close();
1425 pathB.setFillType(SkPath::kEvenOdd_FillType);
1426 pathB.moveTo(0,5);
1427 pathB.cubicTo(1,6, 6,1, 6,1);
1428 pathB.lineTo(0,5);
1429 pathB.close();
1430 testPathOp(reporter, path, pathB, kUnion_PathOp);
1431}
1432
1433static void cubicOp79d(skiatest::Reporter* reporter) {
1434 SkPath path, pathB;
1435 path.setFillType(SkPath::kWinding_FillType);
1436 path.moveTo(0,2);
1437 path.cubicTo(0,1, 3,-0.1f, 1,0);
1438 path.close();
1439 pathB.setFillType(SkPath::kWinding_FillType);
1440 pathB.moveTo(0,3);
1441 pathB.cubicTo(0,1, 2,0, 1,0);
1442 pathB.close();
1443 testPathOp(reporter, path, pathB, kDifference_PathOp);
1444}
1445
1446static void cubicOp79u(skiatest::Reporter* reporter) {
1447 SkPath path, pathB;
1448 path.setFillType(SkPath::kWinding_FillType);
1449 path.moveTo(0,1);
1450 path.cubicTo(1,3, 1,0, 6,4);
1451 path.close();
1452 pathB.setFillType(SkPath::kWinding_FillType);
1453 pathB.moveTo(0,1);
1454 pathB.cubicTo(4,6, 1,0, 3,1);
1455 pathB.close();
1456 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1457}
1458
1459static void cubicOp80i(skiatest::Reporter* reporter) {
1460 SkPath path, pathB;
1461 path.setFillType(SkPath::kWinding_FillType);
1462 path.moveTo(0,1);
1463 path.cubicTo(2,3, 2,1, 4,3);
1464 path.lineTo(0,1);
1465 path.close();
1466 pathB.setFillType(SkPath::kWinding_FillType);
1467 pathB.moveTo(1,2);
1468 pathB.cubicTo(3,4, 1,0, 3,2);
1469 pathB.lineTo(1,2);
1470 pathB.close();
1471 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1472}
1473
1474static void cubicOp82i(skiatest::Reporter* reporter) {
1475 SkPath path, pathB;
1476 path.setFillType(SkPath::kEvenOdd_FillType);
1477 path.moveTo(0,1);
1478 path.cubicTo(2,3, 5,2, 3,0);
1479 path.lineTo(0,1);
1480 path.close();
1481 pathB.setFillType(SkPath::kWinding_FillType);
1482 pathB.moveTo(2,5);
1483 pathB.cubicTo(0,3, 1,0, 3,2);
1484 pathB.lineTo(2,5);
1485 pathB.close();
1486 testPathOp(reporter, path, pathB, kIntersect_PathOp);
1487}
1488
1489static void cubicOp81d(skiatest::Reporter* reporter) {
1490 SkPath path, pathB;
1491 path.setFillType(SkPath::kWinding_FillType);
1492 path.moveTo(0,1);
1493 path.cubicTo(4,6, 4,3, 5,4);
1494 path.close();
1495 pathB.setFillType(SkPath::kWinding_FillType);
1496 pathB.moveTo(3,4);
1497 pathB.cubicTo(4,5, 1,0, 6,4);
1498 pathB.close();
1499 testPathOp(reporter, path, pathB, kDifference_PathOp);
1500}
1501
1502static void (*firstTest)(skiatest::Reporter* ) = cubicOp81d;
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001503
1504static struct TestDesc tests[] = {
reed@google.com277c3f82013-05-31 15:17:50 +00001505 TEST(cubicOp82i),
1506 TEST(cubicOp81d),
1507 TEST(cubicOp80i),
1508 TEST(cubicOp79u),
1509 TEST(cubicOp79d),
1510 TEST(cubicOp78u),
1511 TEST(cubicOp77i),
1512 TEST(cubicOp75d),
1513 TEST(cubicOp73d),
1514 TEST(cubicOp72i),
1515 TEST(cubicOp71d),
caryclark@google.coma5e55922013-05-07 18:51:31 +00001516 TEST(skp5),
1517 TEST(skp4),
1518 TEST(skp3),
1519 TEST(skp2),
1520 TEST(skp1),
caryclark@google.com6dc7df62013-04-25 11:51:54 +00001521 TEST(rRect1),
caryclark@google.coma5e55922013-05-07 18:51:31 +00001522 TEST(cubicOp70d),
caryclark@google.com03610322013-04-18 15:58:21 +00001523 TEST(cubicOp69d),
1524 TEST(cubicOp68u),
caryclark@google.comb3f09212013-04-17 15:49:16 +00001525 TEST(cubicOp67u),
1526 TEST(cubicOp66u),
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001527 TEST(rectOp1d),
1528 TEST(cubicOp65d),
1529 TEST(cubicOp64d),
1530 TEST(cubicOp63d),
1531 TEST(cubicOp62d),
1532 TEST(cubicOp61d),
1533 TEST(cubicOp60d),
1534 TEST(cubicOp59d),
1535 TEST(cubicOp58d),
1536 TEST(cubicOp57d),
1537 TEST(cubicOp56d),
1538 TEST(cubicOp55d),
1539 TEST(cubicOp54d),
1540 TEST(cubicOp53d),
1541 TEST(cubicOp52d),
1542 TEST(cubicOp51d),
1543 TEST(cubicOp50d),
1544 TEST(cubicOp49d),
1545 TEST(cubicOp48d),
1546 TEST(cubicOp47d),
1547 TEST(cubicOp46d),
1548 TEST(cubicOp45d),
1549 TEST(cubicOp44d),
1550 TEST(cubicOp43d),
1551 TEST(cubicOp42d),
1552 TEST(cubicOp41i),
1553 TEST(cubicOp40d),
1554 TEST(cubicOp39d),
1555 TEST(cubicOp38d),
1556 TEST(cubicOp37d),
1557 TEST(cubicOp36u),
1558 TEST(cubicOp35d),
1559 TEST(cubicOp34d),
1560 TEST(cubicOp33i),
1561 TEST(cubicOp32d),
1562 TEST(cubicOp31d),
1563 TEST(cubicOp31x),
1564 TEST(cubicOp31u),
1565 TEST(cubicOp30d),
1566 TEST(cubicOp29d),
1567 TEST(cubicOp28u),
1568 TEST(cubicOp27d),
1569 TEST(cubicOp26d),
1570 TEST(cubicOp25i),
1571 TEST(testOp8d),
1572 TEST(testDiff1),
1573 TEST(testIntersect1),
1574 TEST(testUnion1),
1575 TEST(testXor1),
1576 TEST(testDiff2),
1577 TEST(testIntersect2),
1578 TEST(testUnion2),
1579 TEST(testXor2),
1580 TEST(testOp1d),
1581 TEST(testOp2d),
1582 TEST(testOp3d),
1583 TEST(testOp1u),
1584 TEST(testOp4d),
1585 TEST(testOp5d),
1586 TEST(testOp6d),
1587 TEST(testOp7d),
1588 TEST(testOp2u),
1589
1590 TEST(cubicOp24d),
1591 TEST(cubicOp23d),
1592 TEST(cubicOp22d),
1593 TEST(cubicOp21d),
1594 TEST(cubicOp20d),
1595 TEST(cubicOp19i),
1596 TEST(cubicOp18d),
1597 TEST(cubicOp17d),
1598 TEST(cubicOp16d),
1599 TEST(cubicOp15d),
1600 TEST(cubicOp14d),
1601 TEST(cubicOp13d),
1602 TEST(cubicOp12d),
1603 TEST(cubicOp11d),
1604 TEST(cubicOp10d),
1605 TEST(cubicOp1i),
1606 TEST(cubicOp9d),
1607 TEST(quadOp9d),
1608 TEST(lineOp9d),
1609 TEST(cubicOp8d),
1610 TEST(cubicOp7d),
1611 TEST(cubicOp6d),
1612 TEST(cubicOp5d),
1613 TEST(cubicOp3d),
1614 TEST(cubicOp2d),
1615 TEST(cubicOp1d),
1616};
1617
caryclark@google.comad65a3e2013-04-15 19:13:59 +00001618static const size_t testCount = SK_ARRAY_COUNT(tests);
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001619
1620static struct TestDesc subTests[] = {
caryclark@google.coma5e55922013-05-07 18:51:31 +00001621 TEST(cubicOp6d),
1622 TEST(cubicOp8d),
1623 TEST(cubicOp70d),
1624 TEST(cubicOp16d),
1625 TEST(skp5),
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001626};
1627
caryclark@google.comad65a3e2013-04-15 19:13:59 +00001628static const size_t subTestCount = SK_ARRAY_COUNT(subTests);
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001629
1630static void (*firstSubTest)(skiatest::Reporter* ) = 0;
1631
1632static bool runSubTestsFirst = false;
1633static bool runReverse = false;
1634static void (*stopTest)(skiatest::Reporter* ) = 0;
1635
caryclark@google.comad65a3e2013-04-15 19:13:59 +00001636static void PathOpsOpTest(skiatest::Reporter* reporter) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001637#ifdef SK_DEBUG
1638 gDebugMaxWindSum = 4;
1639 gDebugMaxWindValue = 4;
1640#endif
1641 if (runSubTestsFirst) {
1642 RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, runReverse);
1643 }
1644 RunTestSet(reporter, tests, testCount, firstTest, stopTest, runReverse);
1645 if (!runSubTestsFirst) {
1646 RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, runReverse);
1647 }
1648#ifdef SK_DEBUG
1649 gDebugMaxWindSum = SK_MaxS32;
1650 gDebugMaxWindValue = SK_MaxS32;
1651#endif
1652}
1653
1654#include "TestClassDef.h"
caryclark@google.comad65a3e2013-04-15 19:13:59 +00001655DEFINE_TESTCLASS_SHORT(PathOpsOpTest)