blob: a28bae8b1589a3342e559f6682abadd60db29552 [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"
caryclarke4097e32014-06-18 07:24:19 -07008#include "PathOpsTestCommon.h"
caryclark@google.com818b0cc2013-04-08 11:50:46 +00009
caryclark624637c2015-05-11 07:21:27 -070010class PathTest_Private {
11public:
12 PathTest_Private(SkPath* path)
13 : fPath(path) {}
14
15 void setPt(int index, SkScalar x, SkScalar y) {
16 fPath->setPt(index, x, y);
17 }
18
19 SkPath* fPath;
20};
21
22static void path_edit(const SkPoint& from, const SkPoint& to, SkPath* path) {
23 PathTest_Private testPath(path);
24 for (int index = 0; index < path->countPoints(); ++index) {
25 if (SkDPoint::ApproximatelyEqual(path->getPoint(index), from)) {
26 testPath.setPt(index, to.fX, to.fY);
27 return;
28 }
29 }
30}
caryclark@google.com818b0cc2013-04-08 11:50:46 +000031
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000032static void cubicOp1d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +000033 SkPath path, pathB;
34 path.setFillType(SkPath::kWinding_FillType);
35 path.moveTo(0,1);
36 path.cubicTo(0,2, 1,0, 1,0);
37 path.close();
38 pathB.setFillType(SkPath::kWinding_FillType);
39 pathB.moveTo(0,1);
40 pathB.cubicTo(0,1, 1,0, 2,0);
41 pathB.close();
caryclark54359292015-03-26 07:52:43 -070042 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000043}
44
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000045static void cubicOp2d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +000046 SkPath path, pathB;
47 path.setFillType(SkPath::kWinding_FillType);
48 path.moveTo(0,2);
49 path.cubicTo(0,1, 1,0, 1,0);
50 path.close();
51 pathB.setFillType(SkPath::kWinding_FillType);
52 pathB.moveTo(0,1);
53 pathB.cubicTo(0,1, 2,0, 1,0);
54 pathB.close();
caryclark54359292015-03-26 07:52:43 -070055 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000056}
57
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000058static void cubicOp3d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +000059 SkPath path, pathB;
60 path.setFillType(SkPath::kWinding_FillType);
61 path.moveTo(0,1);
62 path.cubicTo(2,3, 1,0, 1,0);
63 path.close();
64 pathB.setFillType(SkPath::kWinding_FillType);
65 pathB.moveTo(0,1);
66 pathB.cubicTo(0,1, 1,0, 3,2);
67 pathB.close();
caryclark54359292015-03-26 07:52:43 -070068 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000069}
70
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000071static void cubicOp5d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +000072 SkPath path, pathB;
73 path.setFillType(SkPath::kWinding_FillType);
74 path.moveTo(0,1);
75 path.cubicTo(0,2, 1,0, 2,0);
76 path.close();
77 pathB.setFillType(SkPath::kWinding_FillType);
78 pathB.moveTo(0,1);
79 pathB.cubicTo(0,2, 1,0, 2,0);
80 pathB.close();
caryclark54359292015-03-26 07:52:43 -070081 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000082}
83
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000084static void cubicOp6d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +000085 SkPath path, pathB;
86 path.setFillType(SkPath::kWinding_FillType);
87 path.moveTo(0,1);
88 path.cubicTo(0,6, 1,0, 3,0);
89 path.close();
90 pathB.setFillType(SkPath::kWinding_FillType);
91 pathB.moveTo(0,1);
92 pathB.cubicTo(0,3, 1,0, 6,0);
93 pathB.close();
caryclark54359292015-03-26 07:52:43 -070094 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000095}
96
commit-bot@chromium.org4431e772014-04-14 17:08:59 +000097static void cubicOp7d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +000098 SkPath path, pathB;
99 path.setFillType(SkPath::kWinding_FillType);
100 path.moveTo(0,1);
101 path.cubicTo(3,4, 1,0, 3,0);
102 path.close();
103 pathB.setFillType(SkPath::kWinding_FillType);
104 pathB.moveTo(0,1);
105 pathB.cubicTo(0,3, 1,0, 4,3);
106 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700107 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000108}
109
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000110static void cubicOp8d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000111 SkPath path, pathB;
112 path.setFillType(SkPath::kWinding_FillType);
113 path.moveTo(0,1);
114 path.cubicTo(0,5, 1,0, 4,0);
115 path.close();
116 pathB.setFillType(SkPath::kWinding_FillType);
117 pathB.moveTo(0,1);
118 pathB.cubicTo(0,4, 1,0, 5,0);
119 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700120 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000121}
122
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000123static void cubicOp9d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000124 SkPath path, pathB;
125 path.setFillType(SkPath::kWinding_FillType);
126 path.moveTo(0,1);
127 path.cubicTo(1,6, 1,0, 2,1);
128 path.close();
129 pathB.setFillType(SkPath::kWinding_FillType);
130 pathB.moveTo(0,1);
131 pathB.cubicTo(1,2, 1,0, 6,1);
132 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700133 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000134}
135
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000136static void quadOp9d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000137 SkPath path, pathB;
138 path.setFillType(SkPath::kWinding_FillType);
139 path.moveTo(0,1);
140 path.quadTo(1,6, 1.5f,1);
141 path.quadTo(1.5f,0.5f, 2,1);
142 path.close();
143 pathB.setFillType(SkPath::kWinding_FillType);
144 pathB.moveTo(0,1);
145 pathB.quadTo(1,2, 1.4f,1);
146 pathB.quadTo(3,0.4f, 6,1);
147 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700148 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000149}
150
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000151static void lineOp9d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000152 SkPath path, pathB;
153 path.setFillType(SkPath::kWinding_FillType);
154 path.moveTo(0,1);
155 path.lineTo(1,6);
156 path.lineTo(1.5f,1);
157 path.lineTo(1.8f,0.8f);
158 path.lineTo(2,1);
159 path.close();
160 pathB.setFillType(SkPath::kWinding_FillType);
161 pathB.moveTo(0,1);
162 pathB.lineTo(1,2);
163 pathB.lineTo(1.4f,1);
164 pathB.lineTo(3,0.4f);
165 pathB.lineTo(6,1);
166 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700167 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000168}
169
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000170static void cubicOp1i(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000171 SkPath path, pathB;
172 path.setFillType(SkPath::kWinding_FillType);
173 path.moveTo(0,1);
174 path.cubicTo(1,2, 1,0, 2,1);
175 path.close();
176 pathB.setFillType(SkPath::kWinding_FillType);
177 pathB.moveTo(0,1);
178 pathB.cubicTo(1,2, 1,0, 2,1);
179 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700180 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000181}
182
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000183static void cubicOp10d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000184 SkPath path, pathB;
185 path.setFillType(SkPath::kWinding_FillType);
186 path.moveTo(0,1);
187 path.cubicTo(1,3, 1,0, 4,1);
188 path.close();
189 pathB.setFillType(SkPath::kWinding_FillType);
190 pathB.moveTo(0,1);
191 pathB.cubicTo(1,4, 1,0, 3,1);
192 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700193 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000194}
195
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000196static void cubicOp11d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000197 SkPath path, pathB;
198 path.setFillType(SkPath::kWinding_FillType);
199 path.moveTo(0,1);
200 path.cubicTo(3,4, 1,0, 5,1);
201 path.close();
202 pathB.setFillType(SkPath::kWinding_FillType);
203 pathB.moveTo(0,1);
204 pathB.cubicTo(1,5, 1,0, 4,3);
205 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700206 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000207}
208
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000209static void cubicOp12d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000210 SkPath path, pathB;
211 path.setFillType(SkPath::kWinding_FillType);
212 path.moveTo(0,1);
213 path.cubicTo(1,6, 1,0, 1,0);
214 path.close();
215 pathB.setFillType(SkPath::kWinding_FillType);
216 pathB.moveTo(0,1);
217 pathB.cubicTo(0,1, 1,0, 6,1);
218 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700219 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000220}
221
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000222static void cubicOp13d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000223 SkPath path, pathB;
224 path.setFillType(SkPath::kWinding_FillType);
225 path.moveTo(0,1);
226 path.cubicTo(4,5, 1,0, 5,3);
227 path.close();
228 pathB.setFillType(SkPath::kWinding_FillType);
229 pathB.moveTo(0,1);
230 pathB.cubicTo(3,5, 1,0, 5,4);
231 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700232 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000233}
234
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000235static void cubicOp14d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000236 SkPath path, pathB;
237 path.setFillType(SkPath::kWinding_FillType);
238 path.moveTo(0,1);
239 path.cubicTo(0,2, 2,0, 2,1);
240 path.close();
241 pathB.setFillType(SkPath::kWinding_FillType);
242 pathB.moveTo(0,2);
243 pathB.cubicTo(1,2, 1,0, 2,0);
244 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700245 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000246}
247
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000248static void cubicOp15d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000249 SkPath path, pathB;
250 path.setFillType(SkPath::kWinding_FillType);
251 path.moveTo(0,1);
252 path.cubicTo(3,6, 2,0, 2,1);
253 path.close();
254 pathB.setFillType(SkPath::kWinding_FillType);
255 pathB.moveTo(0,2);
256 pathB.cubicTo(1,2, 1,0, 6,3);
257 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700258 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000259}
260
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000261static void cubicOp16d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000262 SkPath path, pathB;
263 path.setFillType(SkPath::kWinding_FillType);
264 path.moveTo(0,2);
265 path.cubicTo(0,1, 3,0, 1,0);
266 path.close();
267 pathB.setFillType(SkPath::kWinding_FillType);
268 pathB.moveTo(0,3);
269 pathB.cubicTo(0,1, 2,0, 1,0);
270 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700271 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000272}
273
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000274static void cubicOp17d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000275 SkPath path, pathB;
276 path.setFillType(SkPath::kWinding_FillType);
277 path.moveTo(0,2);
278 path.cubicTo(0,2, 4,0, 2,1);
279 path.close();
280 pathB.setFillType(SkPath::kWinding_FillType);
281 pathB.moveTo(0,4);
282 pathB.cubicTo(1,2, 2,0, 2,0);
283 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700284 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000285}
286
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000287static void cubicOp18d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000288 SkPath path, pathB;
289 path.setFillType(SkPath::kWinding_FillType);
290 path.moveTo(0,1);
291 path.cubicTo(3,5, 2,0, 2,1);
292 path.close();
293 pathB.setFillType(SkPath::kWinding_FillType);
294 pathB.moveTo(0,2);
295 pathB.cubicTo(1,2, 1,0, 5,3);
296 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700297 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000298}
299
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000300static void cubicOp19i(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000301 SkPath path, pathB;
302 path.setFillType(SkPath::kWinding_FillType);
303 path.moveTo(0,2);
304 path.cubicTo(0,1, 2,1, 6,2);
305 path.close();
306 pathB.setFillType(SkPath::kWinding_FillType);
307 pathB.moveTo(1,2);
308 pathB.cubicTo(2,6, 2,0, 1,0);
309 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700310 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000311}
312
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000313static void cubicOp20d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000314 SkPath path, pathB;
315 path.setFillType(SkPath::kWinding_FillType);
316 path.moveTo(0,1);
317 path.cubicTo(0,1, 6,0, 2,1);
318 path.close();
319 pathB.setFillType(SkPath::kWinding_FillType);
320 pathB.moveTo(0,6);
321 pathB.cubicTo(1,2, 1,0, 1,0);
322 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700323 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000324}
325
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000326static void cubicOp21d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000327 SkPath path, pathB;
328 path.setFillType(SkPath::kWinding_FillType);
329 path.moveTo(0,1);
330 path.cubicTo(0,1, 2,1, 6,5);
331 path.close();
332 pathB.setFillType(SkPath::kWinding_FillType);
333 pathB.moveTo(1,2);
334 pathB.cubicTo(5,6, 1,0, 1,0);
335 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700336 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000337}
338
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000339static void cubicOp22d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000340 SkPath path, pathB;
341 path.setFillType(SkPath::kWinding_FillType);
342 path.moveTo(0,1);
343 path.cubicTo(2,3, 3,0, 2,1);
344 path.close();
345 pathB.setFillType(SkPath::kWinding_FillType);
346 pathB.moveTo(0,3);
347 pathB.cubicTo(1,2, 1,0, 3,2);
348 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700349 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000350}
351
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000352static void cubicOp23d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000353 SkPath path, pathB;
354 path.setFillType(SkPath::kWinding_FillType);
355 path.moveTo(0,1);
356 path.cubicTo(1,2, 4,0, 2,1);
357 path.close();
358 pathB.setFillType(SkPath::kWinding_FillType);
359 pathB.moveTo(0,4);
360 pathB.cubicTo(1,2, 1,0, 2,1);
361 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700362 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000363}
364
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000365static void cubicOp24d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000366 SkPath path, pathB;
367 path.setFillType(SkPath::kWinding_FillType);
368 path.moveTo(0,1);
369 path.cubicTo(1,2, 2,0, 3,2);
370 path.close();
371 pathB.setFillType(SkPath::kWinding_FillType);
372 pathB.moveTo(0,2);
373 pathB.cubicTo(2,3, 1,0, 2,1);
374 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700375 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000376}
377
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000378static void testIntersect1(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000379 SkPath one, two;
380 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
381 two.addRect(3, 3, 9, 9, SkPath::kCW_Direction);
caryclark54359292015-03-26 07:52:43 -0700382 testPathOp(reporter, one, two, kIntersect_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000383}
384
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000385static void testUnion1(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000386 SkPath one, two;
387 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
388 two.addRect(3, 3, 9, 9, SkPath::kCW_Direction);
caryclark54359292015-03-26 07:52:43 -0700389 testPathOp(reporter, one, two, kUnion_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000390}
391
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000392static void testDiff1(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000393 SkPath one, two;
394 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
395 two.addRect(3, 3, 9, 9, SkPath::kCW_Direction);
caryclark54359292015-03-26 07:52:43 -0700396 testPathOp(reporter, one, two, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000397}
398
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000399static void testXor1(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000400 SkPath one, two;
401 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
402 two.addRect(3, 3, 9, 9, SkPath::kCW_Direction);
caryclark54359292015-03-26 07:52:43 -0700403 testPathOp(reporter, one, two, kXOR_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000404}
405
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000406static void testIntersect2(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000407 SkPath one, two;
408 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
409 two.addRect(0, 3, 9, 9, SkPath::kCW_Direction);
caryclark54359292015-03-26 07:52:43 -0700410 testPathOp(reporter, one, two, kIntersect_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000411}
412
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000413static void testUnion2(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000414 SkPath one, two;
415 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
416 two.addRect(0, 3, 9, 9, SkPath::kCW_Direction);
caryclark54359292015-03-26 07:52:43 -0700417 testPathOp(reporter, one, two, kUnion_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000418}
419
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000420static void testDiff2(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000421 SkPath one, two;
422 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
423 two.addRect(0, 3, 9, 9, SkPath::kCW_Direction);
caryclark54359292015-03-26 07:52:43 -0700424 testPathOp(reporter, one, two, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000425}
426
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000427static void testXor2(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000428 SkPath one, two;
429 one.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
430 two.addRect(0, 3, 9, 9, SkPath::kCW_Direction);
caryclark54359292015-03-26 07:52:43 -0700431 testPathOp(reporter, one, two, kXOR_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000432}
433
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000434static void testOp1d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000435 SkPath path, pathB;
436 path.setFillType(SkPath::kWinding_FillType);
437 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
438 path.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
439 pathB.setFillType(SkPath::kWinding_FillType);
440 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
441 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
caryclark54359292015-03-26 07:52:43 -0700442 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000443}
444
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000445static void testOp2d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000446 SkPath path, pathB;
447 path.setFillType(SkPath::kWinding_FillType);
448 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
449 path.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
450 pathB.setFillType(SkPath::kEvenOdd_FillType);
451 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
452 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
caryclark54359292015-03-26 07:52:43 -0700453 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000454}
455
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000456static void testOp3d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000457 SkPath path, pathB;
458 path.setFillType(SkPath::kWinding_FillType);
459 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
460 path.addRect(1, 1, 2, 2, SkPath::kCW_Direction);
461 pathB.setFillType(SkPath::kWinding_FillType);
462 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
463 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
caryclark54359292015-03-26 07:52:43 -0700464 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000465}
466
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000467static void testOp1u(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000468 SkPath path, pathB;
469 path.setFillType(SkPath::kWinding_FillType);
470 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
471 path.addRect(0, 0, 3, 3, SkPath::kCW_Direction);
472 pathB.setFillType(SkPath::kWinding_FillType);
473 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
474 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
caryclark54359292015-03-26 07:52:43 -0700475 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000476}
477
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000478static void testOp4d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000479 SkPath path, pathB;
480 path.setFillType(SkPath::kWinding_FillType);
481 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
482 path.addRect(2, 2, 4, 4, SkPath::kCW_Direction);
483 pathB.setFillType(SkPath::kWinding_FillType);
484 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
485 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
caryclark54359292015-03-26 07:52:43 -0700486 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000487}
488
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000489static void testOp5d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000490 SkPath path, pathB;
491 path.setFillType(SkPath::kEvenOdd_FillType);
492 path.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
493 path.addRect(0, 0, 3, 3, SkPath::kCW_Direction);
494 pathB.setFillType(SkPath::kEvenOdd_FillType);
495 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
496 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
caryclark54359292015-03-26 07:52:43 -0700497 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000498}
499
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000500static void testOp6d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000501 SkPath path, pathB;
502 path.setFillType(SkPath::kEvenOdd_FillType);
503 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
504 path.addRect(0, 0, 3, 3, SkPath::kCW_Direction);
505 pathB.setFillType(SkPath::kWinding_FillType);
506 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
507 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
caryclark54359292015-03-26 07:52:43 -0700508 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000509}
510
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000511static void testOp7d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000512 SkPath path, pathB;
513 path.setFillType(SkPath::kEvenOdd_FillType);
514 path.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
515 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
516 pathB.setFillType(SkPath::kEvenOdd_FillType);
517 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
518 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
caryclark54359292015-03-26 07:52:43 -0700519 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000520}
521
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000522static void testOp2u(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000523 SkPath path, pathB;
524 path.setFillType(SkPath::kEvenOdd_FillType);
525 path.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
526 path.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
527 pathB.setFillType(SkPath::kWinding_FillType);
528 pathB.addRect(0, 0, 3, 3, SkPath::kCW_Direction);
529 pathB.addRect(1, 1, 2, 2, SkPath::kCW_Direction);
caryclark54359292015-03-26 07:52:43 -0700530 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000531}
532
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000533static void testOp8d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000534 SkPath path, pathB;
535 path.addRect(0, 0, 640, 480);
536 pathB.moveTo(577330, 1971.72f);
537 pathB.cubicTo(10.7082f, -116.596f, 262.057f, 45.6468f, 294.694f, 1.96237f);
538 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700539 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000540}
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000541static void cubicOp25i(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000542 SkPath path, pathB;
543 path.setFillType(SkPath::kWinding_FillType);
544 path.moveTo(0,1);
545 path.cubicTo(2,4, 5,0, 3,2);
546 path.close();
547 pathB.setFillType(SkPath::kWinding_FillType);
548 pathB.moveTo(0,5);
549 pathB.cubicTo(2,3, 1,0, 4,2);
550 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700551 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000552}
553
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000554static void cubicOp26d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000555 SkPath path, pathB;
556 path.setFillType(SkPath::kWinding_FillType);
557 path.moveTo(0,1);
558 path.cubicTo(3,4, 4,0, 3,2);
559 path.close();
560 pathB.setFillType(SkPath::kWinding_FillType);
561 pathB.moveTo(0,4);
562 pathB.cubicTo(2,3, 1,0, 4,3);
563 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700564 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000565}
566
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000567static void cubicOp27d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000568 SkPath path, pathB;
569 path.setFillType(SkPath::kWinding_FillType);
570 path.moveTo(0,1);
571 path.cubicTo(3,6, 1,0, 5,2);
572 path.close();
573 pathB.setFillType(SkPath::kWinding_FillType);
574 pathB.moveTo(0,1);
575 pathB.cubicTo(2,5, 1,0, 6,3);
576 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700577 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000578}
579
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000580static void cubicOp28u(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000581 SkPath path, pathB;
582 path.setFillType(SkPath::kWinding_FillType);
583 path.moveTo(0,1);
584 path.cubicTo(1,4, 6,0, 3,2);
585 path.close();
586 pathB.setFillType(SkPath::kWinding_FillType);
587 pathB.moveTo(0,6);
588 pathB.cubicTo(2,3, 1,0, 4,1);
589 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700590 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000591}
592
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000593static void cubicOp29d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000594 SkPath path, pathB;
595 path.setFillType(SkPath::kWinding_FillType);
596 path.moveTo(0,1);
597 path.cubicTo(2,5, 6,0, 4,2);
598 path.close();
599 pathB.setFillType(SkPath::kWinding_FillType);
600 pathB.moveTo(0,6);
601 pathB.cubicTo(2,4, 1,0, 5,2);
602 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700603 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000604}
605
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000606static void cubicOp30d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000607 SkPath path, pathB;
608 path.setFillType(SkPath::kWinding_FillType);
609 path.moveTo(0,1);
610 path.cubicTo(2,5, 6,0, 5,3);
611 path.close();
612 pathB.setFillType(SkPath::kWinding_FillType);
613 pathB.moveTo(0,6);
614 pathB.cubicTo(3,5, 1,0, 5,2);
615 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700616 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000617}
618
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000619static void cubicOp31d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000620 SkPath path, pathB;
621 path.setFillType(SkPath::kWinding_FillType);
622 path.moveTo(0,2);
623 path.cubicTo(0,3, 2,1, 4,0);
624 path.close();
625 pathB.setFillType(SkPath::kWinding_FillType);
626 pathB.moveTo(1,2);
627 pathB.cubicTo(0,4, 2,0, 3,0);
628 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700629 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000630}
631
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000632static void cubicOp31u(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000633 SkPath path, pathB;
634 path.setFillType(SkPath::kWinding_FillType);
635 path.moveTo(0,2);
636 path.cubicTo(0,3, 2,1, 4,0);
637 path.close();
638 pathB.setFillType(SkPath::kWinding_FillType);
639 pathB.moveTo(1,2);
640 pathB.cubicTo(0,4, 2,0, 3,0);
641 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700642 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000643}
644
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000645static void cubicOp31x(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000646 SkPath path, pathB;
647 path.setFillType(SkPath::kWinding_FillType);
648 path.moveTo(0,2);
649 path.cubicTo(0,3, 2,1, 4,0);
650 path.close();
651 pathB.setFillType(SkPath::kWinding_FillType);
652 pathB.moveTo(1,2);
653 pathB.cubicTo(0,4, 2,0, 3,0);
654 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700655 testPathOp(reporter, path, pathB, kXOR_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000656}
657
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000658static void cubicOp32d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000659 SkPath path, pathB;
660 path.setFillType(SkPath::kWinding_FillType);
661 path.moveTo(0,1);
662 path.cubicTo(1,2, 6,0, 3,1);
663 path.close();
664 pathB.setFillType(SkPath::kWinding_FillType);
665 pathB.moveTo(0,6);
666 pathB.cubicTo(1,3, 1,0, 2,1);
667 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700668 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000669}
670
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000671static void cubicOp33i(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000672 SkPath path, pathB;
673 path.setFillType(SkPath::kWinding_FillType);
674 path.moveTo(0,1);
675 path.cubicTo(1,2, 6,0, 3,1);
676 path.close();
677 pathB.setFillType(SkPath::kWinding_FillType);
678 pathB.moveTo(0,6);
679 pathB.cubicTo(1,3, 1,0, 2,1);
680 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700681 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000682}
683
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000684static void cubicOp34d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000685 SkPath path, pathB;
686 path.setFillType(SkPath::kWinding_FillType);
687 path.moveTo(0,1);
688 path.cubicTo(3,5, 2,1, 3,1);
689 path.close();
690 pathB.setFillType(SkPath::kWinding_FillType);
691 pathB.moveTo(1,2);
692 pathB.cubicTo(1,3, 1,0, 5,3);
693 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700694 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000695}
696
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000697static void cubicOp35d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000698 SkPath path, pathB;
699 path.setFillType(SkPath::kWinding_FillType);
700 path.moveTo(0,1);
701 path.cubicTo(1,5, 2,1, 4,0);
702 path.close();
703 pathB.setFillType(SkPath::kWinding_FillType);
704 pathB.moveTo(1,2);
705 pathB.cubicTo(0,4, 1,0, 5,1);
706 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700707 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000708}
709
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000710static void cubicOp36u(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000711 SkPath path, pathB;
712 path.setFillType(SkPath::kWinding_FillType);
713 path.moveTo(0,1);
714 path.cubicTo(1,6, 2,0, 5,1);
715 path.close();
716 pathB.setFillType(SkPath::kWinding_FillType);
717 pathB.moveTo(0,2);
718 pathB.cubicTo(1,5, 1,0, 6,1);
719 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700720 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000721}
722
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000723static void cubicOp37d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000724 SkPath path, pathB;
725 path.setFillType(SkPath::kWinding_FillType);
726 path.moveTo(0,1);
727 path.cubicTo(2,6, 6,1, 4,3);
728 path.close();
729 pathB.setFillType(SkPath::kWinding_FillType);
730 pathB.moveTo(1,6);
731 pathB.cubicTo(3,4, 1,0, 6,2);
732 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700733 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000734}
735
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000736static void cubicOp38d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000737 SkPath path, pathB;
738 path.setFillType(SkPath::kWinding_FillType);
739 path.moveTo(0,1);
740 path.cubicTo(0,6, 3,2, 4,1);
741 path.close();
742 pathB.setFillType(SkPath::kWinding_FillType);
743 pathB.moveTo(2,3);
744 pathB.cubicTo(1,4, 1,0, 6,0);
745 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700746 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000747}
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000748
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000749static void cubicOp39d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000750 SkPath path, pathB;
751 path.setFillType(SkPath::kWinding_FillType);
752 path.moveTo(0,1);
753 path.cubicTo(2,3, 5,1, 4,3);
754 path.close();
755 pathB.setFillType(SkPath::kWinding_FillType);
756 pathB.moveTo(1,5);
757 pathB.cubicTo(3,4, 1,0, 3,2);
758 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700759 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000760}
761
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000762static void cubicOp40d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000763 SkPath path, pathB;
764 path.setFillType(SkPath::kWinding_FillType);
765 path.moveTo(0,1);
766 path.cubicTo(1,5, 3,2, 4,2);
767 path.close();
768 pathB.setFillType(SkPath::kWinding_FillType);
769 pathB.moveTo(2,3);
770 pathB.cubicTo(2,4, 1,0, 5,1);
771 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700772 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000773}
774
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000775static void cubicOp41i(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000776 SkPath path, pathB;
777 path.setFillType(SkPath::kWinding_FillType);
778 path.moveTo(0,1);
779 path.cubicTo(2,6, 4,3, 6,4);
780 path.close();
781 pathB.setFillType(SkPath::kWinding_FillType);
782 pathB.moveTo(3,4);
783 pathB.cubicTo(4,6, 1,0, 6,2);
784 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700785 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000786}
787
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000788static void cubicOp42d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000789 SkPath path, pathB;
790 path.setFillType(SkPath::kWinding_FillType);
791 path.moveTo(0,1);
792 path.cubicTo(1,2, 6,5, 5,4);
793 path.close();
794 pathB.setFillType(SkPath::kWinding_FillType);
795 pathB.moveTo(5,6);
796 pathB.cubicTo(4,5, 1,0, 2,1);
797 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700798 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000799}
800
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000801static void cubicOp43d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000802 SkPath path, pathB;
803 path.setFillType(SkPath::kWinding_FillType);
804 path.moveTo(0,2);
805 path.cubicTo(1,2, 4,0, 3,1);
806 path.close();
807 pathB.setFillType(SkPath::kWinding_FillType);
808 pathB.moveTo(0,4);
809 pathB.cubicTo(1,3, 2,0, 2,1);
810 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700811 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000812}
813
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000814static void cubicOp44d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000815 SkPath path, pathB;
816 path.setFillType(SkPath::kWinding_FillType);
817 path.moveTo(0,2);
818 path.cubicTo(3,6, 4,0, 3,2);
819 path.close();
820 pathB.setFillType(SkPath::kWinding_FillType);
821 pathB.moveTo(0,4);
822 pathB.cubicTo(2,3, 2,0, 6,3);
823 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700824 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000825}
826
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000827static void cubicOp45d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000828 SkPath path, pathB;
829 path.setFillType(SkPath::kWinding_FillType);
830 path.moveTo(0,2);
831 path.cubicTo(2,4, 4,0, 3,2);
832 path.close();
833 pathB.setFillType(SkPath::kWinding_FillType);
834 pathB.moveTo(0,4);
835 pathB.cubicTo(2,3, 2,0, 4,2);
836 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700837 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000838}
839
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000840static void cubicOp46d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000841 SkPath path, pathB;
842 path.setFillType(SkPath::kWinding_FillType);
843 path.moveTo(0,2);
844 path.cubicTo(3,5, 5,0, 4,2);
845 path.close();
846 pathB.setFillType(SkPath::kWinding_FillType);
847 pathB.moveTo(0,5);
848 pathB.cubicTo(2,4, 2,0, 5,3);
849 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700850 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000851}
852
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000853static void cubicOp47d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000854 SkPath path, pathB;
855 path.setFillType(SkPath::kWinding_FillType);
856 path.moveTo(0,1);
857 path.cubicTo(1,6, 6,2, 5,4);
858 path.close();
859 pathB.setFillType(SkPath::kWinding_FillType);
860 pathB.moveTo(2,6);
861 pathB.cubicTo(4,5, 1,0, 6,1);
862 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700863 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000864}
865
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000866static void cubicOp48d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000867 SkPath path, pathB;
868 path.setFillType(SkPath::kWinding_FillType);
869 path.moveTo(0,2);
870 path.cubicTo(2,3, 5,1, 3,2);
871 path.close();
872 pathB.setFillType(SkPath::kWinding_FillType);
873 pathB.moveTo(1,5);
874 pathB.cubicTo(2,3, 2,0, 3,2);
875 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700876 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000877}
878
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000879static void cubicOp49d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000880 SkPath path, pathB;
881 path.setFillType(SkPath::kWinding_FillType);
882 path.moveTo(0,2);
883 path.cubicTo(1,5, 3,2, 4,1);
884 path.close();
885 pathB.setFillType(SkPath::kWinding_FillType);
886 pathB.moveTo(2,3);
887 pathB.cubicTo(1,4, 2,0, 5,1);
888 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700889 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000890}
891
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000892static void cubicOp50d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000893 SkPath path, pathB;
894 path.setFillType(SkPath::kWinding_FillType);
895 path.moveTo(0,3);
896 path.cubicTo(1,6, 5,0, 5,1);
897 path.close();
898 pathB.setFillType(SkPath::kWinding_FillType);
899 pathB.moveTo(0,5);
900 pathB.cubicTo(1,5, 3,0, 6,1);
901 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700902 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000903}
904
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000905static void cubicOp51d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000906 SkPath path, pathB;
907 path.setFillType(SkPath::kWinding_FillType);
908 path.moveTo(0,3);
909 path.cubicTo(1,2, 4,1, 6,0);
910 path.close();
911 pathB.setFillType(SkPath::kWinding_FillType);
912 pathB.moveTo(1,4);
913 pathB.cubicTo(0,6, 3,0, 2,1);
914 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700915 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000916}
917
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000918static void cubicOp52d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000919 SkPath path, pathB;
920 path.setFillType(SkPath::kWinding_FillType);
921 path.moveTo(0,2);
922 path.cubicTo(1,2, 5,4, 4,3);
923 path.close();
924 pathB.setFillType(SkPath::kWinding_FillType);
925 pathB.moveTo(4,5);
926 pathB.cubicTo(3,4, 2,0, 2,1);
927 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700928 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000929}
930
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000931static void cubicOp53d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000932 SkPath path, pathB;
933 path.setFillType(SkPath::kWinding_FillType);
934 path.moveTo(0,3);
935 path.cubicTo(1,2, 5,3, 2,1);
936 path.close();
937 pathB.setFillType(SkPath::kWinding_FillType);
938 pathB.moveTo(3,5);
939 pathB.cubicTo(1,2, 3,0, 2,1);
940 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700941 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000942}
943
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000944static void cubicOp54d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000945 SkPath path, pathB;
946 path.setFillType(SkPath::kWinding_FillType);
947 path.moveTo(0,4);
948 path.cubicTo(1,3, 5,4, 4,2);
949 path.close();
950 pathB.setFillType(SkPath::kWinding_FillType);
951 pathB.moveTo(4,5);
952 pathB.cubicTo(2,4, 4,0, 3,1);
953 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700954 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000955}
956
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000957static void cubicOp55d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000958 SkPath path, pathB;
959 path.setFillType(SkPath::kWinding_FillType);
960 path.moveTo(0,5);
961 path.cubicTo(1,3, 3,2, 5,0);
962 path.close();
963 pathB.setFillType(SkPath::kWinding_FillType);
964 pathB.moveTo(2,3);
965 pathB.cubicTo(0,5, 5,0, 3,1);
966 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700967 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000968}
969
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000970static void cubicOp56d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000971 SkPath path, pathB;
972 path.setFillType(SkPath::kWinding_FillType);
973 path.moveTo(0,1);
974 path.cubicTo(2,6, 5,0, 2,1);
975 path.close();
976 pathB.setFillType(SkPath::kWinding_FillType);
977 pathB.moveTo(0,5);
978 pathB.cubicTo(1,2, 1,0, 6,2);
979 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700980 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000981}
982
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000983static void cubicOp57d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000984 SkPath path, pathB;
985 path.setFillType(SkPath::kWinding_FillType);
986 path.moveTo(0,5);
987 path.cubicTo(0,5, 5,4, 6,4);
988 path.close();
989 pathB.setFillType(SkPath::kWinding_FillType);
990 pathB.moveTo(4,5);
991 pathB.cubicTo(4,6, 5,0, 5,0);
992 pathB.close();
caryclark54359292015-03-26 07:52:43 -0700993 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000994}
995
commit-bot@chromium.org4431e772014-04-14 17:08:59 +0000996static void cubicOp58d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +0000997 SkPath path, pathB;
998 path.setFillType(SkPath::kWinding_FillType);
999 path.moveTo(0,5);
1000 path.cubicTo(3,4, 6,5, 5,3);
1001 path.close();
1002 pathB.setFillType(SkPath::kWinding_FillType);
1003 pathB.moveTo(5,6);
1004 pathB.cubicTo(3,5, 5,0, 4,3);
1005 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001006 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001007}
1008
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001009static void cubicOp59d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001010 SkPath path, pathB;
1011 path.setFillType(SkPath::kWinding_FillType);
1012 path.moveTo(0,1);
1013 path.cubicTo(5,6, 4,0, 4,1);
1014 path.close();
1015 pathB.setFillType(SkPath::kWinding_FillType);
1016 pathB.moveTo(0,4);
1017 pathB.cubicTo(1,4, 1,0, 6,5);
1018 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001019 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001020}
1021
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001022static void cubicOp60d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001023 SkPath path, pathB;
1024 path.setFillType(SkPath::kWinding_FillType);
1025 path.moveTo(0,2);
1026 path.cubicTo(4,6, 6,0, 5,2);
1027 path.close();
1028 pathB.setFillType(SkPath::kWinding_FillType);
1029 pathB.moveTo(0,6);
1030 pathB.cubicTo(2,5, 2,0, 6,4);
1031 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001032 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001033}
1034
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001035static void cubicOp61d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001036 SkPath path, pathB;
1037 path.setFillType(SkPath::kWinding_FillType);
1038 path.moveTo(1,2);
1039 path.cubicTo(0,5, 3,2, 6,1);
1040 path.close();
1041 pathB.setFillType(SkPath::kWinding_FillType);
1042 pathB.moveTo(2,3);
1043 pathB.cubicTo(1,6, 2,1, 5,0);
1044 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001045 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001046}
1047
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001048static void cubicOp62d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001049 SkPath path, pathB;
1050 path.setFillType(SkPath::kWinding_FillType);
1051 path.moveTo(1,3);
1052 path.cubicTo(5,6, 5,3, 5,4);
1053 path.close();
1054 pathB.setFillType(SkPath::kWinding_FillType);
1055 pathB.moveTo(3,5);
1056 pathB.cubicTo(4,5, 3,1, 6,5);
1057 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001058 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001059}
1060
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001061static void cubicOp63d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001062 SkPath path, pathB;
1063 path.setFillType(SkPath::kWinding_FillType);
1064 path.moveTo(2,3);
1065 path.cubicTo(0,4, 3,2, 5,3);
1066 path.close();
1067 pathB.setFillType(SkPath::kWinding_FillType);
1068 pathB.moveTo(2,3);
1069 pathB.cubicTo(3,5, 3,2, 4,0);
1070 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001071 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001072}
1073
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001074static void cubicOp64d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001075 SkPath path, pathB;
1076 path.moveTo(0,1);
1077 path.cubicTo(0,1, 1,0, 3,0);
1078 path.lineTo(0,1);
1079 path.close();
1080 pathB.moveTo(0,1);
1081 pathB.cubicTo(0,3, 1,0, 1,0);
1082 pathB.lineTo(0,1);
1083 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001084 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001085}
1086
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001087static void cubicOp65d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001088 SkPath path, pathB;
1089 path.moveTo(0,1);
1090 path.cubicTo(1,5, 1,0, 1,0);
1091 path.lineTo(0,1);
1092 path.close();
1093 pathB.moveTo(0,1);
1094 pathB.cubicTo(0,1, 1,0, 5,1);
1095 pathB.lineTo(0,1);
1096 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001097 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001098}
1099
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001100static void rectOp1d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001101 SkPath path, pathB;
1102 path.moveTo(0,1);
1103 path.cubicTo(0,1, 1,0, 3,0);
1104 path.lineTo(0,1);
1105 path.close();
1106 pathB.moveTo(0,1);
1107 pathB.cubicTo(0,3, 1,0, 1,0);
1108 pathB.lineTo(0,1);
1109 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001110 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com818b0cc2013-04-08 11:50:46 +00001111}
1112
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001113static void cubicOp66u(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.comb3f09212013-04-17 15:49:16 +00001114 SkPath path, pathB;
1115 path.setFillType(SkPath::kWinding_FillType);
1116 path.moveTo(0,1);
1117 path.cubicTo(2,6, 4,2, 5,3);
1118 path.close();
1119 pathB.setFillType(SkPath::kWinding_FillType);
1120 pathB.moveTo(2,4);
1121 pathB.cubicTo(3,5, 1,0, 6,2);
1122 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001123 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
caryclark@google.comb3f09212013-04-17 15:49:16 +00001124}
1125
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001126static void cubicOp67u(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.comb3f09212013-04-17 15:49:16 +00001127 SkPath path, pathB;
1128 path.moveTo(3,5);
1129 path.cubicTo(1,6, 5,0, 3,1);
1130 path.lineTo(3,5);
1131 path.close();
1132 pathB.moveTo(0,5);
1133 pathB.cubicTo(1,3, 5,3, 6,1);
1134 pathB.lineTo(0,5);
1135 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001136 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
caryclark@google.comb3f09212013-04-17 15:49:16 +00001137}
1138
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001139static void cubicOp68u(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com03610322013-04-18 15:58:21 +00001140 SkPath path, pathB;
1141 path.moveTo(0,5);
1142 path.cubicTo(4,5, 4,1, 5,0);
1143 path.close();
1144 pathB.moveTo(1,4);
1145 pathB.cubicTo(0,5, 5,0, 5,4);
1146 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001147 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
caryclark@google.com03610322013-04-18 15:58:21 +00001148}
1149
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001150static void cubicOp69d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com03610322013-04-18 15:58:21 +00001151 SkPath path, pathB;
1152 path.moveTo(1,3);
1153 path.cubicTo(0,1, 3,1, 2,0);
1154 path.close();
1155 pathB.moveTo(1,3);
1156 pathB.cubicTo(0,2, 3,1, 1,0);
1157 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001158 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com03610322013-04-18 15:58:21 +00001159}
1160
caryclark@google.com6dc7df62013-04-25 11:51:54 +00001161SkPathOp ops[] = {
caryclark54359292015-03-26 07:52:43 -07001162 kUnion_SkPathOp,
1163 kXOR_SkPathOp,
1164 kReverseDifference_SkPathOp,
1165 kXOR_SkPathOp,
1166 kReverseDifference_SkPathOp,
caryclark@google.com6dc7df62013-04-25 11:51:54 +00001167};
1168
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001169static void rRect1(skiatest::Reporter* reporter, const char* filename) {
commit-bot@chromium.org4b413c82013-11-25 19:44:07 +00001170 SkScalar xA = 0.65f;
1171 SkScalar xB = 10.65f;
1172 SkScalar xC = 20.65f;
1173 SkScalar xD = 30.65f;
1174 SkScalar xE = 40.65f;
1175 SkScalar xF = 50.65f;
caryclark@google.com6dc7df62013-04-25 11:51:54 +00001176
commit-bot@chromium.org4b413c82013-11-25 19:44:07 +00001177 SkScalar yA = 0.65f;
1178 SkScalar yB = 10.65f;
1179 SkScalar yC = 20.65f;
1180 SkScalar yD = 30.65f;
1181 SkScalar yE = 40.65f;
1182 SkScalar yF = 50.65f;
caryclark@google.coma5e55922013-05-07 18:51:31 +00001183 SkPath paths[5];
1184 SkRect rects[5];
1185 rects[0].set(xB, yB, xE, yE);
1186 paths[0].addRoundRect(rects[0], SkIntToScalar(5), SkIntToScalar(5)); // red
1187 rects[1].set(xA, yA, xD, yD);
1188 paths[1].addRoundRect(rects[1], SkIntToScalar(5), SkIntToScalar(5)); // green
1189 rects[2].set(xC, yA, xF, yD);
1190 paths[2].addRoundRect(rects[2], SkIntToScalar(5), SkIntToScalar(5)); // blue
1191 rects[3].set(xA, yC, xD, yF);
1192 paths[3].addRoundRect(rects[3], SkIntToScalar(5), SkIntToScalar(5)); // yellow
1193 rects[4].set(xC, yC, xF, yF);
1194 paths[4].addRoundRect(rects[4], SkIntToScalar(5), SkIntToScalar(5)); // cyan
1195 SkPath path;
1196 path.setFillType(SkPath::kInverseEvenOdd_FillType);
1197 for (int index = 0; index < 5; ++index) {
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001198 testPathOp(reporter, path, paths[index], ops[index], filename);
caryclark@google.coma5e55922013-05-07 18:51:31 +00001199 Op(path, paths[index], ops[index], &path);
1200 }
1201}
1202
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001203static void skp1(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.coma5e55922013-05-07 18:51:31 +00001204 SkPath path;
1205 path.setFillType(SkPath::kEvenOdd_FillType);
1206 path.moveTo(189,7);
1207 path.cubicTo(189,5.34314585f, 190.34314f,4, 192,4);
1208 path.lineTo(243,4);
1209 path.cubicTo(244.65686f,4, 246,5.34314585f, 246,7);
1210 path.lineTo(246,21);
1211 path.cubicTo(246,22.6568546f, 244.65686f,24, 243,24);
1212 path.lineTo(192,24);
1213 path.cubicTo(190.34314f,24, 189,22.6568546f, 189,21);
1214 path.lineTo(189,7);
1215 path.close();
1216 path.moveTo(191,8);
1217 path.cubicTo(191,6.89543009f, 191.895432f,6, 193,6);
1218 path.lineTo(242,6);
1219 path.cubicTo(243.104568f,6, 244,6.89543009f, 244,8);
1220 path.lineTo(244,20);
1221 path.cubicTo(244,21.1045704f, 243.104568f,22, 242,22);
1222 path.lineTo(193,22);
1223 path.cubicTo(191.895432f,22, 191,21.1045704f, 191,20);
1224 path.lineTo(191,8);
1225 path.close();
1226 SkPath pathB;
1227 pathB.setFillType(SkPath::kWinding_FillType);
1228 pathB.moveTo(189,4);
1229 pathB.lineTo(199,14);
1230 pathB.lineTo(236,14);
1231 pathB.lineTo(246,4);
1232 pathB.lineTo(189,4);
1233 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001234 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.coma5e55922013-05-07 18:51:31 +00001235}
1236
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001237static void skp2(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.coma5e55922013-05-07 18:51:31 +00001238 SkPath path;
1239 path.setFillType(SkPath::kEvenOdd_FillType);
1240 path.moveTo(253.000000f, 11757.0000f);
1241 path.lineTo(253.000000f, 222.000000f);
1242 path.lineTo(823.000000f, 222.000000f);
1243 path.lineTo(823.000000f, 11757.0000f);
1244 path.lineTo(253.000000f, 11757.0000f);
1245 path.close();
1246 SkPath pathB;
1247 pathB.setFillType(SkPath::kWinding_FillType);
1248 pathB.moveTo(258.000000f, 1028.00000f);
1249 pathB.lineTo(258.000000f, 1027.00000f);
1250 pathB.lineTo(823.000000f, 1027.00000f);
1251 pathB.lineTo(823.000000f, 1028.00000f);
1252 pathB.lineTo(258.000000f, 1028.00000f);
1253 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001254 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.coma5e55922013-05-07 18:51:31 +00001255}
1256
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001257static void skp3(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.coma5e55922013-05-07 18:51:31 +00001258 SkPath path;
1259 path.setFillType(SkPath::kEvenOdd_FillType);
1260 path.moveTo(717.000000f, 507.000000f);
1261 path.lineTo(717.000000f, 425.000000f);
1262 path.lineTo(973.000000f, 425.000000f);
1263 path.lineTo(973.000000f, 507.000000f);
1264 path.quadTo(973.000000f, 508.242645f, 972.121582f, 509.121613f);
1265 path.quadTo(971.242615f, 510.000000f, 970.000000f, 510.000000f);
1266 path.lineTo(720.000000f, 510.000000f);
1267 path.quadTo(718.757385f, 510.000000f, 717.878418f, 509.121613f);
1268 path.quadTo(717.000000f, 508.242645f, 717.000000f, 507.000000f);
1269 path.close();
1270 path.moveTo(719.000000f, 426.000000f);
1271 path.lineTo(971.000000f, 426.000000f);
1272 path.lineTo(971.000000f, 506.000000f);
1273 path.cubicTo(971.000000f, 507.104584f, 970.104553f, 508.000000f, 969.000000f, 508.000000f);
1274 path.lineTo(721.000000f, 508.000000f);
1275 path.cubicTo(719.895447f, 508.000000f, 719.000000f, 507.104584f, 719.000000f, 506.000000f);
1276 path.lineTo(719.000000f, 426.000000f);
1277 path.close();
1278 SkPath pathB;
1279 pathB.setFillType(SkPath::kWinding_FillType);
1280 pathB.moveTo(717.000000f, 510.000000f);
1281 pathB.lineTo(760.000000f, 467.000000f);
1282 pathB.lineTo(930.000000f, 467.000000f);
1283 pathB.lineTo(973.000000f, 510.000000f);
1284 pathB.lineTo(717.000000f, 510.000000f);
1285 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001286 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.coma5e55922013-05-07 18:51:31 +00001287}
1288
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001289static void skp4(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.coma5e55922013-05-07 18:51:31 +00001290 SkPath path;
1291 path.setFillType(SkPath::kEvenOdd_FillType);
1292 path.moveTo(230.756805f, 591.756775f);
1293 path.quadTo(232.514725f, 590.000000f, 235.000000f, 590.000000f);
1294 path.lineTo(300.000000f, 590.000000f);
1295 path.quadTo(302.485291f, 590.000000f, 304.243195f, 591.756775f);
1296 path.quadTo(306.000000f, 593.514709f, 306.000000f, 596.000000f);
1297 path.lineTo(306.000000f, 617.000000f);
1298 path.lineTo(229.000000f, 617.000000f);
1299 path.lineTo(229.000000f, 596.000000f);
1300 path.quadTo(229.000000f, 593.514709f, 230.756805f, 591.756775f);
1301 path.close();
1302 path.moveTo(231.000000f, 597.000000f);
1303 path.cubicTo(231.000000f, 594.238586f, 233.238571f, 592.000000f, 236.000000f, 592.000000f);
1304 path.lineTo(299.000000f, 592.000000f);
1305 path.cubicTo(301.761414f, 592.000000f, 304.000000f, 594.238586f, 304.000000f, 597.000000f);
1306 path.lineTo(304.000000f, 616.000000f);
1307 path.lineTo(231.000000f, 616.000000f);
1308 path.lineTo(231.000000f, 597.000000f);
1309 path.close();
1310 SkPath pathB;
1311 pathB.setFillType(SkPath::kWinding_FillType);
1312 pathB.moveTo(306.000000f, 590.000000f);
1313 pathB.lineTo(292.000000f, 604.000000f);
1314 pathB.lineTo(305.000000f, 617.000000f);
1315 pathB.lineTo(306.000000f, 617.000000f);
1316 pathB.lineTo(306.000000f, 590.000000f);
1317 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001318 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.coma5e55922013-05-07 18:51:31 +00001319}
1320
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001321static void skp5(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.coma5e55922013-05-07 18:51:31 +00001322 SkPath path;
1323 path.setFillType(SkPath::kEvenOdd_FillType);
1324 path.moveTo(18.0000000f, 226.000000f);
1325 path.quadTo(14.6862917f, 226.000000f, 12.3423996f, 228.342407f);
1326 path.quadTo(10.0000000f, 230.686295f, 10.0000000f, 234.000000f);
1327 path.lineTo(10.0000000f, 253.000000f);
1328 path.lineTo(1247.00000f, 253.000000f);
1329 path.lineTo(1247.00000f, 234.000000f);
1330 path.quadTo(1247.00000f, 230.686295f, 1244.65759f, 228.342407f);
1331 path.quadTo(1242.31372f, 226.000000f, 1239.00000f, 226.000000f);
1332 path.lineTo(18.0000000f, 226.000000f);
1333 path.close();
1334 SkPath pathB;
1335 pathB.setFillType(SkPath::kInverseWinding_FillType);
1336 pathB.moveTo(18.0000000f, 226.000000f);
1337 pathB.lineTo(1239.00000f, 226.000000f);
1338 pathB.cubicTo(1243.41833f, 226.000000f, 1247.00000f, 229.581726f, 1247.00000f, 234.000000f);
1339 pathB.lineTo(1247.00000f, 252.000000f);
1340 pathB.lineTo(10.0000000f, 252.000000f);
1341 pathB.lineTo(10.0000000f, 234.000000f);
1342 pathB.cubicTo(10.0000000f, 229.581726f, 13.5817204f, 226.000000f, 18.0000000f, 226.000000f);
1343 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001344 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.coma5e55922013-05-07 18:51:31 +00001345}
1346
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001347static void cubicOp70d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.coma5e55922013-05-07 18:51:31 +00001348 SkPath path, pathB;
1349 path.setFillType(SkPath::kWinding_FillType);
1350 path.moveTo(0,1);
1351 path.cubicTo(0,5, 4,0, 5,0);
1352 path.close();
1353 pathB.setFillType(SkPath::kWinding_FillType);
1354 pathB.moveTo(0,4);
1355 pathB.cubicTo(0,5, 1,0, 5,0);
1356 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001357 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com6dc7df62013-04-25 11:51:54 +00001358}
1359
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001360static void cubicOp71d(skiatest::Reporter* reporter, const char* filename) {
reed@google.com277c3f82013-05-31 15:17:50 +00001361 SkPath path, pathB;
1362 path.setFillType(SkPath::kWinding_FillType);
1363 path.moveTo(0,1);
1364 path.cubicTo(0,5, 4,1, 6,4);
1365 path.close();
1366 pathB.setFillType(SkPath::kWinding_FillType);
1367 pathB.moveTo(1,4);
1368 pathB.cubicTo(4,6, 1,0, 5,0);
1369 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001370 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
reed@google.com277c3f82013-05-31 15:17:50 +00001371}
1372
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001373static void cubicOp72i(skiatest::Reporter* reporter, const char* filename) {
reed@google.com277c3f82013-05-31 15:17:50 +00001374 SkPath path, pathB;
1375 path.setFillType(SkPath::kWinding_FillType);
1376 path.moveTo(0,1);
1377 path.cubicTo(0,5, 5,2, 5,4);
1378 path.close();
1379 pathB.setFillType(SkPath::kWinding_FillType);
1380 pathB.moveTo(2,5);
1381 pathB.cubicTo(4,5, 1,0, 5,0);
1382 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001383 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
reed@google.com277c3f82013-05-31 15:17:50 +00001384}
1385
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001386static void cubicOp73d(skiatest::Reporter* reporter, const char* filename) {
reed@google.com277c3f82013-05-31 15:17:50 +00001387 SkPath path, pathB;
1388 path.setFillType(SkPath::kWinding_FillType);
1389 path.moveTo(0,1);
1390 path.cubicTo(3,4, 4,0, 6,4);
1391 path.lineTo(0,1);
1392 path.close();
1393 pathB.setFillType(SkPath::kWinding_FillType);
1394 pathB.moveTo(0,4);
1395 pathB.cubicTo(4,6, 1,0, 4,3);
1396 pathB.lineTo(0,4);
1397 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001398 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
reed@google.com277c3f82013-05-31 15:17:50 +00001399}
1400
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001401static void cubicOp74d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001402 SkPath path, pathB;
1403 path.setFillType(SkPath::kWinding_FillType);
1404 path.moveTo(0,1);
1405 path.cubicTo(1,5, 5,1, 5,1);
1406 path.lineTo(0,1);
1407 path.close();
1408 pathB.setFillType(SkPath::kWinding_FillType);
1409 pathB.moveTo(1,5);
1410 pathB.cubicTo(1,5, 1,0, 5,1);
1411 pathB.lineTo(1,5);
1412 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001413 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001414}
1415
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001416static void cubicOp75d(skiatest::Reporter* reporter, const char* filename) {
reed@google.com277c3f82013-05-31 15:17:50 +00001417 SkPath path, pathB;
1418 path.setFillType(SkPath::kWinding_FillType);
1419 path.moveTo(0,1);
1420 path.cubicTo(0,4, 5,1, 6,4);
1421 path.lineTo(0,1);
1422 path.close();
1423 pathB.setFillType(SkPath::kWinding_FillType);
1424 pathB.moveTo(1,5);
1425 pathB.cubicTo(4,6, 1,0, 4,0);
1426 pathB.lineTo(1,5);
1427 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001428 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
reed@google.com277c3f82013-05-31 15:17:50 +00001429}
1430
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001431static void cubicOp76u(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001432 SkPath path, pathB;
1433 path.setFillType(SkPath::kWinding_FillType);
1434 path.moveTo(0,1);
1435 path.cubicTo(0,2, 2,0, 5,3);
1436 path.close();
1437 pathB.setFillType(SkPath::kWinding_FillType);
1438 pathB.moveTo(0,2);
1439 pathB.cubicTo(3,5, 1,0, 2,0);
1440 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001441 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001442}
1443
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001444static void cubicOp77i(skiatest::Reporter* reporter, const char* filename) {
reed@google.com277c3f82013-05-31 15:17:50 +00001445 SkPath path, pathB;
1446 path.setFillType(SkPath::kEvenOdd_FillType);
1447 path.moveTo(0,1);
1448 path.cubicTo(1,3, 2,0, 3,2);
1449 path.lineTo(0,1);
1450 path.close();
1451 pathB.setFillType(SkPath::kEvenOdd_FillType);
1452 pathB.moveTo(0,2);
1453 pathB.cubicTo(2,3, 1,0, 3,1);
1454 pathB.lineTo(0,2);
1455 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001456 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
reed@google.com277c3f82013-05-31 15:17:50 +00001457}
1458
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001459static void cubicOp78u(skiatest::Reporter* reporter, const char* filename) {
reed@google.com277c3f82013-05-31 15:17:50 +00001460 SkPath path, pathB;
1461 path.setFillType(SkPath::kEvenOdd_FillType);
1462 path.moveTo(1,6);
1463 path.cubicTo(1,6, 5,0, 6,1);
1464 path.lineTo(1,6);
1465 path.close();
1466 pathB.setFillType(SkPath::kEvenOdd_FillType);
1467 pathB.moveTo(0,5);
1468 pathB.cubicTo(1,6, 6,1, 6,1);
1469 pathB.lineTo(0,5);
1470 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001471 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
reed@google.com277c3f82013-05-31 15:17:50 +00001472}
1473
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001474static void cubicOp79u(skiatest::Reporter* reporter, const char* filename) {
reed@google.com277c3f82013-05-31 15:17:50 +00001475 SkPath path, pathB;
1476 path.setFillType(SkPath::kWinding_FillType);
1477 path.moveTo(0,1);
1478 path.cubicTo(1,3, 1,0, 6,4);
1479 path.close();
1480 pathB.setFillType(SkPath::kWinding_FillType);
1481 pathB.moveTo(0,1);
1482 pathB.cubicTo(4,6, 1,0, 3,1);
1483 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001484 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
reed@google.com277c3f82013-05-31 15:17:50 +00001485}
1486
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001487static void cubicOp80i(skiatest::Reporter* reporter, const char* filename) {
reed@google.com277c3f82013-05-31 15:17:50 +00001488 SkPath path, pathB;
1489 path.setFillType(SkPath::kWinding_FillType);
1490 path.moveTo(0,1);
1491 path.cubicTo(2,3, 2,1, 4,3);
1492 path.lineTo(0,1);
1493 path.close();
1494 pathB.setFillType(SkPath::kWinding_FillType);
1495 pathB.moveTo(1,2);
1496 pathB.cubicTo(3,4, 1,0, 3,2);
1497 pathB.lineTo(1,2);
1498 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001499 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
reed@google.com277c3f82013-05-31 15:17:50 +00001500}
1501
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001502static void cubicOp81d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001503 SkPath path, pathB;
1504 path.setFillType(SkPath::kWinding_FillType);
1505 path.moveTo(0,1);
1506 path.cubicTo(4,6, 4,3, 5,4);
1507 path.close();
1508 pathB.setFillType(SkPath::kWinding_FillType);
1509 pathB.moveTo(3,4);
1510 pathB.cubicTo(4,5, 1,0, 6,4);
1511 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001512 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001513}
1514
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001515static void cubicOp82i(skiatest::Reporter* reporter, const char* filename) {
reed@google.com277c3f82013-05-31 15:17:50 +00001516 SkPath path, pathB;
1517 path.setFillType(SkPath::kEvenOdd_FillType);
1518 path.moveTo(0,1);
1519 path.cubicTo(2,3, 5,2, 3,0);
1520 path.lineTo(0,1);
1521 path.close();
1522 pathB.setFillType(SkPath::kWinding_FillType);
1523 pathB.moveTo(2,5);
1524 pathB.cubicTo(0,3, 1,0, 3,2);
1525 pathB.lineTo(2,5);
1526 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001527 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
reed@google.com277c3f82013-05-31 15:17:50 +00001528}
1529
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001530static void cubicOp83i(skiatest::Reporter* reporter, const char* filename) {
reed@google.com277c3f82013-05-31 15:17:50 +00001531 SkPath path, pathB;
1532 path.setFillType(SkPath::kWinding_FillType);
1533 path.moveTo(0,1);
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001534 path.cubicTo(0,3, 2,1, 4,1);
1535 path.lineTo(0,1);
reed@google.com277c3f82013-05-31 15:17:50 +00001536 path.close();
1537 pathB.setFillType(SkPath::kWinding_FillType);
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001538 pathB.moveTo(1,2);
1539 pathB.cubicTo(1,4, 1,0, 3,0);
1540 pathB.lineTo(1,2);
1541 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001542 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001543}
1544
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001545static void cubicOp84d(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001546 SkPath path, pathB;
1547 path.setFillType(SkPath::kWinding_FillType);
1548 path.moveTo(0,4);
1549 path.cubicTo(2,3, 6,3, 3,2);
1550 path.close();
1551 pathB.setFillType(SkPath::kWinding_FillType);
1552 pathB.moveTo(3,6);
1553 pathB.cubicTo(2,3, 4,0, 3,2);
reed@google.com277c3f82013-05-31 15:17:50 +00001554 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001555 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
reed@google.com277c3f82013-05-31 15:17:50 +00001556}
1557
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001558static void skpClip1(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001559 SkPath path;
1560 path.setFillType(SkPath::kEvenOdd_FillType);
1561 path.moveTo(1126.17114f, 877.171204f);
1562 path.quadTo(1127.34314f, 876.000000f, 1129.00000f, 876.000000f);
1563 path.lineTo(1243.00000f, 876.000000f);
1564 path.quadTo(1244.65686f, 876.000000f, 1245.82886f, 877.171204f);
1565 path.quadTo(1247.00000f, 878.343140f, 1247.00000f, 880.000000f);
1566 path.lineTo(1247.00000f, 907.000000f);
1567 path.lineTo(1246.00000f, 907.000000f);
1568 path.lineTo(1246.00000f, 880.000000f);
1569 path.cubicTo(1246.00000f, 878.343140f, 1244.65686f, 877.000000f, 1243.00000f, 877.000000f);
1570 path.lineTo(1129.00000f, 877.000000f);
1571 path.cubicTo(1127.34314f, 877.000000f, 1126.00000f, 878.343140f, 1126.00000f, 880.000000f);
1572 path.lineTo(1126.00000f, 907.000000f);
1573 path.lineTo(1125.00000f, 907.000000f);
1574 path.lineTo(1125.00000f, 880.000000f);
1575 path.quadTo(1125.00000f, 878.343140f, 1126.17114f, 877.171204f);
1576 path.close();
1577 SkPath pathB;
1578 pathB.setFillType(SkPath::kWinding_FillType);
1579 pathB.moveTo(1247.00000f, 876.000000f);
1580 pathB.lineTo(1231.00000f, 892.000000f);
1581 pathB.lineTo(1246.00000f, 907.000000f);
1582 pathB.lineTo(1247.00000f, 907.000000f);
1583 pathB.lineTo(1247.00000f, 876.000000f);
1584 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001585 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001586}
1587
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001588static void skpClip2(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001589 SkPath path;
1590 path.setFillType(SkPath::kEvenOdd_FillType);
1591 path.moveTo(134.000000f, 11414.0000f);
1592 path.cubicTo(131.990234f, 11414.0000f, 130.326660f, 11415.4824f, 130.042755f, 11417.4131f);
1593 path.cubicTo(130.233124f, 11418.3193f, 131.037079f, 11419.0000f, 132.000000f, 11419.0000f);
1594 path.lineTo(806.000000f, 11419.0000f);
1595 path.cubicTo(806.962891f, 11419.0000f, 807.766907f, 11418.3193f, 807.957275f, 11417.4131f);
1596 path.cubicTo(807.673401f, 11415.4824f, 806.009766f, 11414.0000f, 804.000000f, 11414.0000f);
1597 path.lineTo(134.000000f, 11414.0000f);
1598 path.close();
1599 SkPath pathB;
1600 pathB.setFillType(SkPath::kInverseWinding_FillType);
1601 pathB.moveTo(132.000000f, 11415.0000f);
1602 pathB.lineTo(806.000000f, 11415.0000f);
1603 pathB.cubicTo(807.104553f, 11415.0000f, 808.000000f, 11415.4473f, 808.000000f, 11416.0000f);
1604 pathB.lineTo(808.000000f, 11417.0000f);
1605 pathB.cubicTo(808.000000f, 11418.1045f, 807.104553f, 11419.0000f, 806.000000f, 11419.0000f);
1606 pathB.lineTo(132.000000f, 11419.0000f);
1607 pathB.cubicTo(130.895432f, 11419.0000f, 130.000000f, 11418.1045f, 130.000000f, 11417.0000f);
1608 pathB.lineTo(130.000000f, 11416.0000f);
1609 pathB.cubicTo(130.000000f, 11415.4473f, 130.895432f, 11415.0000f, 132.000000f, 11415.0000f);
1610 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001611 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001612}
caryclark@google.com07e97fc2013-07-08 17:17:02 +00001613
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001614static void skp96prezzi1(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com07e97fc2013-07-08 17:17:02 +00001615 SkPath path;
1616 path.setFillType(SkPath::kEvenOdd_FillType);
1617 path.moveTo(157.464005f, 670.463989f);
1618 path.quadTo(158.928925f, 669.000000f, 161.000000f, 669.000000f);
1619 path.lineTo(248.000000f, 669.000000f);
1620 path.quadTo(250.071075f, 669.000000f, 251.535995f, 670.463989f);
1621 path.quadTo(253.000000f, 671.928955f, 253.000000f, 674.000000f);
1622 path.lineTo(253.000000f, 706.000000f);
1623 path.lineTo(251.000000f, 706.000000f);
1624 path.lineTo(251.000000f, 675.000000f);
1625 path.cubicTo(251.000000f, 672.790833f, 249.209137f, 671.000000f, 247.000000f, 671.000000f);
1626 path.lineTo(162.000000f, 671.000000f);
1627 path.cubicTo(159.790863f, 671.000000f, 158.000000f, 672.790833f, 158.000000f, 675.000000f);
1628 path.lineTo(158.000000f, 706.000000f);
1629 path.lineTo(156.000000f, 706.000000f);
1630 path.lineTo(156.000000f, 674.000000f);
1631 path.quadTo(156.000000f, 671.928955f, 157.464005f, 670.463989f);
1632 path.close();
1633 SkPath pathB;
1634 pathB.setFillType(SkPath::kWinding_FillType);
1635 pathB.moveTo(156.000000f, 669.000000f);
1636 pathB.lineTo(178.500000f, 691.500000f);
1637 pathB.lineTo(230.500000f, 691.500000f);
1638 pathB.lineTo(253.000000f, 669.000000f);
1639 pathB.lineTo(156.000000f, 669.000000f);
1640 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001641 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com07e97fc2013-07-08 17:17:02 +00001642}
1643
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001644static void skpancestry_com1(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com07e97fc2013-07-08 17:17:02 +00001645 SkPath path;
1646 path.setFillType(SkPath::kEvenOdd_FillType);
1647 path.moveTo(161.000000f, 925.000000f);
1648 path.cubicTo(159.874390f, 925.000000f, 158.835663f, 925.371948f, 158.000000f, 925.999634f);
1649 path.lineTo(158.000000f, 926.000000f);
1650 path.lineTo(1108.00000f, 926.000000f);
1651 path.lineTo(1108.00000f, 925.999634f);
1652 path.cubicTo(1107.16443f, 925.371948f, 1106.12561f, 925.000000f, 1105.00000f, 925.000000f);
1653 path.lineTo(161.000000f, 925.000000f);
1654 path.close();
1655 SkPath pathB;
1656 pathB.setFillType(SkPath::kEvenOdd_FillType);
1657 pathB.moveTo(161.000000f, 926.000000f);
1658 pathB.lineTo(1105.00000f, 926.000000f);
1659 pathB.cubicTo(1107.20911f, 926.000000f, 1109.00000f, 927.790833f, 1109.00000f, 930.000000f);
1660 pathB.lineTo(1109.00000f, 956.000000f);
1661 pathB.cubicTo(1109.00000f, 958.209167f, 1107.20911f, 960.000000f, 1105.00000f, 960.000000f);
1662 pathB.lineTo(161.000000f, 960.000000f);
1663 pathB.cubicTo(158.790863f, 960.000000f, 157.000000f, 958.209167f, 157.000000f, 956.000000f);
1664 pathB.lineTo(157.000000f, 930.000000f);
1665 pathB.cubicTo(157.000000f, 927.790833f, 158.790863f, 926.000000f, 161.000000f, 926.000000f);
1666 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001667 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com07e97fc2013-07-08 17:17:02 +00001668}
1669
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001670static void skpeldorado_com_ua1(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com07e97fc2013-07-08 17:17:02 +00001671 SkPath path;
1672 path.setFillType(SkPath::kEvenOdd_FillType);
1673 path.moveTo(286.695129f, 291.000000f);
1674 path.lineTo(229.304855f, 561.000000f);
1675 path.lineTo(979.304871f, 561.000000f);
1676 path.lineTo(1036.69507f, 291.000000f);
1677 path.lineTo(286.695129f, 291.000000f);
1678 path.close();
1679 SkPath pathB;
1680 pathB.setFillType(SkPath::kWinding_FillType);
1681 pathB.moveTo(1006.69513f, 291.000000f);
1682 pathB.cubicTo(1023.26367f, 291.000000f, 1033.84021f, 304.431458f, 1030.31836f, 321.000000f);
1683 pathB.lineTo(985.681519f, 531.000000f);
1684 pathB.cubicTo(982.159790f, 547.568542f, 965.873413f, 561.000000f, 949.304871f, 561.000000f);
1685 pathB.lineTo(259.304871f, 561.000000f);
1686 pathB.cubicTo(242.736313f, 561.000000f, 232.159805f, 547.568542f, 235.681549f, 531.000000f);
1687 pathB.lineTo(280.318420f, 321.000000f);
1688 pathB.cubicTo(283.840179f, 304.431458f, 300.126587f, 291.000000f, 316.695129f, 291.000000f);
1689 pathB.lineTo(1006.69513f, 291.000000f);
1690 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001691 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com07e97fc2013-07-08 17:17:02 +00001692}
1693
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001694static void skpbyte_com1(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com07e97fc2013-07-08 17:17:02 +00001695 SkPath path;
1696 path.setFillType(SkPath::kEvenOdd_FillType);
1697 path.moveTo(968.000000f, 14.0000000f);
1698 path.cubicTo(965.238586f, 14.0000000f, 963.000000f, 16.2385769f, 963.000000f, 19.0000000f);
1699 path.lineTo(963.000000f, 32.0000000f);
1700 path.cubicTo(963.000000f, 34.7614250f, 965.238586f, 37.0000000f, 968.000000f, 37.0000000f);
1701 path.lineTo(1034.00000f, 37.0000000f);
1702 path.cubicTo(1036.76147f, 37.0000000f, 1039.00000f, 34.7614250f, 1039.00000f, 32.0000000f);
1703 path.lineTo(1039.00000f, 19.0000000f);
1704 path.cubicTo(1039.00000f, 16.2385769f, 1036.76147f, 14.0000000f, 1034.00000f, 14.0000000f);
1705 path.lineTo(968.000000f, 14.0000000f);
1706 path.close();
1707 SkPath pathB;
1708 pathB.setFillType(SkPath::kInverseWinding_FillType);
1709 pathB.moveTo(968.000000f, 14.0000000f);
1710 pathB.lineTo(1034.00000f, 14.0000000f);
1711 pathB.cubicTo(1036.76147f, 14.0000000f, 1039.00000f, 16.2385750f, 1039.00000f, 19.0000000f);
1712 pathB.lineTo(1039.00000f, 32.0000000f);
1713 pathB.cubicTo(1039.00000f, 34.2091408f, 1036.76147f, 36.0000000f, 1034.00000f, 36.0000000f);
1714 pathB.lineTo(968.000000f, 36.0000000f);
1715 pathB.cubicTo(965.238586f, 36.0000000f, 963.000000f, 34.2091408f, 963.000000f, 32.0000000f);
1716 pathB.lineTo(963.000000f, 19.0000000f);
1717 pathB.cubicTo(963.000000f, 16.2385750f, 965.238586f, 14.0000000f, 968.000000f, 14.0000000f);
1718 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001719 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com07e97fc2013-07-08 17:17:02 +00001720}
1721
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001722static void skphealth_com76(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com07e97fc2013-07-08 17:17:02 +00001723 SkPath path;
1724 path.setFillType(SkPath::kEvenOdd_FillType);
1725 path.moveTo(708.099182f, 7.09919119f);
1726 path.lineTo(708.099182f, 7.09920025f);
1727 path.quadTo(704.000000f, 11.2010098f, 704.000000f, 17.0000000f);
1728 path.lineTo(704.000000f, 33.0000000f);
1729 path.lineTo(705.000000f, 33.0000000f);
1730 path.lineTo(705.000000f, 17.0000000f);
1731 path.cubicTo(705.000000f, 13.4101496f, 706.455078f, 10.1601505f, 708.807617f, 7.80761385f);
1732 path.lineTo(708.099182f, 7.09919119f);
1733 path.close();
1734 SkPath pathB;
1735 pathB.setFillType(SkPath::kWinding_FillType);
1736 pathB.moveTo(704.000000f, 3.00000000f);
caryclark@google.com07e97fc2013-07-08 17:17:02 +00001737 pathB.lineTo(704.000000f, 33.0000000f);
1738 pathB.lineTo(705.000000f, 33.0000000f);
1739 pathB.lineTo(719.500000f, 3.00000000f);
caryclark54359292015-03-26 07:52:43 -07001740 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com07e97fc2013-07-08 17:17:02 +00001741}
caryclark@google.comcffbcc32013-06-04 17:59:42 +00001742
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001743static void skpahrefs_com88(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.com977409a2013-07-16 07:00:56 +00001744 SkPath path;
1745 path.setFillType(SkPath::kEvenOdd_FillType);
1746 path.moveTo(1099.82886f, 7.17117119f);
1747 path.lineTo(1099.12134f, 7.87867832f);
1748 path.cubicTo(1099.66418f, 8.42157173f, 1100.00000f, 9.17157173f, 1100.00000f, 10.0000000f);
1749 path.lineTo(1100.00000f, 28.0000000f);
1750 path.cubicTo(1100.00000f, 29.6568546f, 1098.65686f, 31.0000000f, 1097.00000f, 31.0000000f);
1751 path.lineTo(1088.00000f, 31.0000000f);
1752 path.lineTo(1088.00000f, 32.0000000f);
1753 path.lineTo(1097.00000f, 32.0000000f);
1754 path.quadTo(1098.65686f, 32.0000000f, 1099.82886f, 30.8288002f);
1755 path.quadTo(1101.00000f, 29.6568546f, 1101.00000f, 28.0000000f);
1756 path.lineTo(1101.00000f, 10.0000000f);
1757 path.quadTo(1101.00000f, 8.34314537f, 1099.82886f, 7.17119980f);
1758 path.lineTo(1099.82886f, 7.17117119f);
1759 path.close();
1760 SkPath pathB;
1761 pathB.setFillType(SkPath::kWinding_FillType);
1762 pathB.moveTo(1101.00000f, 6.00000000f);
1763 pathB.lineTo(1088.00000f, 6.00000000f);
1764 pathB.lineTo(1088.00000f, 19.0000000f);
1765 pathB.lineTo(1101.00000f, 32.0000000f);
caryclark54359292015-03-26 07:52:43 -07001766 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
skia.committer@gmail.com977409a2013-07-16 07:00:56 +00001767}
caryclark@google.comfa2aeee2013-07-15 13:29:13 +00001768
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001769static void skpahrefs_com29(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.com977409a2013-07-16 07:00:56 +00001770 SkPath path;
1771 path.setFillType(SkPath::kEvenOdd_FillType);
1772 path.moveTo(1037.17114f, 7.17119980f);
1773 path.quadTo(1038.34314f, 6.00000000f, 1040.00000f, 6.00000000f);
1774 path.lineTo(1074.00000f, 6.00000000f);
1775 path.lineTo(1074.00000f, 32.0000000f);
1776 path.lineTo(1040.00000f, 32.0000000f);
1777 path.quadTo(1038.34314f, 32.0000000f, 1037.17114f, 30.8288002f);
1778 path.quadTo(1036.00000f, 29.6568546f, 1036.00000f, 28.0000000f);
1779 path.lineTo(1036.00000f, 10.0000000f);
1780 path.quadTo(1036.00000f, 8.34314537f, 1037.17114f, 7.17119980f);
1781 path.close();
1782 path.moveTo(1037.00000f, 10.0000000f);
1783 path.cubicTo(1037.00000f, 8.34314537f, 1038.34314f, 7.00000000f, 1040.00000f, 7.00000000f);
1784 path.lineTo(1073.00000f, 7.00000000f);
1785 path.lineTo(1073.00000f, 31.0000000f);
1786 path.lineTo(1040.00000f, 31.0000000f);
1787 path.cubicTo(1038.34314f, 31.0000000f, 1037.00000f, 29.6568546f, 1037.00000f, 28.0000000f);
1788 path.lineTo(1037.00000f, 10.0000000f);
1789 path.close();
1790 SkPath pathB;
1791 pathB.setFillType(SkPath::kWinding_FillType);
1792 pathB.moveTo(1036.00000f, 32.0000000f);
1793 pathB.lineTo(1049.00000f, 19.0000000f);
1794 pathB.lineTo(1073.00000f, 31.0000000f);
1795 pathB.lineTo(1074.00000f, 32.0000000f);
caryclark54359292015-03-26 07:52:43 -07001796 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
skia.committer@gmail.com977409a2013-07-16 07:00:56 +00001797}
caryclark@google.comfa2aeee2013-07-15 13:29:13 +00001798
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001799static void cubicOp85d(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.com977409a2013-07-16 07:00:56 +00001800 SkPath path;
1801 path.setFillType(SkPath::kWinding_FillType);
1802 path.moveTo(0,1);
1803 path.cubicTo(1,6, 1,0, 6,2);
1804 path.close();
1805 SkPath pathB;
1806 pathB.setFillType(SkPath::kWinding_FillType);
1807 pathB.moveTo(0,1);
1808 pathB.cubicTo(2,6, 1,0, 6,1);
1809 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001810 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.comfa2aeee2013-07-15 13:29:13 +00001811}
1812
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001813static void skpkkiste_to98(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.com977409a2013-07-16 07:00:56 +00001814 SkPath path;
1815 path.setFillType(SkPath::kEvenOdd_FillType);
1816 path.moveTo(96, 122);
1817 path.cubicTo(94.6192932f, 122, 93.3692932f, 122.559647f, 92.4644699f, 123.46447f);
1818 path.lineTo(94.1715698f, 125.17157f);
1819 path.cubicTo(94.8954315f, 124.447708f, 95.8954315f, 124, 97, 124);
1820 path.lineTo(257, 124);
1821 path.cubicTo(258.104553f, 124, 259.104584f, 124.447708f, 259.82843f, 125.17157f);
1822 path.lineTo(261.535522f, 123.46447f);
1823 path.cubicTo(260.630707f, 122.559647f, 259.380707f, 122, 258, 122);
1824 path.lineTo(96, 122);
1825 path.close();
1826 SkPath pathB;
1827 pathB.setFillType(SkPath::kWinding_FillType);
1828 pathB.moveTo(258, 122);
1829 pathB.cubicTo(260.761414f, 122, 263, 124.238579f, 263, 127);
1830 pathB.lineTo(263, 284);
1831 pathB.cubicTo(263, 286.761414f, 260.761414f, 289, 258, 289);
1832 pathB.lineTo(96, 289);
1833 pathB.cubicTo(93.2385788f, 289, 91, 286.761414f, 91, 284);
1834 pathB.lineTo(91, 127);
1835 pathB.cubicTo(91, 124.238579f, 93.2385788f, 122, 96, 122);
1836 pathB.lineTo(258, 122);
1837 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001838 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
skia.committer@gmail.com977409a2013-07-16 07:00:56 +00001839}
caryclark@google.comfa2aeee2013-07-15 13:29:13 +00001840
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001841static void issue1417(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.com7f1af502013-07-24 07:01:12 +00001842 SkPath path1;
1843 path1.moveTo(122.58908843994140625f, 82.2836456298828125f);
1844 path1.quadTo(129.8215789794921875f, 80, 138, 80);
1845 path1.quadTo(147.15692138671875f, 80, 155.1280364990234375f, 82.86279296875f);
1846 path1.lineTo(161.1764678955078125f, 100);
1847 path1.lineTo(161.1764678955078125f, 100);
1848 path1.lineTo(115.29412078857421875f, 100);
1849 path1.lineTo(115.29412078857421875f, 100);
1850 path1.lineTo(122.58908843994140625f, 82.2836456298828125f);
1851 path1.lineTo(122.58908843994140625f, 82.2836456298828125f);
1852 path1.close();
1853 path1.moveTo(98.68194580078125f, 140.343841552734375f);
1854 path1.lineTo(115.29412078857421875f, 100);
1855 path1.lineTo(115.29412078857421875f, 100);
1856 path1.lineTo(97.9337615966796875f, 100);
1857 path1.lineTo(97.9337615966796875f, 100);
1858 path1.quadTo(88, 112.94264984130859375f, 88, 130);
1859 path1.quadTo(88, 131.544830322265625f, 88.08148956298828125f, 133.0560302734375f);
1860 path1.lineTo(98.68194580078125f, 140.343841552734375f);
1861 path1.lineTo(98.68194580078125f, 140.343841552734375f);
1862 path1.close();
1863 path1.moveTo(136.969696044921875f, 166.6666717529296875f);
1864 path1.lineTo(98.68194580078125f, 140.343841552734375f);
1865 path1.lineTo(98.68194580078125f, 140.343841552734375f);
1866 path1.lineTo(93.45894622802734375f, 153.02825927734375f);
1867 path1.lineTo(93.45894622802734375f, 153.02825927734375f);
1868 path1.quadTo(96.94116973876953125f, 159.65185546875f, 102.64466094970703125f, 165.3553466796875f);
1869 path1.quadTo(110.7924652099609375f, 173.503143310546875f, 120.8179779052734375f, 177.1177825927734375f);
1870 path1.lineTo(136.969696044921875f, 166.6666717529296875f);
1871 path1.lineTo(136.969696044921875f, 166.6666717529296875f);
1872 path1.close();
1873 path1.moveTo(175.8309783935546875f, 141.5211334228515625f);
1874 path1.lineTo(136.969696044921875f, 166.6666717529296875f);
1875 path1.lineTo(136.969696044921875f, 166.6666717529296875f);
1876 path1.lineTo(153.15728759765625f, 177.7956390380859375f);
1877 path1.lineTo(153.15728759765625f, 177.7956390380859375f);
1878 path1.quadTo(164.392425537109375f, 174.318267822265625f, 173.3553466796875f, 165.3553466796875f);
1879 path1.quadTo(177.805816650390625f, 160.9048614501953125f, 180.90380859375f, 155.8941650390625f);
1880 path1.lineTo(175.8309783935546875f, 141.5211334228515625f);
1881 path1.lineTo(175.8309783935546875f, 141.5211334228515625f);
1882 path1.close();
1883 path1.moveTo(175.8309783935546875f, 141.5211334228515625f);
1884 path1.lineTo(187.8782806396484375f, 133.7258148193359375f);
1885 path1.lineTo(187.8782806396484375f, 133.7258148193359375f);
1886 path1.quadTo(188, 131.8880615234375f, 188, 130);
1887 path1.quadTo(188, 112.942657470703125f, 178.0662384033203125f, 100);
1888 path1.lineTo(161.1764678955078125f, 100);
1889 path1.lineTo(161.1764678955078125f, 100);
1890 path1.lineTo(175.8309783935546875f, 141.5211334228515625f);
1891 path1.lineTo(175.8309783935546875f, 141.5211334228515625f);
1892 path1.close();
1893
1894 SkPath path2;
1895 path2.moveTo(174.117645263671875f, 100);
1896 path2.lineTo(161.1764678955078125f, 100);
1897 path2.lineTo(161.1764678955078125f, 100);
1898 path2.lineTo(155.1280364990234375f, 82.86279296875f);
1899 path2.lineTo(155.1280364990234375f, 82.86279296875f);
1900 path2.quadTo(153.14971923828125f, 82.15229034423828125f, 151.098419189453125f, 81.618133544921875f);
1901 path2.lineTo(143.5294189453125f, 100);
1902 path2.lineTo(143.5294189453125f, 100);
1903 path2.lineTo(161.1764678955078125f, 100);
1904 path2.lineTo(161.1764678955078125f, 100);
1905 path2.lineTo(168.23529052734375f, 120);
1906 path2.lineTo(168.23529052734375f, 120);
1907 path2.lineTo(181.1764678955078125f, 120);
1908 path2.lineTo(181.1764678955078125f, 120);
1909 path2.lineTo(186.3661956787109375f, 134.7042236328125f);
1910 path2.lineTo(186.3661956787109375f, 134.7042236328125f);
1911 path2.lineTo(187.8782806396484375f, 133.7258148193359375f);
1912 path2.lineTo(187.8782806396484375f, 133.7258148193359375f);
1913 path2.quadTo(188, 131.8880615234375f, 188, 130);
1914 path2.quadTo(188, 124.80947113037109375f, 187.080169677734375f, 120);
1915 path2.lineTo(181.1764678955078125f, 120);
1916 path2.lineTo(181.1764678955078125f, 120);
1917 path2.lineTo(174.117645263671875f, 100);
1918 path2.lineTo(174.117645263671875f, 100);
1919 path2.close();
1920 path2.moveTo(88.91983795166015625f, 120);
1921 path2.lineTo(107.0588226318359375f, 120);
1922 path2.lineTo(107.0588226318359375f, 120);
1923 path2.lineTo(98.68194580078125f, 140.343841552734375f);
1924 path2.lineTo(98.68194580078125f, 140.343841552734375f);
1925 path2.lineTo(88.08148956298828125f, 133.0560302734375f);
1926 path2.lineTo(88.08148956298828125f, 133.0560302734375f);
1927 path2.quadTo(88, 131.544830322265625f, 88, 130);
1928 path2.quadTo(88, 124.80951690673828125f, 88.91983795166015625f, 120);
1929 path2.close();
1930 path2.moveTo(96.67621612548828125f, 145.21490478515625f);
1931 path2.lineTo(98.68194580078125f, 140.343841552734375f);
1932 path2.lineTo(98.68194580078125f, 140.343841552734375f);
1933 path2.lineTo(120.68767547607421875f, 155.4727783203125f);
1934 path2.lineTo(120.68767547607421875f, 155.4727783203125f);
1935 path2.lineTo(118.68194580078125f, 160.343841552734375f);
1936 path2.lineTo(118.68194580078125f, 160.343841552734375f);
1937 path2.lineTo(96.67621612548828125f, 145.21490478515625f);
1938 path2.lineTo(96.67621612548828125f, 145.21490478515625f);
1939 path2.close();
1940 path2.moveTo(113.232177734375f, 173.5789947509765625f);
1941 path2.quadTo(116.8802642822265625f, 175.69805908203125f, 120.8179779052734375f, 177.1177825927734375f);
1942 path2.lineTo(132.2864990234375f, 169.6969757080078125f);
1943 path2.lineTo(132.2864990234375f, 169.6969757080078125f);
1944 path2.lineTo(118.68194580078125f, 160.343841552734375f);
1945 path2.lineTo(118.68194580078125f, 160.343841552734375f);
1946 path2.lineTo(113.232177734375f, 173.5789947509765625f);
1947 path2.lineTo(113.232177734375f, 173.5789947509765625f);
1948 path2.close();
caryclark54359292015-03-26 07:52:43 -07001949 // FIXME : difficult data, circle back later
1950 testPathOp(reporter, path1, path2, kUnion_SkPathOp, filename);
skia.committer@gmail.com977409a2013-07-16 07:00:56 +00001951}
caryclark@google.com3dd27842013-07-15 15:00:58 +00001952
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001953static void issue1418(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.com7f1af502013-07-24 07:01:12 +00001954 SkPath path1;
1955 path1.moveTo(0, 0);
1956 path1.lineTo(1, 0);
1957 path1.lineTo(1, 0);
1958 path1.lineTo(1, 1);
1959 path1.lineTo(1, 1);
1960 path1.lineTo(0, 1);
1961 path1.lineTo(0, 1);
1962 path1.lineTo(0, 0);
1963 path1.lineTo(0, 0);
1964 path1.close();
1965
1966 SkPath path2;
1967 path2.moveTo(0.64644664525985717773f, -0.35355341434478759766f);
1968 path2.quadTo(0.79289329051971435547f, -0.50000005960464477539f, 1.0000001192092895508f, -0.50000005960464477539f);
1969 path2.quadTo(1.2071068286895751953f, -0.50000005960464477539f, 1.3535535335540771484f, -0.35355341434478759766f);
1970 path2.quadTo(1.5000001192092895508f, -0.20710679888725280762f, 1.5000001192092895508f, 0);
1971 path2.quadTo(1.5000001192092895508f, 0.20710679888725280762f, 1.3535535335540771484f, 0.35355341434478759766f);
1972 path2.quadTo(1.2071068286895751953f, 0.50000005960464477539f, 1.0000001192092895508f, 0.50000005960464477539f);
1973 path2.quadTo(0.79289329051971435547f, 0.50000005960464477539f, 0.64644664525985717773f, 0.35355341434478759766f);
1974 path2.quadTo(0.50000005960464477539f, 0.20710679888725280762f, 0.50000005960464477539f, 0);
caryclark@google.com4fdbb222013-07-23 15:27:41 +00001975 path2.quadTo(0.50000005960464477539f, -0.20710679888725280762f, 0.64644664525985717773f, -0.35355341434478759766f);
caryclark54359292015-03-26 07:52:43 -07001976 testPathOp(reporter, path1, path2, kIntersect_SkPathOp, filename);
skia.committer@gmail.com977409a2013-07-16 07:00:56 +00001977}
caryclark@google.com4fdbb222013-07-23 15:27:41 +00001978
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001979static void cubicOp85i(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.com7f1af502013-07-24 07:01:12 +00001980 SkPath path, pathB;
1981 path.setFillType(SkPath::kWinding_FillType);
1982 path.moveTo(3, 4);
1983 path.cubicTo(1, 5, 4, 3, 6, 4);
1984 path.close();
1985 pathB.setFillType(SkPath::kWinding_FillType);
1986 pathB.moveTo(3, 4);
1987 pathB.cubicTo(4, 6, 4, 3, 5, 1);
1988 pathB.close();
caryclark54359292015-03-26 07:52:43 -07001989 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com4fdbb222013-07-23 15:27:41 +00001990}
1991
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00001992static void issue1418b(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com570863f2013-09-16 15:55:01 +00001993 SkPath path1;
1994 path1.moveTo(0, 0);
1995 path1.lineTo(1, 0);
1996 path1.lineTo(1, 1);
1997 path1.lineTo(0, 1);
1998 path1.lineTo(0, 0);
1999 path1.close();
2000 path1.setFillType(SkPath::kWinding_FillType);
2001 SkPath path2;
2002 path2.moveTo(0.646446645f, -0.353553414f);
2003 path2.quadTo(0.792893291f, -0.50000006f, 1.00000012f, -0.50000006f);
2004 path2.quadTo(1.20710683f, -0.50000006f, 1.35355353f, -0.353553414f);
2005 path2.quadTo(1.50000012f, -0.207106799f, 1.50000012f, 0);
2006 path2.quadTo(1.50000012f, 0.207106799f, 1.35355353f, 0.353553414f);
2007 path2.quadTo(1.20710683f, 0.50000006f, 1.00000012f, 0.50000006f);
2008 path2.quadTo(0.792893291f, 0.50000006f, 0.646446645f, 0.353553414f);
2009 path2.quadTo(0.50000006f, 0.207106799f, 0.50000006f, 0);
2010 path2.quadTo(0.50000006f, -0.207106799f, 0.646446645f, -0.353553414f);
2011 path2.close();
2012 path2.moveTo(1.00000012f, 0.50000006f);
2013 path2.lineTo(1.00000012f, 1.00000012f);
2014 path2.lineTo(0.50000006f, 1.00000012f);
2015 path2.quadTo(0.50000006f, 0.792893291f, 0.646446645f, 0.646446645f);
2016 path2.quadTo(0.792893291f, 0.50000006f, 1.00000012f, 0.50000006f);
2017 path2.close();
2018 path2.setFillType(SkPath::kEvenOdd_FillType);
caryclark54359292015-03-26 07:52:43 -07002019 testPathOp(reporter, path1, path2, kIntersect_SkPathOp, filename);
caryclark@google.com570863f2013-09-16 15:55:01 +00002020}
2021
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002022static void rectOp1i(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com570863f2013-09-16 15:55:01 +00002023 SkPath path, pathB;
2024 path.setFillType(SkPath::kWinding_FillType);
2025 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
2026 path.addRect(2, 2, 4, 4, SkPath::kCW_Direction);
2027 pathB.setFillType(SkPath::kWinding_FillType);
2028 pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
2029 pathB.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
caryclark54359292015-03-26 07:52:43 -07002030 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com570863f2013-09-16 15:55:01 +00002031}
2032
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002033static void rectOp2i(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com570863f2013-09-16 15:55:01 +00002034 SkPath path, pathB;
2035 path.setFillType(SkPath::kEvenOdd_FillType);
2036 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
2037 path.addRect(0, 0, 3, 3, SkPath::kCW_Direction);
2038 pathB.setFillType(SkPath::kWinding_FillType);
2039 pathB.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
2040 pathB.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
caryclark54359292015-03-26 07:52:43 -07002041 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com570863f2013-09-16 15:55:01 +00002042}
2043
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002044static void rectOp3x(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com570863f2013-09-16 15:55:01 +00002045 SkPath path, pathB;
2046 path.setFillType(SkPath::kEvenOdd_FillType);
2047 path.moveTo(0, 0);
2048 path.lineTo(3, 0);
2049 path.lineTo(3, 3);
2050 path.lineTo(0, 3);
2051 path.close();
2052 path.moveTo(2, 2);
2053 path.lineTo(3, 2);
2054 path.lineTo(3, 3);
2055 path.lineTo(2, 3);
2056 path.close();
2057 pathB.setFillType(SkPath::kWinding_FillType);
2058 pathB.moveTo(1, 1);
2059 pathB.lineTo(3, 1);
2060 pathB.lineTo(3, 3);
2061 pathB.lineTo(1, 3);
2062 pathB.close();
2063 pathB.moveTo(2, 2);
2064 pathB.lineTo(3, 2);
2065 pathB.lineTo(3, 3);
2066 pathB.lineTo(2, 3);
2067 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002068 testPathOp(reporter, path, pathB, kXOR_SkPathOp, filename);
caryclark@google.com570863f2013-09-16 15:55:01 +00002069}
2070
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002071static void issue1435(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com570863f2013-09-16 15:55:01 +00002072 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
caryclark@google.com570863f2013-09-16 15:55:01 +00002082 SkPath path2;
2083 path2.moveTo(142.589081f, 102.283646f);
2084 path2.quadTo(149.821579f, 100, 158, 100);
2085 path2.quadTo(167.156921f, 100, 175.128036f, 102.862793f);
2086 path2.lineTo(181.176468f, 120);
2087 path2.lineTo(135.294128f, 120);
2088 path2.lineTo(142.589081f, 102.283646f);
2089 path2.close();
2090 path2.moveTo(118.681946f, 160.343842f);
2091 path2.lineTo(135.294128f, 120);
2092 path2.lineTo(117.933762f, 120);
2093 path2.quadTo(108, 132.942657f, 108, 150);
2094 path2.quadTo(108, 151.54483f, 108.08149f, 153.05603f);
2095 path2.lineTo(118.681946f, 160.343842f);
2096 path2.close();
2097 path2.moveTo(156.969696f, 186.666672f);
2098 path2.lineTo(118.681946f, 160.343842f);
2099 path2.lineTo(113.458946f, 173.028259f);
2100 path2.quadTo(116.94117f, 179.651855f, 122.644661f, 185.355347f);
2101 path2.quadTo(130.792465f, 193.503143f, 140.817978f, 197.117783f);
2102 path2.lineTo(156.969696f, 186.666672f);
2103 path2.close();
2104 path2.moveTo(195.830978f, 161.521133f);
2105 path2.lineTo(156.969696f, 186.666672f);
2106 path2.lineTo(173.157288f, 197.795639f);
2107 path2.quadTo(184.392426f, 194.318268f, 193.355347f, 185.355347f);
2108 path2.quadTo(197.805817f, 180.904861f, 200.903809f, 175.894165f);
2109 path2.lineTo(195.830978f, 161.521133f);
2110 path2.close();
2111 path2.moveTo(195.830978f, 161.521133f);
2112 path2.lineTo(207.878281f, 153.725815f);
2113 path2.quadTo(208, 151.888062f, 208, 150);
2114 path2.quadTo(208, 132.942657f, 198.066238f, 120);
2115 path2.lineTo(181.176468f, 120);
2116 path2.lineTo(195.830978f, 161.521133f);
2117 path2.close();
2118 path2.setFillType(SkPath::kEvenOdd_FillType);
caryclark54359292015-03-26 07:52:43 -07002119 testPathOp(reporter, path1, path2, kIntersect_SkPathOp, filename);
caryclark@google.com570863f2013-09-16 15:55:01 +00002120}
caryclark@google.com570863f2013-09-16 15:55:01 +00002121
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002122static void skpkkiste_to716(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.com7f1af502013-07-24 07:01:12 +00002123 SkPath path;
2124 path.setFillType(SkPath::kEvenOdd_FillType);
2125 path.moveTo(1173, 284);
2126 path.cubicTo(1173, 285.125824f, 1173.37207f, 286.164734f, 1174, 287.000488f);
2127 path.lineTo(1174, 123.999496f);
2128 path.cubicTo(1173.37207f, 124.835243f, 1173, 125.874168f, 1173, 127);
2129 path.lineTo(1173, 284);
2130 path.close();
2131 SkPath pathB;
2132 pathB.setFillType(SkPath::kWinding_FillType);
2133 pathB.moveTo(1340, 122);
2134 pathB.cubicTo(1342.76147f, 122, 1345, 124.238579f, 1345, 127);
2135 pathB.lineTo(1345, 284);
2136 pathB.cubicTo(1345, 286.761414f, 1342.76147f, 289, 1340, 289);
2137 pathB.lineTo(1178, 289);
2138 pathB.cubicTo(1175.23853f, 289, 1173, 286.761414f, 1173, 284);
2139 pathB.lineTo(1173, 127);
2140 pathB.cubicTo(1173, 124.238579f, 1175.23853f, 122, 1178, 122);
2141 pathB.lineTo(1340, 122);
2142 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002143 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
skia.committer@gmail.com7f1af502013-07-24 07:01:12 +00002144}
caryclark@google.com3dd27842013-07-15 15:00:58 +00002145
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002146static void loopEdge1(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com570863f2013-09-16 15:55:01 +00002147 SkPath path;
2148 path.setFillType(SkPath::kEvenOdd_FillType);
2149 path.moveTo(0,0);
2150 path.lineTo(3,0);
2151 path.lineTo(3,2);
2152 path.lineTo(1,2);
2153 path.lineTo(1,1);
2154 path.lineTo(2,1);
2155 path.lineTo(2,3);
2156 path.lineTo(0,3);
2157 path.close();
2158 SkPath pathB;
2159 pathB.setFillType(SkPath::kEvenOdd_FillType);
2160 pathB.moveTo(1,2);
2161 pathB.lineTo(2,2);
2162 pathB.lineTo(2,4);
2163 pathB.lineTo(1,4);
2164 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002165 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com570863f2013-09-16 15:55:01 +00002166}
2167
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002168static void loopEdge2(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com570863f2013-09-16 15:55:01 +00002169 SkPath path;
2170 path.setFillType(SkPath::kEvenOdd_FillType);
2171 path.moveTo(0,0);
2172 path.lineTo(3,0);
2173 path.lineTo(3,2);
2174 path.lineTo(1,2);
2175 path.lineTo(1,1);
2176 path.lineTo(2,1);
2177 path.lineTo(2,3);
2178 path.lineTo(0,3);
2179 path.close();
2180 SkPath pathB;
2181 pathB.setFillType(SkPath::kEvenOdd_FillType);
2182 pathB.moveTo(1 - 1e-6f,2);
2183 pathB.lineTo(2 - 1e-6f,2);
2184 pathB.lineTo(2 - 1e-6f,4);
2185 pathB.lineTo(1 - 1e-6f,4);
2186 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002187 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com570863f2013-09-16 15:55:01 +00002188}
2189
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002190static void cubicOp86i(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com570863f2013-09-16 15:55:01 +00002191 SkPath path, pathB;
2192 path.setFillType(SkPath::kWinding_FillType);
2193 path.moveTo(0, 4);
2194 path.cubicTo(3, 4, 6, 2, 5, 2);
2195 path.close();
2196 pathB.setFillType(SkPath::kEvenOdd_FillType);
2197 pathB.moveTo(2, 6);
2198 pathB.cubicTo(2, 5, 4, 0, 4, 3);
2199 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002200 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com570863f2013-09-16 15:55:01 +00002201}
2202
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002203static void cubicOp87u(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com570863f2013-09-16 15:55:01 +00002204 SkPath path, pathB;
2205 path.setFillType(SkPath::kWinding_FillType);
2206 path.moveTo(0,1);
2207 path.cubicTo(0,2, 2,0, 6,4);
2208 path.close();
2209 pathB.setFillType(SkPath::kWinding_FillType);
2210 pathB.moveTo(0,2);
2211 pathB.cubicTo(4,6, 1,0, 2,0);
2212 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002213 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
caryclark@google.com570863f2013-09-16 15:55:01 +00002214}
2215
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002216static void cubicOp88u(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com570863f2013-09-16 15:55:01 +00002217 SkPath path, pathB;
2218 path.setFillType(SkPath::kWinding_FillType);
2219 path.moveTo(0,1);
2220 path.cubicTo(2,5, 5,0, 6,4);
2221 path.close();
2222 pathB.setFillType(SkPath::kWinding_FillType);
2223 pathB.moveTo(0,5);
2224 pathB.cubicTo(4,6, 1,0, 5,2);
2225 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002226 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
caryclark@google.com570863f2013-09-16 15:55:01 +00002227}
2228
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002229static void cubicOp89u(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com570863f2013-09-16 15:55:01 +00002230 SkPath path, pathB;
2231 path.setFillType(SkPath::kWinding_FillType);
2232 path.moveTo(0, 3);
2233 path.cubicTo(1, 6, 5, 0, 6, 3);
2234 path.close();
2235 pathB.setFillType(SkPath::kWinding_FillType);
2236 pathB.moveTo(0, 5);
2237 pathB.cubicTo(3, 6, 3, 0, 6, 1);
2238 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002239 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
caryclark@google.com570863f2013-09-16 15:55:01 +00002240}
2241
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002242static void cubicOp90u(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com570863f2013-09-16 15:55:01 +00002243 SkPath path, pathB;
2244 path.setFillType(SkPath::kEvenOdd_FillType);
2245 path.moveTo(0, 5);
2246 path.cubicTo(1, 2, 5, 2, 4, 1);
2247 path.close();
2248 pathB.setFillType(SkPath::kEvenOdd_FillType);
2249 pathB.moveTo(2, 5);
2250 pathB.cubicTo(1, 4, 5, 0, 2, 1);
2251 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002252 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
caryclark@google.com570863f2013-09-16 15:55:01 +00002253}
2254
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002255static void cubicOp91u(skiatest::Reporter* reporter, const char* filename) {
caryclark@google.com570863f2013-09-16 15:55:01 +00002256 SkPath path, pathB;
2257 path.setFillType(SkPath::kWinding_FillType);
2258 path.moveTo(1, 6);
2259 path.cubicTo(0, 3, 6, 3, 5, 0);
2260 path.close();
2261 pathB.setFillType(SkPath::kWinding_FillType);
2262 pathB.moveTo(3, 6);
2263 pathB.cubicTo(0, 5, 6, 1, 3, 0);
2264 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002265 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
caryclark@google.com570863f2013-09-16 15:55:01 +00002266}
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002267
caryclark54359292015-03-26 07:52:43 -07002268static void skpaaalgarve_org53(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002269 SkPath path;
2270 path.setFillType(SkPath::kEvenOdd_FillType);
2271 path.moveTo(-1.24344979e-014f, 348);
2272 path.lineTo(258, 348);
2273 path.lineTo(258, 322);
2274 path.quadTo(258, 317.857849f, 255.072006f, 314.928009f);
2275 path.quadTo(252.142136f, 312, 248, 312);
2276 path.lineTo(1.77635684e-015f, 312);
2277 path.lineTo(-1.24344979e-014f, 348);
2278 path.close();
2279 SkPath pathB;
2280 pathB.setFillType(SkPath::kWinding_FillType);
2281 pathB.moveTo(0, 312);
2282 pathB.lineTo(258, 312);
2283 pathB.lineTo(258, 348);
2284 pathB.lineTo(0, 348);
2285 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002286 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002287}
2288
caryclark54359292015-03-26 07:52:43 -07002289static void skpabcspark_ca103(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002290 SkPath path;
2291 path.setFillType(SkPath::kEvenOdd_FillType);
2292 path.moveTo(1.99840144e-015f, 494);
2293 path.lineTo(97, 494);
2294 path.quadTo(100.313705f, 494, 102.6576f, 491.657593f);
2295 path.quadTo(105, 489.313721f, 105, 486);
2296 path.lineTo(105, 425);
2297 path.quadTo(105, 421.686279f, 102.6576f, 419.342407f);
2298 path.quadTo(100.313705f, 417, 97, 417);
2299 path.lineTo(2.22044605e-016f, 417);
2300 path.lineTo(1.99840144e-015f, 494);
2301 path.close();
2302 SkPath pathB;
2303 pathB.setFillType(SkPath::kWinding_FillType);
2304 pathB.moveTo(0, 417);
2305 pathB.lineTo(105, 417);
2306 pathB.lineTo(105, 494);
2307 pathB.lineTo(0, 494);
2308 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002309 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002310}
2311
caryclark54359292015-03-26 07:52:43 -07002312static void skpacesoftech_com47(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002313 SkPath path;
2314 path.setFillType(SkPath::kEvenOdd_FillType);
2315 path.moveTo(670.537415f, 285);
2316 path.lineTo(670.387451f, 285);
2317 path.lineTo(596.315186f, 314.850708f);
2318 path.lineTo(626.19696f, 389);
2319 path.lineTo(626.346863f, 389);
2320 path.lineTo(700.419189f, 359.149261f);
2321 path.lineTo(670.537415f, 285);
2322 path.close();
2323 SkPath pathB;
2324 pathB.setFillType(SkPath::kWinding_FillType);
2325 pathB.moveTo(663.318542f, 374.100616f);
2326 pathB.quadTo(647.950989f, 380.293671f, 632.705322f, 373.806305f);
2327 pathB.quadTo(617.459595f, 367.318909f, 611.266541f, 351.951355f);
2328 pathB.quadTo(605.073486f, 336.58374f, 611.560913f, 321.338074f);
2329 pathB.quadTo(618.048279f, 306.092407f, 633.415833f, 299.899353f);
2330 pathB.quadTo(648.783447f, 293.706299f, 664.029114f, 300.193665f);
2331 pathB.quadTo(679.27478f, 306.68103f, 685.467834f, 322.048645f);
2332 pathB.quadTo(691.660889f, 337.416199f, 685.173523f, 352.661896f);
2333 pathB.quadTo(678.686157f, 367.907562f, 663.318542f, 374.100616f);
2334 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002335 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002336}
2337
caryclark54359292015-03-26 07:52:43 -07002338static void skpact_com43(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002339 SkPath path;
2340 path.setFillType(SkPath::kEvenOdd_FillType);
2341 path.moveTo(1.45716772e-016f, 924.336121f);
2342 path.lineTo(-1.11022302e-016f, 920);
2343 path.lineTo(6, 920);
2344 path.lineTo(6, 926);
2345 path.lineTo(1.66389287f, 926);
2346 path.quadTo(1.18842196f, 925.674561f, 0.756800175f, 925.243225f);
2347 path.quadTo(0.325406998f, 924.811523f, 1.45716772e-016f, 924.336121f);
2348 path.close();
2349 path.moveTo(1, 921);
2350 path.lineTo(5, 921);
2351 path.lineTo(5, 925);
2352 path.cubicTo(2.79086018f, 925, 1, 923.209167f, 1, 921);
2353 path.close();
2354 SkPath pathB;
2355 pathB.setFillType(SkPath::kWinding_FillType);
2356 pathB.moveTo(-1, 920);
2357 pathB.lineTo(0, 920);
2358 pathB.lineTo(3, 927);
2359 pathB.lineTo(-1, 927);
caryclark54359292015-03-26 07:52:43 -07002360 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002361}
2362
caryclark54359292015-03-26 07:52:43 -07002363static void skpadbox_lt8(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002364 SkPath path;
2365 path.setFillType(SkPath::kEvenOdd_FillType);
2366 path.moveTo(320.097229f, 628.573669f);
2367 path.lineTo(610.227173f, 85.7786865f);
2368 path.lineTo(946.652588f, 265.601807f);
2369 path.lineTo(656.522644f, 808.39679f);
2370 path.lineTo(320.097229f, 628.573669f);
2371 path.close();
2372 SkPath pathB;
2373 pathB.setFillType(SkPath::kInverseWinding_FillType);
2374 pathB.moveTo(333.866608f, 623.496155f);
2375 pathB.lineTo(613.368042f, 100.585754f);
2376 pathB.cubicTo(613.685303f, 99.9921265f, 614.423767f, 99.7681885f, 615.017395f, 100.085449f);
2377 pathB.lineTo(932.633057f, 269.854553f);
2378 pathB.cubicTo(933.226685f, 270.171875f, 933.450623f, 270.910278f, 933.133301f, 271.503906f);
2379 pathB.lineTo(653.631897f, 794.414307f);
2380 pathB.cubicTo(653.314636f, 795.007935f, 652.576172f, 795.231934f, 651.982544f, 794.914612f);
2381 pathB.lineTo(334.366943f, 625.145508f);
2382 pathB.cubicTo(333.773315f, 624.828247f, 333.549286f, 624.089783f, 333.866608f, 623.496155f);
2383 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002384 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002385}
2386
caryclark54359292015-03-26 07:52:43 -07002387static void skpadindex_de4(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002388 SkPath path;
2389 path.setFillType(SkPath::kEvenOdd_FillType);
2390 path.moveTo(0, 926);
2391 path.lineTo(0, 0);
2392 path.lineTo(1280, 0);
2393 path.lineTo(1280, 926);
2394 path.lineTo(0, 926);
2395 path.close();
2396 SkPath pathB;
2397 pathB.setFillType(SkPath::kWinding_FillType);
2398 pathB.moveTo(0, 312);
2399 pathB.lineTo(8.20486257e-015f, 178);
2400 pathB.lineTo(49, 178);
2401 pathB.lineTo(49, 312);
2402 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002403 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002404}
2405
caryclark54359292015-03-26 07:52:43 -07002406static void skpadithya_putr4_blogspot_com551(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002407 SkPath path;
2408 path.setFillType(SkPath::kEvenOdd_FillType);
2409 path.moveTo(205.605804f, 142.334625f);
2410 path.lineTo(254.665359f, 85.6058044f);
2411 path.lineTo(311.394196f, 134.665359f);
2412 path.lineTo(262.334625f, 191.39418f);
2413 path.lineTo(205.605804f, 142.334625f);
2414 path.close();
2415 SkPath pathB;
2416 pathB.setFillType(SkPath::kWinding_FillType);
2417 pathB.moveTo(283.407959f, 110.462646f);
2418 pathB.cubicTo(298.864319f, 123.829437f, 300.558258f, 147.195221f, 287.191467f, 162.651581f);
2419 pathB.lineTo(286.537354f, 163.407959f);
2420 pathB.cubicTo(273.170563f, 178.864334f, 249.804779f, 180.558258f, 234.348419f, 167.191467f);
2421 pathB.lineTo(233.592026f, 166.537338f);
2422 pathB.cubicTo(218.135666f, 153.170547f, 216.441727f, 129.804779f, 229.808517f, 114.348412f);
2423 pathB.lineTo(230.462646f, 113.592026f);
2424 pathB.cubicTo(243.829437f, 98.1356659f, 267.195221f, 96.4417267f, 282.651581f, 109.808517f);
2425 pathB.lineTo(283.407959f, 110.462646f);
2426 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002427 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002428}
2429
caryclark54359292015-03-26 07:52:43 -07002430static void skpadspert_de11(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002431 SkPath path;
2432 path.setFillType(SkPath::kEvenOdd_FillType);
2433 path.moveTo(-4.4408921e-016f, 682.5f);
2434 path.lineTo(30.5f, 682.5f);
2435 path.cubicTo(32.709137f, 682.5f, 34.5f, 680.709167f, 34.5f, 678.5f);
2436 path.lineTo(34.5f, 486.5f);
2437 path.cubicTo(34.5f, 484.290863f, 32.709137f, 482.5f, 30.5f, 482.5f);
2438 path.lineTo(0, 482.5f);
2439 path.lineTo(-4.4408921e-016f, 682.5f);
2440 path.close();
2441 SkPath pathB;
2442 pathB.setFillType(SkPath::kWinding_FillType);
2443 pathB.moveTo(0, 482);
2444 pathB.lineTo(35, 482);
2445 pathB.lineTo(35, 683);
2446 pathB.lineTo(0, 683);
2447 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002448 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002449}
2450
caryclark54359292015-03-26 07:52:43 -07002451static void skpaiaigames_com870(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002452 SkPath path;
2453 path.setFillType(SkPath::kEvenOdd_FillType);
2454 path.moveTo(324.071075f, 845.071045f);
2455 path.cubicTo(324.405151f, 844.737f, 324.715668f, 844.379395f, 325, 844.000977f);
2456 path.lineTo(325, 842.127197f);
2457 path.cubicTo(324.571411f, 842.956238f, 324.017761f, 843.710144f, 323.363953f, 844.363953f);
2458 path.lineTo(324.071075f, 845.071045f);
2459 path.close();
2460 path.moveTo(323.363953f, 714.636047f);
2461 path.lineTo(324.071075f, 713.928955f);
2462 path.cubicTo(324.405151f, 714.263f, 324.715668f, 714.620605f, 325, 714.999023f);
2463 path.lineTo(325, 716.872803f);
2464 path.cubicTo(324.571411f, 716.043762f, 324.017761f, 715.289856f, 323.363953f, 714.636047f);
2465 path.close();
2466 SkPath pathB;
2467 pathB.setFillType(SkPath::kWinding_FillType);
2468 pathB.moveTo(317, 711);
2469 pathB.cubicTo(322.522858f, 711, 327, 715.477173f, 327, 721);
2470 pathB.lineTo(327, 838);
2471 pathB.cubicTo(327, 843.522827f, 322.522858f, 848, 317, 848);
2472 pathB.lineTo(155, 848);
2473 pathB.cubicTo(149.477158f, 848, 145, 843.522827f, 145, 838);
2474 pathB.lineTo(145, 721);
2475 pathB.cubicTo(145, 715.477173f, 149.477158f, 711, 155, 711);
2476 pathB.lineTo(317, 711);
2477 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07002478 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002479}
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002480
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002481static void cubicOp92i(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002482 SkPath path, pathB;
2483 path.setFillType(SkPath::kWinding_FillType);
2484 path.moveTo(0, 1);
2485 path.cubicTo(2, 6, 4, 1, 5, 4);
2486 path.close();
2487 pathB.setFillType(SkPath::kWinding_FillType);
2488 pathB.moveTo(1, 4);
2489 pathB.cubicTo(4, 5, 1, 0, 6, 2);
2490 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002491 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002492}
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002493
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002494static void cubicOp93d(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002495 SkPath path, pathB;
2496 path.setFillType(SkPath::kWinding_FillType);
2497 path.moveTo(0, 1);
2498 path.cubicTo(1, 6, 4, 1, 4, 3);
2499 path.close();
2500 pathB.setFillType(SkPath::kWinding_FillType);
2501 pathB.moveTo(1, 4);
2502 pathB.cubicTo(3, 4, 1, 0, 6, 1);
2503 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002504 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002505}
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002506
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002507static void cubicOp94u(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002508 SkPath path, pathB;
2509 path.setFillType(SkPath::kEvenOdd_FillType);
2510 path.moveTo(0, 3);
2511 path.cubicTo(2, 3, 5, 0, 5, 3);
2512 path.close();
2513 pathB.setFillType(SkPath::kEvenOdd_FillType);
2514 pathB.moveTo(0, 5);
2515 pathB.cubicTo(3, 5, 3, 0, 3, 2);
2516 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002517 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002518}
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002519
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002520static void skpadbox_lt15(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002521 SkPath path;
2522 path.setFillType(SkPath::kEvenOdd_FillType);
2523 path.moveTo(333.292084f, 624.570984f);
2524 path.lineTo(614.229797f, 98.9735107f);
2525 path.lineTo(933.457764f, 269.604431f);
2526 path.lineTo(652.52002f, 795.201904f);
2527 path.lineTo(333.292084f, 624.570984f);
2528 path.close();
2529 SkPath pathB;
2530 pathB.setFillType(SkPath::kWinding_FillType);
2531 pathB.moveTo(613.368042f, 100.585754f);
2532 pathB.cubicTo(613.685303f, 99.9921265f, 614.423767f, 99.7681885f, 615.017395f, 100.085449f);
2533 pathB.lineTo(932.633057f, 269.854553f);
2534 pathB.cubicTo(933.226685f, 270.171875f, 933.450623f, 270.910278f, 933.133301f, 271.503906f);
2535 pathB.lineTo(653.631897f, 794.414307f);
2536 pathB.cubicTo(653.314636f, 795.007935f, 652.576172f, 795.231934f, 651.982544f, 794.914612f);
2537 pathB.lineTo(334.366943f, 625.145508f);
2538 pathB.cubicTo(333.773315f, 624.828247f, 333.549286f, 624.089783f, 333.866608f, 623.496155f);
2539 pathB.lineTo(613.368042f, 100.585754f);
2540 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002541 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002542}
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002543
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002544static void skpadoption_org196(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002545 SkPath path;
2546 path.setFillType(SkPath::kEvenOdd_FillType);
2547 path.moveTo(802, 367);
2548 path.lineTo(802, 324);
2549 path.lineTo(956, 324);
2550 path.lineTo(956, 371);
2551 path.quadTo(956, 373.071075f, 954.536011f, 374.536011f);
2552 path.quadTo(953.071045f, 376, 951, 376);
2553 path.lineTo(811, 376);
2554 path.cubicTo(806.029419f, 376, 802, 371.970551f, 802, 367);
2555 path.close();
2556 SkPath pathB;
2557 pathB.setFillType(SkPath::kInverseWinding_FillType);
2558 pathB.moveTo(803, 326);
2559 pathB.lineTo(955, 326);
2560 pathB.lineTo(955, 370);
2561 pathB.cubicTo(955, 372.761414f, 952.761414f, 375, 950, 375);
2562 pathB.lineTo(808, 375);
2563 pathB.cubicTo(805.238586f, 375, 803, 372.761414f, 803, 370);
2564 pathB.lineTo(803, 326);
2565 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002566 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002567}
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002568
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002569static void skpadspert_net23(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002570 SkPath path;
2571 path.setFillType(SkPath::kEvenOdd_FillType);
2572 path.moveTo(-2.220446e-018f, 483.5f);
2573 path.lineTo(0, 482.5f);
2574 path.lineTo(30.5f, 482.5f);
2575 path.cubicTo(32.709137f, 482.5f, 34.5f, 484.290863f, 34.5f, 486.5f);
2576 path.lineTo(34.5f, 678.5f);
2577 path.cubicTo(34.5f, 680.709167f, 32.709137f, 682.5f, 30.5f, 682.5f);
2578 path.lineTo(-4.4408921e-016f, 682.5f);
2579 path.lineTo(-4.41868766e-016f, 681.5f);
2580 path.lineTo(30.5f, 681.5f);
2581 path.cubicTo(32.1568565f, 681.5f, 33.5f, 680.15686f, 33.5f, 678.5f);
2582 path.lineTo(33.5f, 486.5f);
2583 path.cubicTo(33.5f, 484.84314f, 32.1568565f, 483.5f, 30.5f, 483.5f);
2584 path.lineTo(-2.220446e-018f, 483.5f);
2585 path.close();
2586 SkPath pathB;
2587 pathB.setFillType(SkPath::kWinding_FillType);
2588 pathB.moveTo(0, 482);
2589 pathB.lineTo(35, 482);
2590 pathB.lineTo(35, 683);
2591 pathB.lineTo(0, 683);
2592 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002593 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002594}
2595
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002596static void skpadventistmission_org572(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002597 SkPath path;
2598 path.setFillType(SkPath::kEvenOdd_FillType);
2599 path.moveTo(1182.00037f, 926);
2600 path.cubicTo(1181.08813f, 924.785583f, 1179.63586f, 924, 1178, 924);
2601 path.lineTo(938, 924);
2602 path.cubicTo(936.364197f, 924, 934.911865f, 924.785583f, 933.999634f, 926);
2603 path.lineTo(1182.00037f, 926);
2604 path.close();
2605 SkPath pathB;
2606 pathB.setFillType(SkPath::kWinding_FillType);
2607 pathB.moveTo(934, 924);
2608 pathB.lineTo(1182, 924);
2609 pathB.lineTo(1182, 926);
2610 pathB.lineTo(934, 926);
2611 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002612 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002613}
2614
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002615static void skpagentxsites_com55(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002616 SkPath path;
2617 path.setFillType(SkPath::kEvenOdd_FillType);
2618 path.moveTo(925, 27);
2619 path.cubicTo(924.447693f, 27, 924, 27.4477158f, 924, 28);
2620 path.lineTo(924, 55);
2621 path.cubicTo(924, 55.5522842f, 924.447693f, 56, 925, 56);
2622 path.lineTo(1103, 56);
2623 path.cubicTo(1103.55225f, 56, 1104, 55.5522842f, 1104, 55);
2624 path.lineTo(1104, 28);
2625 path.cubicTo(1104, 27.4477158f, 1103.55225f, 27, 1103, 27);
2626 path.lineTo(925, 27);
2627 path.close();
2628 SkPath pathB;
2629 pathB.setFillType(SkPath::kWinding_FillType);
2630 pathB.moveTo(1103, 27);
2631 pathB.cubicTo(1104.10461f, 27, 1105, 27.8954315f, 1105, 29);
2632 pathB.lineTo(1105, 54);
2633 pathB.cubicTo(1105, 55.1045685f, 1104.10461f, 56, 1103, 56);
2634 pathB.lineTo(926, 56);
2635 pathB.cubicTo(924.895447f, 56, 924, 55.1045685f, 924, 54);
2636 pathB.lineTo(924, 29);
2637 pathB.cubicTo(924, 27.8954315f, 924.895447f, 27, 926, 27);
2638 pathB.lineTo(1103, 27);
2639 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002640 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002641}
2642
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002643static void skpbakosoft_com10(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002644 SkPath path;
2645 path.setFillType(SkPath::kEvenOdd_FillType);
2646 path.moveTo(190, 170);
2647 path.cubicTo(178.9543f, 170, 170, 178.9543f, 170, 190);
2648 path.cubicTo(170, 201.0457f, 178.9543f, 210, 190, 210);
2649 path.lineTo(370, 210);
2650 path.cubicTo(381.045685f, 210, 390, 201.0457f, 390, 190);
2651 path.cubicTo(390, 178.9543f, 381.045685f, 170, 370, 170);
2652 path.lineTo(190, 170);
2653 path.close();
2654 SkPath pathB;
2655 pathB.setFillType(SkPath::kWinding_FillType);
2656 pathB.moveTo(210, 190);
2657 pathB.quadTo(210, 198.284271f, 204.142136f, 204.142136f);
2658 pathB.quadTo(198.284271f, 210, 190, 210);
2659 pathB.quadTo(181.715729f, 210, 175.857864f, 204.142136f);
2660 pathB.quadTo(170, 198.284271f, 170, 190);
2661 pathB.quadTo(170, 181.715729f, 175.857864f, 175.857864f);
2662 pathB.quadTo(181.715729f, 170, 190, 170);
2663 pathB.quadTo(198.284271f, 170, 204.142136f, 175.857864f);
2664 pathB.quadTo(210, 181.715729f, 210, 190);
2665 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002666 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002667}
2668
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002669static void skpbambootheme_com12(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002670 SkPath path;
2671 path.setFillType(SkPath::kEvenOdd_FillType);
2672 path.moveTo(47.8780937f, 58);
2673 path.lineTo(0, 58);
2674 path.lineTo(-8.65973959e-015f, 96.9914017f);
2675 path.quadTo(20.0654926f, 96.6451874f, 34.3553391f, 82.3553391f);
2676 path.quadTo(44.9466133f, 71.764061f, 47.8780937f, 58);
2677 path.close();
2678 SkPath pathB;
2679 pathB.setFillType(SkPath::kEvenOdd_FillType);
2680 pathB.moveTo(-1, -3);
2681 pathB.lineTo(-1, -3);
2682 pathB.cubicTo(26.6142502f, -3, 49, 19.3857498f, 49, 47);
2683 pathB.lineTo(49, 47);
2684 pathB.cubicTo(49, 74.6142502f, 26.6142502f, 97, -1, 97);
2685 pathB.lineTo(-1, 97);
2686 pathB.cubicTo(-28.6142502f, 97, -51, 74.6142502f, -51, 47);
2687 pathB.lineTo(-51, 47);
2688 pathB.cubicTo(-51, 19.3857498f, -28.6142502f, -3, -1, -3);
2689 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002690 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002691}
2692
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002693static void skpakmmos_ru100(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002694 SkPath path;
2695 path.setFillType(SkPath::kEvenOdd_FillType);
2696 path.moveTo(693.000488f, 926);
2697 path.cubicTo(692.164734f, 925.37207f, 691.125793f, 925, 690, 925);
2698 path.lineTo(578, 925);
2699 path.cubicTo(576.874207f, 925, 575.835266f, 925.37207f, 574.999512f, 926);
2700 path.lineTo(693.000488f, 926);
2701 path.close();
2702 SkPath pathB;
2703 pathB.setFillType(SkPath::kWinding_FillType);
2704 pathB.moveTo(575, 925);
2705 pathB.lineTo(693, 925);
2706 pathB.lineTo(693, 926);
2707 pathB.lineTo(575, 926);
2708 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002709 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002710}
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002711
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002712static void skpcarpetplanet_ru22(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002713 SkPath path;
2714 path.setFillType(SkPath::kEvenOdd_FillType);
2715 path.moveTo(195, 785);
2716 path.cubicTo(124.307556f, 785, 67, 841.859863f, 67, 912);
2717 path.lineTo(67, 913);
2718 path.cubicTo(67, 917.388916f, 67.2243805f, 921.725769f, 67.662384f, 926);
2719 path.lineTo(322, 926);
2720 path.lineTo(322, 896.048035f);
2721 path.cubicTo(314.09201f, 833.437622f, 260.247131f, 785, 195, 785);
2722 path.close();
2723 SkPath pathB;
2724 pathB.setFillType(SkPath::kWinding_FillType);
2725 pathB.moveTo(195, 785);
2726 pathB.cubicTo(265.140167f, 785, 322, 842.307556f, 322, 913);
2727 pathB.cubicTo(322, 983.692444f, 265.140167f, 1041, 195, 1041);
2728 pathB.lineTo(194, 1041);
2729 pathB.cubicTo(123.85984f, 1041, 67, 983.692444f, 67, 913);
2730 pathB.cubicTo(67, 842.307556f, 123.85984f, 785, 194, 785);
2731 pathB.lineTo(195, 785);
2732 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002733 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002734}
2735
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002736static void skpcarrot_is24(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002737 SkPath path;
2738 path.setFillType(SkPath::kEvenOdd_FillType);
2739 path.moveTo(945, 597);
2740 path.quadTo(913.93396f, 597, 891.96698f, 618.96698f);
2741 path.quadTo(870, 640.93396f, 870, 672);
2742 path.quadTo(870, 703.06604f, 891.96698f, 725.03302f);
2743 path.quadTo(913.93396f, 747, 945, 747);
2744 path.quadTo(976.06604f, 747, 998.03302f, 725.03302f);
2745 path.quadTo(1020, 703.06604f, 1020, 672);
2746 path.quadTo(1020, 640.93396f, 998.03302f, 618.96698f);
2747 path.quadTo(976.06604f, 597, 945, 597);
2748 path.close();
2749 SkPath pathB;
2750 pathB.setFillType(SkPath::kWinding_FillType);
2751 pathB.moveTo(945.080994f, 597.161987f);
2752 pathB.cubicTo(903.659973f, 597.161987f, 870.080994f, 630.73999f, 870.080994f, 672.161987f);
2753 pathB.cubicTo(870.080994f, 676.096008f, 870.387024f, 679.957031f, 870.971008f, 683.726013f);
2754 pathB.cubicTo(876.53302f, 719.656006f, 907.593994f, 747.161987f, 945.080994f, 747.161987f);
2755 pathB.cubicTo(982.567993f, 747.161987f, 1013.62903f, 719.656006f, 1019.19104f, 683.726013f);
2756 pathB.cubicTo(1019.77502f, 679.955017f, 1020.08099f, 676.094971f, 1020.08099f, 672.161987f);
2757 pathB.cubicTo(1020.08002f, 630.73999f, 986.502014f, 597.161987f, 945.080994f, 597.161987f);
2758 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002759 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002760}
2761
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002762static void skpbangalorenest_com4(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002763 SkPath path;
2764 path.setFillType(SkPath::kEvenOdd_FillType);
2765 path.moveTo(0, 926);
2766 path.lineTo(0, 0);
2767 path.lineTo(1265, 0);
2768 path.lineTo(1265, 926);
2769 path.lineTo(0, 926);
2770 path.close();
2771 SkPath pathB;
2772 pathB.setFillType(SkPath::kWinding_FillType);
2773 pathB.moveTo(0, 290);
2774 pathB.lineTo(-2.64514972e-014f, 146);
2775 pathB.lineTo(30, 146);
2776 pathB.lineTo(30, 290);
2777 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002778 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002779}
2780
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002781static void skpbenzoteh_ru152(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002782 SkPath path;
2783 path.setFillType(SkPath::kEvenOdd_FillType);
2784 path.moveTo(883, 23);
2785 path.lineTo(883, 0);
2786 path.lineTo(1122.5f, 0);
2787 path.lineTo(1122.5f, 25.2136822f);
2788 path.quadTo(1122.14441f, 25.9271851f, 1121.53601f, 26.5359993f);
2789 path.quadTo(1120.07104f, 28, 1118, 28);
2790 path.lineTo(888, 28);
2791 path.quadTo(885.928955f, 28, 884.463989f, 26.5359993f);
2792 path.quadTo(883, 25.0710678f, 883, 23);
2793 path.close();
2794 SkPath pathB;
2795 pathB.setFillType(SkPath::kWinding_FillType);
2796 pathB.moveTo(883, 0);
2797 pathB.lineTo(1123, 0);
2798 pathB.lineTo(1123, 23);
2799 pathB.quadTo(1123, 25.0710678f, 1121.53601f, 26.5359993f);
2800 pathB.quadTo(1120.07104f, 28, 1118, 28);
2801 pathB.lineTo(888, 28);
2802 pathB.quadTo(885.928955f, 28, 884.463989f, 26.5359993f);
2803 pathB.quadTo(883, 25.0710678f, 883, 23);
2804 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002805 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002806}
2807
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002808static void skpbestred_ru37(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002809 SkPath path;
2810 path.setFillType(SkPath::kEvenOdd_FillType);
2811 path.moveTo(883, 23);
2812 path.lineTo(883, 0);
2813 path.lineTo(1122.5f, 0);
2814 path.lineTo(1122.5f, 25.2136822f);
2815 path.quadTo(1122.14441f, 25.9271851f, 1121.53601f, 26.5359993f);
2816 path.quadTo(1120.07104f, 28, 1118, 28);
2817 path.lineTo(888, 28);
2818 path.quadTo(885.928955f, 28, 884.463989f, 26.5359993f);
2819 path.quadTo(883, 25.0710678f, 883, 23);
2820 path.close();
2821 SkPath pathB;
2822 pathB.setFillType(SkPath::kWinding_FillType);
2823 pathB.moveTo(883, 0);
2824 pathB.lineTo(1123, 0);
2825 pathB.lineTo(1123, 23);
2826 pathB.quadTo(1123, 25.0710678f, 1121.53601f, 26.5359993f);
2827 pathB.quadTo(1120.07104f, 28, 1118, 28);
2828 pathB.lineTo(888, 28);
2829 pathB.quadTo(885.928955f, 28, 884.463989f, 26.5359993f);
2830 pathB.quadTo(883, 25.0710678f, 883, 23);
2831 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002832 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002833}
2834
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002835static void skpbingoentertainment_net189(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002836 SkPath path;
2837 path.setFillType(SkPath::kEvenOdd_FillType);
2838 path.moveTo(896, 745.38678f);
2839 path.lineTo(896, 873.38678f);
2840 path.lineTo(922.567993f, 876.683716f);
2841 path.lineTo(922.567993f, 748.683716f);
2842 path.lineTo(896, 745.38678f);
2843 path.close();
2844 SkPath pathB;
2845 pathB.setFillType(SkPath::kWinding_FillType);
2846 pathB.moveTo(899.200928f, 745.783997f);
2847 pathB.cubicTo(897.119385f, 745.525696f, 895.432007f, 752.031982f, 895.432007f, 760.316284f);
2848 pathB.lineTo(895.432007f, 858.316284f);
2849 pathB.cubicTo(895.432007f, 866.600586f, 897.119385f, 873.525696f, 899.200928f, 873.783997f);
2850 pathB.lineTo(918.799133f, 876.216003f);
2851 pathB.cubicTo(920.880615f, 876.474304f, 922.567993f, 869.968018f, 922.567993f, 861.683716f);
2852 pathB.lineTo(922.567993f, 763.683716f);
2853 pathB.cubicTo(922.567993f, 755.399414f, 920.880615f, 748.474304f, 918.799133f, 748.216003f);
2854 pathB.lineTo(899.200928f, 745.783997f);
2855 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002856 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002857}
2858
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002859static void skpcarrefour_ro62(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002860 SkPath path;
2861 path.setFillType(SkPath::kEvenOdd_FillType);
2862 path.moveTo(1104, 453);
2863 path.lineTo(399, 453);
2864 path.lineTo(399, 657);
2865 path.cubicTo(399, 661.970581f, 403.029449f, 666, 408, 666);
2866 path.lineTo(1095, 666);
2867 path.cubicTo(1099.97058f, 666, 1104, 661.970581f, 1104, 657);
2868 path.lineTo(1104, 453);
2869 path.close();
2870 SkPath pathB;
2871 pathB.setFillType(SkPath::kInverseWinding_FillType);
2872 pathB.moveTo(400, 453);
2873 pathB.lineTo(1103, 453);
2874 pathB.lineTo(1103, 666);
2875 pathB.lineTo(406, 666);
2876 pathB.cubicTo(402.686279f, 666, 400, 663.313721f, 400, 660);
2877 pathB.lineTo(400, 453);
2878 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002879 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002880}
2881
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002882static void skpcaffelavazzait_com_ua21(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002883 SkPath path;
2884 path.setFillType(SkPath::kEvenOdd_FillType);
2885 path.moveTo(883, 23);
2886 path.lineTo(883, 0);
2887 path.lineTo(1122.5f, 0);
2888 path.lineTo(1122.5f, 25.2136822f);
2889 path.quadTo(1122.14441f, 25.9271851f, 1121.53601f, 26.5359993f);
2890 path.quadTo(1120.07104f, 28, 1118, 28);
2891 path.lineTo(888, 28);
2892 path.quadTo(885.928955f, 28, 884.463989f, 26.5359993f);
2893 path.quadTo(883, 25.0710678f, 883, 23);
2894 path.close();
2895 SkPath pathB;
2896 pathB.setFillType(SkPath::kWinding_FillType);
2897 pathB.moveTo(883, 0);
2898 pathB.lineTo(1123, 0);
2899 pathB.lineTo(1123, 23);
2900 pathB.quadTo(1123, 25.0710678f, 1121.53601f, 26.5359993f);
2901 pathB.quadTo(1120.07104f, 28, 1118, 28);
2902 pathB.lineTo(888, 28);
2903 pathB.quadTo(885.928955f, 28, 884.463989f, 26.5359993f);
2904 pathB.quadTo(883, 25.0710678f, 883, 23);
2905 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002906 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002907}
2908
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002909static void skpcamcorder_kz21(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002910 SkPath path;
2911 path.setFillType(SkPath::kEvenOdd_FillType);
2912 path.moveTo(883, 23);
2913 path.lineTo(883, 0);
2914 path.lineTo(1122.5f, 0);
2915 path.lineTo(1122.5f, 25.2136822f);
2916 path.quadTo(1122.14441f, 25.9271851f, 1121.53601f, 26.5359993f);
2917 path.quadTo(1120.07104f, 28, 1118, 28);
2918 path.lineTo(888, 28);
2919 path.quadTo(885.928955f, 28, 884.463989f, 26.5359993f);
2920 path.quadTo(883, 25.0710678f, 883, 23);
2921 path.close();
2922 SkPath pathB;
2923 pathB.setFillType(SkPath::kWinding_FillType);
2924 pathB.moveTo(883, 0);
2925 pathB.lineTo(1123, 0);
2926 pathB.lineTo(1123, 23);
2927 pathB.quadTo(1123, 25.0710678f, 1121.53601f, 26.5359993f);
2928 pathB.quadTo(1120.07104f, 28, 1118, 28);
2929 pathB.lineTo(888, 28);
2930 pathB.quadTo(885.928955f, 28, 884.463989f, 26.5359993f);
2931 pathB.quadTo(883, 25.0710678f, 883, 23);
2932 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002933 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002934}
2935
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002936static void skpcavablar_net563(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002937 SkPath path;
2938 path.setFillType(SkPath::kEvenOdd_FillType);
2939 path.moveTo(160.000488f, 918);
2940 path.cubicTo(159.164749f, 917.37207f, 158.125824f, 917, 157, 917);
2941 path.lineTo(94, 917);
2942 path.cubicTo(92.874176f, 917, 91.8352661f, 917.37207f, 90.9995193f, 918);
2943 path.lineTo(160.000488f, 918);
2944 path.close();
2945 SkPath pathB;
2946 pathB.setFillType(SkPath::kWinding_FillType);
2947 pathB.moveTo(91, 917);
2948 pathB.lineTo(160, 917);
2949 pathB.lineTo(160, 918);
2950 pathB.lineTo(91, 918);
2951 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002952 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002953}
2954
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002955static void skpinsomnia_gr72(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002956 SkPath path;
2957 path.setFillType(SkPath::kEvenOdd_FillType);
2958 path.moveTo(1138, 231);
2959 path.lineTo(1137, 243.625748f);
2960 path.lineTo(1137, 926);
2961 path.lineTo(1139, 926);
2962 path.lineTo(1139, 231);
2963 path.lineTo(1138, 231);
2964 path.close();
2965 SkPath pathB;
2966 pathB.setFillType(SkPath::kWinding_FillType);
2967 pathB.moveTo(1139, 231);
2968 pathB.lineTo(1138, 231);
2969 pathB.lineTo(633, 6101);
2970 pathB.lineTo(1139, 6607);
caryclark54359292015-03-26 07:52:43 -07002971 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002972}
2973
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002974static void cubicOp95u(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002975 SkPath path, pathB;
2976 path.setFillType(SkPath::kEvenOdd_FillType);
2977 path.moveTo(0, 2);
2978 path.cubicTo(2, 3, 5, 1, 3, 2);
2979 path.close();
2980 pathB.setFillType(SkPath::kEvenOdd_FillType);
2981 pathB.moveTo(1, 5);
2982 pathB.cubicTo(2, 3, 2, 0, 3, 2);
2983 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002984 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002985}
2986
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00002987static void cubicOp96d(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comb0a05892013-10-03 07:01:37 +00002988 SkPath path, pathB;
2989 path.setFillType(SkPath::kEvenOdd_FillType);
2990 path.moveTo(1, 6);
2991 path.cubicTo(0, 3, 6, 3, 5, 0);
2992 path.close();
2993 pathB.setFillType(SkPath::kEvenOdd_FillType);
2994 pathB.moveTo(3, 6);
2995 pathB.cubicTo(0, 5, 6, 1, 3, 0);
2996 pathB.close();
caryclark54359292015-03-26 07:52:43 -07002997 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00002998}
2999
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00003000static void cubicOp97x(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comf54ad6f2013-11-02 07:02:02 +00003001 SkPath path, pathB;
3002 path.setFillType(SkPath::kEvenOdd_FillType);
3003 path.moveTo(0, 2);
3004 path.cubicTo(0, 6, 2, 1, 2, 1);
3005 path.close();
3006 pathB.setFillType(SkPath::kEvenOdd_FillType);
3007 pathB.moveTo(1, 2);
3008 pathB.cubicTo(1, 2, 2, 0, 6, 0);
3009 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003010 testPathOp(reporter, path, pathB, kXOR_SkPathOp, filename);
caryclark@google.coma2bbc6e2013-11-01 17:36:03 +00003011}
3012
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00003013static void cubicOp98x(skiatest::Reporter* reporter, const char* filename) {
skia.committer@gmail.comf54ad6f2013-11-02 07:02:02 +00003014 SkPath path, pathB;
3015 path.setFillType(SkPath::kEvenOdd_FillType);
3016 path.moveTo(0, 3);
3017 path.cubicTo(3, 6, 4, 1, 6, 3);
3018 path.close();
3019 pathB.setFillType(SkPath::kEvenOdd_FillType);
3020 pathB.moveTo(1, 4);
3021 pathB.cubicTo(3, 6, 3, 0, 6, 3);
3022 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003023 testPathOp(reporter, path, pathB, kXOR_SkPathOp, filename);
caryclark@google.coma2bbc6e2013-11-01 17:36:03 +00003024}
3025
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00003026static void cubicOp99(skiatest::Reporter* reporter, const char* filename) {
commit-bot@chromium.org866f4e32013-11-21 17:04:29 +00003027 SkPath path, pathB;
3028 path.setFillType(SkPath::kWinding_FillType);
3029 path.moveTo(3,6);
3030 path.cubicTo(0,3, 6,5, 5,4);
3031 path.close();
3032 pathB.setFillType(SkPath::kWinding_FillType);
3033 pathB.moveTo(5,6);
3034 pathB.cubicTo(4,5, 6,3, 3,0);
3035 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003036 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
commit-bot@chromium.org866f4e32013-11-21 17:04:29 +00003037}
3038
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00003039static void cubicOp100(skiatest::Reporter* reporter, const char* filename) {
commit-bot@chromium.org866f4e32013-11-21 17:04:29 +00003040 SkPath path, pathB;
3041 path.setFillType(SkPath::kWinding_FillType);
3042 path.moveTo(0,1);
3043 path.cubicTo(0,2, 2,1, 4,2);
3044 path.close();
3045 pathB.setFillType(SkPath::kWinding_FillType);
3046 pathB.moveTo(1,2);
3047 pathB.cubicTo(2,4, 1,0, 2,0);
3048 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003049 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
commit-bot@chromium.org866f4e32013-11-21 17:04:29 +00003050}
3051
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00003052static void cubicOp101(skiatest::Reporter* reporter, const char* filename) {
commit-bot@chromium.org866f4e32013-11-21 17:04:29 +00003053 SkPath path, pathB;
3054 path.setFillType(SkPath::kWinding_FillType);
3055 path.moveTo(0, 1);
3056 path.cubicTo(2, 3, 2, 1, 5, 3);
3057 path.close();
3058 pathB.setFillType(SkPath::kWinding_FillType);
3059 pathB.moveTo(1, 2);
3060 pathB.cubicTo(3, 5, 1, 0, 3, 2);
3061 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003062 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
commit-bot@chromium.org866f4e32013-11-21 17:04:29 +00003063}
3064
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00003065static void cubicOp102(skiatest::Reporter* reporter, const char* filename) {
3066 SkPath path, pathB;
3067 path.setFillType(SkPath::kWinding_FillType);
3068 path.moveTo(0,1);
3069 path.cubicTo(1,2, 1,0, 3,0);
3070 path.close();
3071 pathB.setFillType(SkPath::kWinding_FillType);
3072 pathB.moveTo(0,1);
3073 pathB.cubicTo(0,3, 1,0, 2,1);
3074 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003075 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00003076}
3077
3078static void cubicOp103(skiatest::Reporter* reporter, const char* filename) {
3079 SkPath path, pathB;
3080 path.setFillType(SkPath::kWinding_FillType);
3081 path.moveTo(0,1);
3082 path.cubicTo(1,5, 2,0, 2,1);
3083 path.close();
3084 pathB.setFillType(SkPath::kWinding_FillType);
3085 pathB.moveTo(0,2);
3086 pathB.cubicTo(1,2, 1,0, 5,1);
3087 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003088 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00003089}
3090
3091static void cubicOp104(skiatest::Reporter* reporter, const char* filename) {
3092 SkPath path, pathB;
3093 path.setFillType(SkPath::kWinding_FillType);
3094 path.moveTo(0,1);
3095 path.cubicTo(0,6, 4,0, 6,1);
3096 path.close();
3097 pathB.setFillType(SkPath::kWinding_FillType);
3098 pathB.moveTo(0,4);
3099 pathB.cubicTo(1,6, 1,0, 6,0);
3100 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003101 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00003102}
3103
3104static void cubicOp105(skiatest::Reporter* reporter, const char* filename) {
3105 SkPath path, pathB;
3106 path.setFillType(SkPath::kWinding_FillType);
3107 path.moveTo(0,1);
3108 path.cubicTo(0,4, 6,5, 2,0);
3109 path.close();
3110 pathB.setFillType(SkPath::kWinding_FillType);
3111 pathB.moveTo(5,6);
3112 pathB.cubicTo(0,2, 1,0, 4,0);
3113 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003114 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00003115}
3116
3117static void cubicOp106(skiatest::Reporter* reporter, const char* filename) {
3118 SkPath path, pathB;
3119 path.setFillType(SkPath::kWinding_FillType);
3120 path.moveTo(0, 1);
3121 path.cubicTo(4, 6, 2, 1, 2, 0);
3122 path.close();
3123 pathB.setFillType(SkPath::kWinding_FillType);
3124 pathB.moveTo(1, 2);
3125 pathB.cubicTo(0, 2, 1, 0, 6, 4);
3126 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003127 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00003128}
3129
3130static void cubicOp107(skiatest::Reporter* reporter, const char* filename) {
3131 SkPath path, pathB;
3132 path.setFillType(SkPath::kWinding_FillType);
3133 path.moveTo(0, 1);
3134 path.cubicTo(4, 6, 2, 1, 2, 0);
3135 path.close();
3136 pathB.setFillType(SkPath::kWinding_FillType);
3137 pathB.moveTo(1, 2);
3138 pathB.cubicTo(0, 2, 1, 0, 6, 4);
3139 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003140 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00003141}
3142
3143static void cubicOp108(skiatest::Reporter* reporter, const char* filename) {
3144 SkPath path, pathB;
3145 path.setFillType(SkPath::kWinding_FillType);
3146 path.moveTo(0, 1);
3147 path.cubicTo(4, 6, 2, 1, 2, 0);
3148 path.close();
3149 pathB.setFillType(SkPath::kWinding_FillType);
3150 pathB.moveTo(1, 2);
3151 pathB.cubicTo(0, 2, 1, 0, 6, 4);
3152 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003153 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00003154}
3155
3156static void cubicOp109(skiatest::Reporter* reporter, const char* filename) {
3157 SkPath path, pathB;
3158 path.setFillType(SkPath::kWinding_FillType);
3159 path.moveTo(0,1);
3160 path.cubicTo(4,5, 6,3, 5,4);
3161 path.close();
3162 pathB.setFillType(SkPath::kWinding_FillType);
3163 pathB.moveTo(3,6);
3164 pathB.cubicTo(4,5, 1,0, 5,4);
3165 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003166 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00003167}
3168
3169static void cubicOp110(skiatest::Reporter* reporter, const char* filename) {
3170 SkPath path, pathB;
3171 path.setFillType(SkPath::kEvenOdd_FillType);
3172 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3173 path.addRect(0, 0, 4, 4, SkPath::kCW_Direction);
3174 pathB.setFillType(SkPath::kEvenOdd_FillType);
3175 pathB.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
3176 pathB.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
caryclark54359292015-03-26 07:52:43 -07003177 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00003178}
3179
3180static void cubicOp111(skiatest::Reporter* reporter, const char* filename) {
3181 SkPath path, pathB;
3182 path.setFillType(SkPath::kWinding_FillType);
3183 path.moveTo(1,4);
3184 path.cubicTo(0,5, 4,1, 3,1);
3185 path.close();
3186 pathB.setFillType(SkPath::kWinding_FillType);
3187 pathB.moveTo(1,4);
3188 pathB.cubicTo(1,3, 4,1, 5,0);
3189 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003190 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00003191}
3192
3193static void xOp1u(skiatest::Reporter* reporter, const char* filename) {
3194 SkPath path, pathB;
3195 path.setFillType(SkPath::kEvenOdd_FillType);
3196 path.moveTo(1, 4);
3197 path.cubicTo(4, 5, 3, 2, 6, 3);
3198 path.close();
3199 pathB.setFillType(SkPath::kEvenOdd_FillType);
3200 pathB.moveTo(2, 3);
3201 pathB.cubicTo(3, 6, 4, 1, 5, 4);
3202 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003203 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00003204}
3205
3206static void xOp1i(skiatest::Reporter* reporter, const char* filename) {
3207 SkPath path, pathB;
3208 path.setFillType(SkPath::kEvenOdd_FillType);
3209 path.moveTo(1, 4);
3210 path.cubicTo(1, 5, 6, 0, 5, 1);
3211 path.close();
3212 pathB.setFillType(SkPath::kEvenOdd_FillType);
3213 pathB.moveTo(0, 6);
3214 pathB.cubicTo(1, 5, 4, 1, 5, 1);
3215 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003216 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00003217}
3218
3219static void xOp2i(skiatest::Reporter* reporter, const char* filename) {
3220 SkPath path, pathB;
3221 path.setFillType(SkPath::kEvenOdd_FillType);
3222 path.moveTo(1, 5);
3223 path.cubicTo(0, 4, 3, 2, 6, 1);
3224 path.close();
3225 pathB.setFillType(SkPath::kEvenOdd_FillType);
3226 pathB.moveTo(2, 3);
3227 pathB.cubicTo(1, 6, 5, 1, 4, 0);
3228 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003229 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00003230}
3231
3232static void xOp3i(skiatest::Reporter* reporter, const char* filename) {
3233 SkPath path, pathB;
3234 path.setFillType(SkPath::kWinding_FillType);
3235 path.moveTo(1,4);
3236 path.cubicTo(0,5, 4,1, 3,1);
3237 path.close();
3238 pathB.setFillType(SkPath::kWinding_FillType);
3239 pathB.moveTo(1,4);
3240 pathB.cubicTo(1,3, 4,1, 5,0);
3241 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003242 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00003243}
3244
3245static void findFirst1(skiatest::Reporter* reporter, const char* filename) {
3246 SkPath path, pathB;
3247 path.setFillType(SkPath::kWinding_FillType);
3248 path.moveTo(0,1);
3249 path.cubicTo(1,6, 5,0, 2,1);
3250 path.close();
3251 pathB.setFillType(SkPath::kWinding_FillType);
3252 pathB.moveTo(0,5);
3253 pathB.cubicTo(1,2, 1,0, 6,1);
3254 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003255 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00003256}
3257
commit-bot@chromium.org8cb1daa2014-04-25 12:59:11 +00003258static void cubicOp112(skiatest::Reporter* reporter, const char* filename) {
3259 SkPath path, pathB;
3260 path.setFillType(SkPath::kWinding_FillType);
3261 path.moveTo(2,4);
3262 path.cubicTo(2,3, 6,4, 1,0);
3263 path.close();
3264 pathB.setFillType(SkPath::kWinding_FillType);
3265 pathB.moveTo(4,6);
3266 pathB.cubicTo(0,1, 4,2, 3,2);
3267 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003268 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
commit-bot@chromium.org8cb1daa2014-04-25 12:59:11 +00003269}
3270
commit-bot@chromium.org8cb1daa2014-04-25 12:59:11 +00003271static void cubicOp113(skiatest::Reporter* reporter, const char* filename) {
3272 SkPath path, pathB;
3273 path.moveTo(2,4);
3274 path.cubicTo(3,5, 2.33333325f,4.33333349f, 3.83333325f,3.83333349f);
3275 path.close();
3276 pathB.moveTo(3,5);
3277 pathB.cubicTo(2.33333325f,4.33333349f, 3.83333325f,3.83333349f, 2,4);
3278 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003279 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
commit-bot@chromium.org8cb1daa2014-04-25 12:59:11 +00003280}
commit-bot@chromium.org8cb1daa2014-04-25 12:59:11 +00003281
3282static void cubicOp114(skiatest::Reporter* reporter, const char* filename) {
3283 SkPath path, pathB;
3284 path.setFillType(SkPath::kWinding_FillType);
3285 path.moveTo(0, 1);
3286 path.cubicTo(1, 3, -1, 2, 3.5f, 1.33333337f);
3287 path.close();
3288 pathB.setFillType(SkPath::kWinding_FillType);
3289 pathB.moveTo(1, 3);
3290 pathB.cubicTo(-1, 2, 3.5f, 1.33333337f, 0, 1);
3291 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003292 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
commit-bot@chromium.org8cb1daa2014-04-25 12:59:11 +00003293}
caryclarke4097e32014-06-18 07:24:19 -07003294
3295static void cubicOp114asQuad(skiatest::Reporter* reporter, const char* filename) {
3296 SkPath path, pathB;
3297 path.setFillType(SkPath::kWinding_FillType);
3298 path.moveTo(0, 1);
3299 path.cubicTo(1, 3, -1, 2, 3.5f, 1.33333337f);
3300 path.close();
3301 pathB.setFillType(SkPath::kWinding_FillType);
3302 pathB.moveTo(1, 3);
3303 pathB.cubicTo(-1, 2, 3.5f, 1.33333337f, 0, 1);
3304 pathB.close();
3305 SkPath qPath, qPathB;
3306 CubicPathToQuads(path, &qPath);
3307 CubicPathToQuads(pathB, &qPathB);
caryclark54359292015-03-26 07:52:43 -07003308 testPathOp(reporter, qPath, qPathB, kIntersect_SkPathOp, filename);
caryclarke4097e32014-06-18 07:24:19 -07003309}
commit-bot@chromium.org8cb1daa2014-04-25 12:59:11 +00003310
3311static void quadOp10i(skiatest::Reporter* reporter, const char* filename) {
3312 SkPath path, pathB;
3313 path.moveTo(0, 0);
3314 path.quadTo(1, 8, 3, 5);
3315 path.lineTo(8, 1);
3316 path.close();
3317 pathB.moveTo(0, 0);
3318 pathB.quadTo(8, 1, 4, 8);
3319 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003320 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
commit-bot@chromium.org8cb1daa2014-04-25 12:59:11 +00003321}
3322
commit-bot@chromium.org91fc81c2014-04-30 13:37:48 +00003323static void kari1(skiatest::Reporter* reporter, const char* filename) {
3324 SkPath path1;
3325 path1.moveTo(39.9375, -5.8359375);
3326 path1.lineTo(40.625, -5.7890625);
3327 path1.lineTo(37.7109375, 1.3515625);
3328 path1.lineTo(37.203125, 0.9609375);
3329 path1.close();
3330
3331 SkPath path2;
3332 path2.moveTo(37.52734375f, -1.44140625f);
3333 path2.cubicTo(37.8736991882324f, -1.69921875f, 38.1640625f, -2.140625f, 38.3984375f, -2.765625f);
3334 path2.lineTo(38.640625f, -2.609375f);
3335 path2.cubicTo(38.53125f, -1.89583337306976f, 38.0664443969727f, -0.154893040657043f, 38.0664443969727f, -0.154893040657043f);
3336 path2.cubicTo(38.0664443969727f, -0.154893040657043f, 37.1809883117676f, -1.18359375f, 37.52734375, -1.44140625f);
3337 path2.close();
3338
caryclark54359292015-03-26 07:52:43 -07003339 testPathOp(reporter, path1, path2, kDifference_SkPathOp, filename);
commit-bot@chromium.org91fc81c2014-04-30 13:37:48 +00003340}
3341
commit-bot@chromium.org2db7fe72014-05-07 15:31:40 +00003342static void issue2504(skiatest::Reporter* reporter, const char* filename) {
3343 SkPath path1;
3344 path1.moveTo(34.2421875, -5.976562976837158203125);
3345 path1.lineTo(35.453121185302734375, 0);
3346 path1.lineTo(31.9375, 0);
3347 path1.close();
3348
3349 SkPath path2;
3350 path2.moveTo(36.71843719482421875, 0.8886508941650390625);
3351 path2.cubicTo(36.71843719482421875, 0.8886508941650390625,
3352 35.123386383056640625, 0.554015457630157470703125,
3353 34.511409759521484375, -0.1152553558349609375);
3354 path2.cubicTo(33.899425506591796875, -0.7845261096954345703125,
3355 34.53484344482421875, -5.6777553558349609375,
3356 34.53484344482421875, -5.6777553558349609375);
3357 path2.close();
caryclark54359292015-03-26 07:52:43 -07003358 testPathOp(reporter, path1, path2, kUnion_SkPathOp, filename);
commit-bot@chromium.org2db7fe72014-05-07 15:31:40 +00003359}
3360
caryclarkdac1d172014-06-17 05:15:38 -07003361static void issue2540(skiatest::Reporter* reporter, const char* filename) {
3362 SkPath path1;
3363 path1.moveTo(26.5054988861083984375, 85.73960113525390625);
3364 path1.cubicTo(84.19739532470703125, 17.77140045166015625, 16.93920135498046875, 101.86199951171875, 12.631000518798828125, 105.24700164794921875);
3365 path1.cubicTo(11.0819997787475585937500000, 106.46399688720703125, 11.5260000228881835937500000, 104.464996337890625, 11.5260000228881835937500000, 104.464996337890625);
3366 path1.lineTo(23.1654987335205078125, 89.72879791259765625);
3367 path1.cubicTo(23.1654987335205078125, 89.72879791259765625, -10.1713008880615234375, 119.9160003662109375, -17.1620006561279296875, 120.8249969482421875);
3368 path1.cubicTo(-19.1149997711181640625, 121.07900238037109375, -18.0380001068115234375, 119.79299163818359375, -18.0380001068115234375, 119.79299163818359375);
3369 path1.cubicTo(-18.0380001068115234375, 119.79299163818359375, 14.22100067138671875, 90.60700225830078125, 26.5054988861083984375, 85.73960113525390625);
3370 path1.close();
3371
3372 SkPath path2;
3373 path2.moveTo(-25.077999114990234375, 124.9120025634765625);
3374 path2.cubicTo(-25.077999114990234375, 124.9120025634765625, -25.9509983062744140625, 125.95400238037109375, -24.368999481201171875, 125.7480010986328125);
3375 path2.cubicTo(-16.06999969482421875, 124.66899871826171875, 1.2680000066757202148437500, 91.23999786376953125, 37.264003753662109375, 95.35400390625);
3376 path2.cubicTo(37.264003753662109375, 95.35400390625, 11.3710002899169921875, 83.7339935302734375, -25.077999114990234375, 124.9120025634765625);
3377 path2.close();
caryclark54359292015-03-26 07:52:43 -07003378 testPathOp(reporter, path1, path2, kUnion_SkPathOp, filename);
caryclarkdac1d172014-06-17 05:15:38 -07003379}
caryclarkdac1d172014-06-17 05:15:38 -07003380
3381static void rects1(skiatest::Reporter* reporter, const char* filename) {
3382 SkPath path, pathB;
3383 path.setFillType(SkPath::kEvenOdd_FillType);
3384 path.moveTo(0, 0);
3385 path.lineTo(1, 0);
3386 path.lineTo(1, 1);
3387 path.lineTo(0, 1);
3388 path.close();
3389 path.moveTo(0, 0);
3390 path.lineTo(6, 0);
3391 path.lineTo(6, 6);
3392 path.lineTo(0, 6);
3393 path.close();
3394 pathB.setFillType(SkPath::kEvenOdd_FillType);
3395 pathB.moveTo(0, 0);
3396 pathB.lineTo(1, 0);
3397 pathB.lineTo(1, 1);
3398 pathB.lineTo(0, 1);
3399 pathB.close();
3400 pathB.moveTo(0, 0);
3401 pathB.lineTo(2, 0);
3402 pathB.lineTo(2, 2);
3403 pathB.lineTo(0, 2);
3404 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003405 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
caryclarkdac1d172014-06-17 05:15:38 -07003406}
3407
3408static void rects2(skiatest::Reporter* reporter, const char* filename) {
3409 SkPath path, pathB;
3410 path.setFillType(SkPath::kEvenOdd_FillType);
3411 path.moveTo(0, 0);
3412 path.lineTo(4, 0);
3413 path.lineTo(4, 4);
3414 path.lineTo(0, 4);
3415 path.close();
3416 path.moveTo(3, 3);
3417 path.lineTo(4, 3);
3418 path.lineTo(4, 4);
3419 path.lineTo(3, 4);
3420 path.close();
3421 pathB.setFillType(SkPath::kWinding_FillType);
3422 pathB.moveTo(3, 3);
3423 pathB.lineTo(6, 3);
3424 pathB.lineTo(6, 6);
3425 pathB.lineTo(3, 6);
3426 pathB.close();
3427 pathB.moveTo(3, 3);
3428 pathB.lineTo(4, 3);
3429 pathB.lineTo(4, 4);
3430 pathB.lineTo(3, 4);
3431 pathB.close();
caryclark54359292015-03-26 07:52:43 -07003432 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclarkdac1d172014-06-17 05:15:38 -07003433}
3434
3435static void rects3(skiatest::Reporter* reporter, const char* filename) {
3436 SkPath path, pathB;
3437 path.setFillType(SkPath::kEvenOdd_FillType);
3438 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3439 path.addRect(0, 0, 4, 4, SkPath::kCW_Direction);
3440 pathB.setFillType(SkPath::kWinding_FillType);
3441 pathB.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
3442 pathB.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
caryclark54359292015-03-26 07:52:43 -07003443 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclarkdac1d172014-06-17 05:15:38 -07003444}
3445
3446static void rects4(skiatest::Reporter* reporter, const char* filename) {
3447 SkPath path, pathB;
3448 path.setFillType(SkPath::kEvenOdd_FillType);
3449 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3450 path.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
3451 pathB.setFillType(SkPath::kWinding_FillType);
3452 pathB.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
3453 pathB.addRect(0, 0, 3, 3, SkPath::kCW_Direction);
caryclark54359292015-03-26 07:52:43 -07003454 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclarkdac1d172014-06-17 05:15:38 -07003455}
3456
caryclark19eb3b22014-07-18 05:08:14 -07003457static void issue2753(skiatest::Reporter* reporter, const char* filename) {
3458 SkPath path1;
3459 path1.moveTo(142.701f, 110.568f);
3460 path1.lineTo(142.957f, 100);
3461 path1.lineTo(153.835f, 100);
3462 path1.lineTo(154.592f, 108.188f);
3463 path1.cubicTo(154.592f, 108.188f, 153.173f, 108.483f, 152.83f, 109.412f);
3464 path1.cubicTo(152.83f, 109.412f, 142.701f, 110.568f, 142.701f, 110.568f);
3465 path1.close();
3466
3467 SkPath path2;
3468 path2.moveTo(39, 124.001f);
3469 path2.cubicTo(39, 124.001f, 50.6f, 117.001f, 50.6f, 117.001f);
3470 path2.cubicTo(50.6f, 117.001f, 164.601f, 85.2f, 188.201f, 117.601f);
3471 path2.cubicTo(188.201f, 117.601f, 174.801f, 93, 39, 124.001f);
3472 path2.close();
3473
caryclark54359292015-03-26 07:52:43 -07003474 testPathOp(reporter, path1, path2, kUnion_SkPathOp, filename);
caryclark19eb3b22014-07-18 05:08:14 -07003475}
caryclark19eb3b22014-07-18 05:08:14 -07003476
caryclark80a83ad2014-08-12 05:49:37 -07003477static void issue2808(skiatest::Reporter* reporter, const char* filename) {
3478 SkPath path1, path2;
3479
3480 path1.moveTo(509.20300293f, 385.601989746f);
3481 path1.quadTo(509.20300293f, 415.68838501f, 487.928710938f, 436.96270752f);
3482 path1.quadTo(466.654388428f, 458.236999512f, 436.567993164f, 458.236999512f);
3483 path1.quadTo(406.4815979f, 458.236999512f, 385.207275391f, 436.96270752f);
3484 path1.quadTo(363.932983398f, 415.68838501f, 363.932983398f, 385.601989746f);
3485 path1.quadTo(363.932983398f, 355.515594482f, 385.207275391f, 334.241271973f);
3486 path1.quadTo(406.4815979f, 312.96697998f, 436.567993164f, 312.96697998f);
3487 path1.quadTo(466.654388428f, 312.96697998f, 487.928710938f, 334.241271973f);
3488 path1.quadTo(509.20300293f, 355.515594482f, 509.20300293f, 385.601989746f);
3489 path1.close();
3490
3491 path2.moveTo(449.033996582f, 290.87298584f);
3492 path2.quadTo(449.033996582f, 301.028259277f, 441.853149414f, 308.209106445f);
3493 path2.quadTo(434.672271729f, 315.389984131f, 424.516998291f, 315.389984131f);
3494 path2.quadTo(414.361724854f, 315.389984131f, 407.180847168f, 308.209106445f);
3495 path2.quadTo(400, 301.028259277f, 400, 290.87298584f);
3496 path2.quadTo(400, 280.717712402f, 407.180847168f, 273.536865234f);
3497 path2.quadTo(414.361724854f, 266.355987549f, 424.516998291f, 266.355987549f);
3498 path2.quadTo(434.672271729f, 266.355987549f, 441.853149414f, 273.536865234f);
3499 path2.quadTo(449.033996582f, 280.717712402f, 449.033996582f, 290.87298584f);
3500 path2.close();
3501
caryclark54359292015-03-26 07:52:43 -07003502 testPathOp(reporter, path1, path2, kUnion_SkPathOp, filename);
caryclark80a83ad2014-08-12 05:49:37 -07003503}
3504
caryclark65f55312014-11-13 06:58:52 -08003505static void cubicOp115(skiatest::Reporter* reporter, const char* filename) {
3506 SkPath path, pathB;
3507 path.setFillType(SkPath::kWinding_FillType);
3508 path.moveTo(0,1);
3509 path.cubicTo(3,4, 2,1, 5,3);
3510 path.close();
3511 pathB.setFillType(SkPath::kWinding_FillType);
3512 pathB.moveTo(1,2);
3513 pathB.cubicTo(3,5, 1,0, 4,3);
3514 pathB.close();
3515 SkPath path2(path);
caryclark54359292015-03-26 07:52:43 -07003516 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark65f55312014-11-13 06:58:52 -08003517}
3518
caryclark54359292015-03-26 07:52:43 -07003519static void testRect1(skiatest::Reporter* reporter, const char* filename) {
3520 SkPath path, path2;
3521 path.addRect(0, 0, 60, 60, SkPath::kCCW_Direction);
3522 path.addRect(30, 20, 50, 50, SkPath::kCCW_Direction);
3523 path.addRect(24, 20, 36, 30, SkPath::kCCW_Direction);
3524// path.addRect(32, 24, 36, 41, SkPath::kCCW_Direction);
3525 testPathOp(reporter, path, path2, kUnion_SkPathOp, filename);
3526}
3527
3528static void testRect2(skiatest::Reporter* reporter, const char* filename) {
3529 SkPath path, pathB;
3530 path.setFillType(SkPath::kWinding_FillType);
3531 path.addRect(0, 0, 1, 1, SkPath::kCW_Direction);
3532 path.addRect(4, 4, 5, 5, SkPath::kCW_Direction);
3533 pathB.setFillType(SkPath::kEvenOdd_FillType);
3534 pathB.addRect(0, 0, 2, 2, SkPath::kCW_Direction);
3535 pathB.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
3536 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3537}
3538
3539static void cubicOp116(skiatest::Reporter* reporter, const char* filename) {
3540 SkPath path, pathB;
3541 path.setFillType(SkPath::kWinding_FillType);
3542 path.moveTo(0,1);
3543 path.cubicTo(4,6, 2,0, 2,0);
3544 path.close();
3545 pathB.setFillType(SkPath::kWinding_FillType);
3546 pathB.moveTo(0,2);
3547 pathB.cubicTo(0,2, 1,0, 6,4);
3548 pathB.close();
3549 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3550}
3551
3552static void cubicOp117(skiatest::Reporter* reporter, const char* filename) {
3553 SkPath path, pathB;
3554 path.setFillType(SkPath::kWinding_FillType);
3555 path.moveTo(0,1);
3556 path.cubicTo(4,5, 6,0, 1,0);
3557 path.close();
3558 pathB.setFillType(SkPath::kWinding_FillType);
3559 pathB.moveTo(0,6);
3560 pathB.cubicTo(0,1, 1,0, 5,4);
3561 pathB.close();
3562 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3563}
3564
3565static void cubicOp118(skiatest::Reporter* reporter, const char* filename) {
3566 SkPath path, pathB;
3567 path.setFillType(SkPath::kWinding_FillType);
3568 path.moveTo(0,1);
3569 path.cubicTo(4,6, 5,1, 6,2);
3570 path.close();
3571 pathB.setFillType(SkPath::kWinding_FillType);
3572 pathB.moveTo(1,5);
3573 pathB.cubicTo(2,6, 1,0, 6,4);
3574 pathB.close();
3575 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3576}
3577
3578static void loop1(skiatest::Reporter* reporter, const char* filename) {
3579 SkPath path, pathB;
3580 path.moveTo(0,1);
3581 path.cubicTo(1,5, -5.66666651f,3.33333349f, 8.83333302f,2.33333349f);
3582 path.close();
3583 pathB.moveTo(1,5);
3584 pathB.cubicTo(-5.66666651f,3.33333349f, 8.83333302f,2.33333349f, 0,1);
3585 pathB.close();
3586 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
3587}
3588
3589#include "SkPathOpsCubic.h"
3590
3591static void loop1asQuad(skiatest::Reporter* reporter, const char* filename) {
3592 SkDCubic c1 = {{{0,1}, {1,5}, {-5.66666651f,3.33333349f}, {8.83333302f,2.33333349f}}};
3593 SkDCubic c2 = {{{1,5}, {-5.66666651f,3.33333349f}, {8.83333302f,2.33333349f}, {0,1}}};
3594 double c1InflectionTs[2], c2InflectionTs[2];
3595 SkDEBUGCODE(int c1InfTCount =) c1.findInflections(c1InflectionTs);
3596 SkASSERT(c1InfTCount == 2);
3597 SkDEBUGCODE(int c2InfTCount =) c2.findInflections(c2InflectionTs);
3598 SkASSERT(c2InfTCount == 1);
3599 SkASSERT(c1InflectionTs[0] > c1InflectionTs[1]);
3600 SkDCubicPair c1pair = c1.chopAt(c1InflectionTs[0]);
3601 SkDCubicPair c1apair = c1pair.first().chopAt(c1InflectionTs[1]);
3602 SkDCubicPair c2pair = c2.chopAt(c2InflectionTs[0]);
3603 SkDQuad q1[2] = { c1pair.first().toQuad(), c1pair.second().toQuad() };
3604 SkDQuad q1a[2] = { c1apair.first().toQuad(), c1apair.second().toQuad() };
3605 SkDQuad q2[2] = { c2pair.first().toQuad(), c2pair.second().toQuad() };
3606 SkPath path, pathB;
3607 path.moveTo(q1a[0].fPts[0].asSkPoint());
3608 path.quadTo(q1a[0].fPts[1].asSkPoint(), q1a[0].fPts[2].asSkPoint());
3609 path.quadTo(q1a[1].fPts[1].asSkPoint(), q1a[1].fPts[2].asSkPoint());
3610 path.quadTo(q1[1].fPts[1].asSkPoint(), q1[1].fPts[2].asSkPoint());
3611 path.close();
3612 pathB.moveTo(q2[0].fPts[0].asSkPoint());
3613 pathB.quadTo(q2[0].fPts[1].asSkPoint(), q2[0].fPts[2].asSkPoint());
3614 pathB.quadTo(q2[1].fPts[1].asSkPoint(), q2[1].fPts[2].asSkPoint());
3615 pathB.close();
3616 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
3617}
3618
3619static void loop2(skiatest::Reporter* reporter, const char* filename) {
3620 SkPath path, pathB;
3621 path.moveTo(0,1);
3622 path.cubicTo(3,4, 3.f,4.f, 4.5f,1.5f);
3623 path.close();
3624 pathB.moveTo(3,4);
3625 pathB.cubicTo(3.f,4.f, 4.5f,1.5f, 0,1);
3626 pathB.close();
3627 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
3628}
3629
3630static void loop3(skiatest::Reporter* reporter, const char* filename) {
3631 SkPath path, pathB;
3632 path.moveTo(0,1);
3633 path.cubicTo(3,5, -3.66666651f,0, 10.5f,-1.66666651f);
3634 path.close();
3635 pathB.moveTo(3,5);
3636 pathB.cubicTo(-3.66666651f,0, 10.5f,-1.66666651f, 0,1);
3637 pathB.close();
3638 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
3639}
3640
3641static void loop4(skiatest::Reporter* reporter, const char* filename) {
3642 SkPath path, pathB;
3643 path.moveTo(0,5);
3644 path.cubicTo(1,5, 1,4, 0.833333313f,3);
3645 path.close();
3646 pathB.moveTo(1,5);
3647 pathB.cubicTo(1,4, 0.833333313f,3, 0,5);
3648 pathB.close();
3649 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
3650}
3651
3652#include "SkParsePath.h"
3653
3654static void issue3517(skiatest::Reporter* reporter, const char* filename) {
3655 SkPath path, pathB;
3656
3657 const char str[] = "M31.35 57.75L31.35 57.75C31.9 57.7486 32.45 57.7948 33 57.7413C33.55 57.6878 34.1 57.5014 34.65 57.4291C35.2 57.3569 35.75 57.3223 36.3 57.3079C36.85 57.2935 37.4 57.3143 37.95 57.3428C38.5 57.3712 39.05 57.4112 39.6 57.4786C40.15 57.546 40.7 57.7029 41.25 57.7472C41.8 57.7916 42.35 57.7962 42.9 57.7445C43.45 57.6928 44 57.5345 44.55 57.4373C45.1 57.34 45.65 57.2115 46.2 57.1611C46.75 57.1107 47.3 57.1371 47.85 57.1349C48.4 57.1327 48.95 57.144 49.5 57.1478C50.05 57.1516 50.6 57.1553 51.15 57.1579C51.7 57.1605 52.25 57.1601 52.8 57.1634C53.35 57.1667 53.9 57.1731 54.45 57.1776C55 57.182 55.55 57.1916 56.1 57.19C56.65 57.1884 57.2 57.178 57.75 57.168C58.3 57.158 58.85 57.1355 59.4 57.1299C59.95 57.1243 60.5 57.1338 61.05 57.1345C61.6 57.1352 62.15 57.124 62.7 57.134C63.25 57.1441 63.8 57.1731 64.35 57.195C64.9 57.2169 65.45 57.2532 66 57.2655C66.55 57.2778 67.1 57.2647 67.65 57.2687C68.2 57.2728 68.75 57.267 69.3 57.2896C69.85 57.3122 70.4 57.371 70.95 57.4044C71.5 57.4377 72.05 57.4668 72.6 57.4896C73.15 57.5123 73.7 57.545 74.25 57.5408C74.8 57.5365 75.35 57.5068 75.9 57.4641C76.45 57.4213 77 57.3244 77.55 57.2842C78.1 57.244 78.65 57.2163 79.2 57.2228C79.75 57.2293 80.3 57.29 80.85 57.3232C81.4 57.3563 81.95 57.396 82.5 57.4219C83.05 57.4478 83.6 57.4637 84.15 57.4787C84.7 57.4937 85.25 57.5011 85.8 57.5121C86.35 57.523 86.9 57.5411 87.45 57.5444C88 57.5477 88.55 57.5663 89.1 57.5318C89.65 57.4972 90.2 57.3126 90.75 57.337C91.3 57.3613 91.85 57.6088 92.4 57.6776C92.95 57.7465 93.5 57.7379 94.05 57.75C94.6 57.7621 95.15 57.75 95.7 57.75L95.7 57.75L31.35 57.75Z";
3658 SkParsePath::FromSVGString(str, &path);
3659
3660 const char strB[] = "M31.35 57.75L31.35 57.75C31.9 57.7514 32.45 57.7052 33 57.7587C33.55 57.8122 34.1 57.9986 34.65 58.0709C35.2 58.1431 35.75 58.1777 36.3 58.1921C36.85 58.2065 37.4 58.1857 37.95 58.1572C38.5 58.1288 39.05 58.0888 39.6 58.0214C40.15 57.954 40.7 57.7971 41.25 57.7528C41.8 57.7084 42.35 57.7038 42.9 57.7555C43.45 57.8072 44 57.9655 44.55 58.0627C45.1 58.16 45.65 58.2885 46.2 58.3389C46.75 58.3893 47.3 58.3629 47.85 58.3651C48.4 58.3673 48.95 58.356 49.5 58.3522C50.05 58.3484 50.6 58.3447 51.15 58.3421C51.7 58.3395 52.25 58.3399 52.8 58.3366C53.35 58.3333 53.9 58.3269 54.45 58.3224C55 58.318 55.55 58.3084 56.1 58.31C56.65 58.3116 57.2 58.322 57.75 58.332C58.3 58.342 58.85 58.3645 59.4 58.3701C59.95 58.3757 60.5 58.3662 61.05 58.3655C61.6 58.3648 62.15 58.376 62.7 58.366C63.25 58.3559 63.8 58.3269 64.35 58.305C64.9 58.2831 65.45 58.2468 66 58.2345C66.55 58.2222 67.1 58.2353 67.65 58.2313C68.2 58.2272 68.75 58.233 69.3 58.2104C69.85 58.1878 70.4 58.129 70.95 58.0956C71.5 58.0623 72.05 58.0332 72.6 58.0104C73.15 57.9877 73.7 57.955 74.25 57.9592C74.8 57.9635 75.35 57.9932 75.9 58.0359C76.45 58.0787 77 58.1756 77.55 58.2158C78.1 58.256 78.65 58.2837 79.2 58.2772C79.75 58.2707 80.3 58.21 80.85 58.1768C81.4 58.1437 81.95 58.104 82.5 58.0781C83.05 58.0522 83.6 58.0363 84.15 58.0213C84.7 58.0063 85.25 57.9989 85.8 57.9879C86.35 57.977 86.9 57.9589 87.45 57.9556C88 57.9523 88.55 57.9337 89.1 57.9682C89.65 58.0028 90.2 58.1874 90.75 58.163C91.3 58.1387 91.85 57.8912 92.4 57.8224C92.95 57.7535 93.5 57.7621 94.05 57.75C94.6 57.7379 95.15 57.75 95.7 57.75L95.7 57.75L31.35 57.75Z";
3661 SkParsePath::FromSVGString(strB, &pathB);
caryclarkbca19f72015-05-13 08:23:48 -07003662 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
caryclark54359292015-03-26 07:52:43 -07003663}
3664
3665static void cubicOp119(skiatest::Reporter* reporter, const char* filename) {
3666 SkPath path, pathB;
3667 path.setFillType(SkPath::kWinding_FillType);
3668 path.moveTo(0,1);
3669 path.cubicTo(3,5, 2,1, 3,1);
3670 path.close();
3671 pathB.setFillType(SkPath::kWinding_FillType);
3672 pathB.moveTo(1,2);
3673 pathB.cubicTo(1,3, 1,0, 5,3);
3674 pathB.close();
3675 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
3676}
3677
3678static void cubicOp120(skiatest::Reporter* reporter, const char* filename) {
3679 SkPath path, pathB;
3680 path.setFillType(SkPath::kWinding_FillType);
3681 path.moveTo(0,1);
3682 path.cubicTo(2,4, 2,1, 4,0);
3683 path.close();
3684 pathB.setFillType(SkPath::kWinding_FillType);
3685 pathB.moveTo(1,2);
3686 pathB.cubicTo(0,4, 1,0, 4,2);
3687 pathB.close();
3688 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3689}
3690
3691static void cubicOp121(skiatest::Reporter* reporter, const char* filename) {
3692 SkPath path, pathB;
3693 path.setFillType(SkPath::kWinding_FillType);
3694 path.moveTo(0,1);
3695 path.cubicTo(3,4, 3,2, 4,3);
3696 path.close();
3697 pathB.setFillType(SkPath::kWinding_FillType);
3698 pathB.moveTo(2,3);
3699 pathB.cubicTo(3,4, 1,0, 4,3);
3700 pathB.close();
3701 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3702}
3703
3704// FIXME : haven't debugged this failure yet
3705static void cubicOp122(skiatest::Reporter* reporter, const char* filename) {
3706 SkPath path, pathB;
3707 path.setFillType(SkPath::kWinding_FillType);
3708 path.moveTo(0,1);
3709 path.cubicTo(3,5, 4,1, 4,0);
3710 path.close();
3711 pathB.setFillType(SkPath::kWinding_FillType);
3712 pathB.moveTo(1,4);
3713 pathB.cubicTo(0,4, 1,0, 5,3);
3714 pathB.close();
3715 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3716}
3717
3718static void cubicOp123(skiatest::Reporter* reporter, const char* filename) {
3719 SkPath path, pathB;
3720 path.setFillType(SkPath::kWinding_FillType);
3721 path.moveTo(0,1);
3722 path.cubicTo(1,5, 2,0, 6,0);
3723 path.close();
3724 pathB.setFillType(SkPath::kWinding_FillType);
3725 pathB.moveTo(0,2);
3726 pathB.cubicTo(0,6, 1,0, 5,1);
3727 pathB.close();
3728 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3729}
3730
3731static void loop5(skiatest::Reporter* reporter, const char* filename) {
3732 SkPath path, pathB;
3733 path.moveTo(0,2);
3734 path.cubicTo(1,2, 1,1.66666663f, 0.833333313f,1.33333325f);
3735 path.close();
3736 pathB.moveTo(1,2);
3737 pathB.cubicTo(1,1.66666663f, 0.833333313f,1.33333325f, 0,2);
3738 pathB.close();
3739 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
3740}
3741
3742static void loop6(skiatest::Reporter* reporter, const char* filename) {
3743 SkPath path, pathB;
3744 path.moveTo(0,1);
3745 path.cubicTo(1,3, -1.66666675f,1.66666663f, 4.16666651f,1.00000012f);
3746 path.close();
3747 pathB.moveTo(1,3);
3748 pathB.cubicTo(-1.66666675f,1.66666663f, 4.16666651f,1.00000012f, 0,1);
3749 pathB.close();
3750 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
3751}
3752
3753static void cubicOp124(skiatest::Reporter* reporter, const char* filename) {
3754 SkPath path, pathB;
3755 path.setFillType(SkPath::kWinding_FillType);
3756 path.moveTo(0,1);
3757 path.cubicTo(1,5, 6,0, 3,0);
3758 path.close();
3759 pathB.setFillType(SkPath::kWinding_FillType);
3760 pathB.moveTo(0,6);
3761 pathB.cubicTo(0,3, 1,0, 5,1);
3762 pathB.close();
3763 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3764}
3765
3766static void cubicOp125(skiatest::Reporter* reporter, const char* filename) {
3767 SkPath path, pathB;
3768 path.setFillType(SkPath::kWinding_FillType);
3769 path.moveTo(0,1);
3770 path.cubicTo(3,6, 3,1, 6,2);
3771 path.close();
3772 pathB.setFillType(SkPath::kWinding_FillType);
3773 pathB.moveTo(1,3);
3774 pathB.cubicTo(2,6, 1,0, 6,3);
3775 pathB.close();
3776 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3777}
3778
3779static void cubicOp126(skiatest::Reporter* reporter, const char* filename) {
3780 SkPath path, pathB;
3781 path.setFillType(SkPath::kWinding_FillType);
3782 path.moveTo(0,1);
3783 path.cubicTo(0,3, 6,0, 2,1);
3784 path.close();
3785 pathB.setFillType(SkPath::kWinding_FillType);
3786 pathB.moveTo(0,6);
3787 pathB.cubicTo(1,2, 1,0, 3,0);
3788 pathB.close();
3789 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3790}
3791
3792static void cubicOp127(skiatest::Reporter* reporter, const char* filename) {
3793 SkPath path, pathB;
3794 path.setFillType(SkPath::kWinding_FillType);
3795 path.moveTo(0,1);
3796 path.cubicTo(1,5, 6,0, 3,0);
3797 path.close();
3798 pathB.setFillType(SkPath::kWinding_FillType);
3799 pathB.moveTo(0,6);
3800 pathB.cubicTo(0,3, 1,0, 5,1);
3801 pathB.close();
3802 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
3803}
3804
3805static void cubicOp128(skiatest::Reporter* reporter, const char* filename) {
3806 SkPath path, pathB;
3807 path.setFillType(SkPath::kWinding_FillType);
3808 path.moveTo(0,1);
3809 path.cubicTo(0,3, 3,2, 5,2);
3810 path.close();
3811 pathB.setFillType(SkPath::kWinding_FillType);
3812 pathB.moveTo(2,3);
3813 pathB.cubicTo(2,5, 1,0, 3,0);
3814 pathB.close();
3815 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3816}
3817
caryclark1049f122015-04-20 08:31:59 -07003818static void cubicOp129(skiatest::Reporter* reporter, const char* filename) {
3819 SkPath path, pathB;
3820 path.setFillType(SkPath::kWinding_FillType);
3821 path.moveTo(5,6);
3822 path.cubicTo(3,4, 2,0, 2,1);
3823 path.close();
3824 pathB.setFillType(SkPath::kWinding_FillType);
3825 pathB.moveTo(0,2);
3826 pathB.cubicTo(1,2, 6,5, 4,3);
3827 pathB.close();
3828 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3829}
3830
3831static void cubicOp130(skiatest::Reporter* reporter, const char* filename) {
3832 SkPath path, pathB;
3833 path.setFillType(SkPath::kWinding_FillType);
3834 path.moveTo(5,6);
3835 path.cubicTo(4,6, 3,0, 2,1);
3836 path.close();
3837 pathB.setFillType(SkPath::kWinding_FillType);
3838 pathB.moveTo(0,3);
3839 pathB.cubicTo(1,2, 6,5, 6,4);
3840 pathB.close();
3841 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3842}
3843
3844#include "SkGeometry.h"
3845
3846static void complex_to_quads(const SkPoint pts[], SkPath* path) {
3847 SkScalar loopT;
caryclark6ff734b2015-09-04 05:00:15 -07003848 if (SkDCubic::ComplexBreak(pts, &loopT)) {
caryclark1049f122015-04-20 08:31:59 -07003849 SkPoint cubicPair[7];
3850 SkChopCubicAt(pts, cubicPair, loopT);
3851 SkDCubic c1, c2;
3852 c1.set(cubicPair);
3853 c2.set(&cubicPair[3]);
3854 SkDQuad q1 = c1.toQuad();
3855 SkDQuad q2 = c2.toQuad();
3856 path->quadTo(q1[1].asSkPoint(), q1[2].asSkPoint());
3857 path->quadTo(q2[1].asSkPoint(), q2[2].asSkPoint());
3858 } else {
3859 path->cubicTo(pts[1], pts[2], pts[3]);
3860 }
3861}
3862
3863static void cubicOp130a(skiatest::Reporter* reporter, const char* filename) {
3864 SkPath path, pathB;
3865 path.setFillType(SkPath::kWinding_FillType);
3866 path.moveTo(5,6);
3867 SkPoint pts[] = { {5,6}, {4,6}, {3,0}, {2,1} };
3868 complex_to_quads(pts, &path);
3869 path.close();
3870 pathB.setFillType(SkPath::kWinding_FillType);
3871 pathB.moveTo(0,3);
3872 SkPoint pts2[] = { {0,3}, {1,2}, {6,5}, {6,4} };
3873 complex_to_quads(pts2, &path);
3874 pathB.close();
3875 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3876}
3877
3878static void cubicOp131(skiatest::Reporter* reporter, const char* filename) {
3879 SkPath path, pathB;
3880 path.setFillType(SkPath::kWinding_FillType);
3881 path.moveTo(0,1);
3882 path.cubicTo(3,4, 3,0, 6,2);
3883 path.close();
3884 pathB.setFillType(SkPath::kWinding_FillType);
3885 pathB.moveTo(0,3);
3886 pathB.cubicTo(2,6, 1,0, 4,3);
3887 pathB.close();
3888 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3889}
3890
3891static void circlesOp1(skiatest::Reporter* reporter, const char* filename) {
3892 SkPath path, pathB;
3893 path.setFillType(SkPath::kWinding_FillType);
3894 path.addCircle(0, 1, 2, SkPath::kCCW_Direction);
3895 pathB.setFillType(SkPath::kWinding_FillType);
3896 pathB.addCircle(0, 1, 1, SkPath::kCW_Direction);
3897 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3898}
3899
3900static void circlesOp2(skiatest::Reporter* reporter, const char* filename) {
3901 SkPath path, pathB;
3902 path.setFillType(SkPath::kWinding_FillType);
3903 path.addCircle(0, 1, 4, SkPath::kCCW_Direction);
3904 pathB.setFillType(SkPath::kWinding_FillType);
3905 pathB.addCircle(0, 4, 3, SkPath::kCW_Direction);
3906 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
3907}
3908
3909static void rRect1x(skiatest::Reporter* reporter, const char* filename) {
3910 SkPath path, pathB;
3911 path.setFillType(SkPath::kEvenOdd_FillType);
3912 path.moveTo(20.65f, 5.65f);
3913 path.conicTo(20.65f, 1.13612f, 25.1404f, 0.65f, 0.888488f);
3914 path.lineTo(25.65f, 0.65f);
3915 path.lineTo(26.1596f, 0.67604f);
3916 path.conicTo(30.65f, 1.13612f, 30.65f, 5.65f, 0.888488f);
3917 path.lineTo(30.65f, 25.65f);
3918 path.conicTo(30.65f, 20.65f, 25.65f, 20.65f, 0.707107f);
3919 path.lineTo(20.65f, 20.65f);
3920 path.lineTo(20.65f, 5.65f);
3921 path.close();
3922 path.moveTo(20.65f, 20.65f);
3923 path.lineTo(5.65f, 20.65f);
3924 path.conicTo(0.65f, 20.65f, 0.65f, 25.65f, 0.707107f);
3925 path.lineTo(0.65f, 45.65f);
3926 path.conicTo(0.65f, 50.65f, 5.65f, 50.65f, 0.707107f);
3927 path.lineTo(25.65f, 50.65f);
3928 path.conicTo(30.65f, 50.65f, 30.65f, 45.65f, 0.707107f);
3929 path.lineTo(30.65f, 25.65f);
3930 path.conicTo(30.65f, 30.65f, 25.65f, 30.65f, 0.707107f);
3931 path.conicTo(20.65f, 30.65f, 20.65f, 25.65f, 0.707107f);
3932 path.lineTo(20.65f, 20.65f);
3933 path.close();
3934 SkPath path1(path);
3935
3936 path.reset();
3937 path.setFillType(SkPath::kWinding_FillType);
3938 path.moveTo(20.65f, 45.65f);
3939 path.lineTo(20.65f, 25.65f);
3940 path.conicTo(20.65f, 20.65f, 25.65f, 20.65f, 0.707107f);
3941 path.lineTo(45.65f, 20.65f);
3942 path.conicTo(50.65f, 20.65f, 50.65f, 25.65f, 0.707107f);
3943 path.lineTo(50.65f, 45.65f);
3944 path.conicTo(50.65f, 50.65f, 45.65f, 50.65f, 0.707107f);
3945 path.lineTo(25.65f, 50.65f);
3946 path.conicTo(20.65f, 50.65f, 20.65f, 45.65f, 0.707107f);
3947 path.close();
3948 SkPath path2(path);
3949
3950 testPathOp(reporter, path1, path2, kDifference_SkPathOp, filename);
3951}
3952
3953static void loop7(skiatest::Reporter* reporter, const char* filename) {
3954 SkPath path, pathB;
3955 path.moveTo(0,1);
3956 path.cubicTo(3,4, -1,0, 8.5f,-2.5f);
3957 path.close();
3958 pathB.moveTo(3,4);
3959 pathB.cubicTo(-1,0, 8.5f,-2.5f, 0,1);
3960 pathB.close();
3961 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
3962}
3963
3964static void rects5(skiatest::Reporter* reporter, const char* filename) {
3965 SkPath path, pathB;
3966 path.setFillType(SkPath::kWinding_FillType);
3967 path.addRect(5, 5, 6, 6, SkPath::kCW_Direction);
3968 path.addRect(5, 5, 6, 6, SkPath::kCW_Direction);
3969 pathB.setFillType(SkPath::kEvenOdd_FillType);
3970 pathB.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
3971 pathB.addRect(5, 5, 6, 6, SkPath::kCW_Direction);
3972 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3973}
3974
3975static void loop8(skiatest::Reporter* reporter, const char* filename) {
3976 SkPath path, pathB;
3977 path.moveTo(0,1);
3978 path.cubicTo(1,4, -3.83333325f,0.166666627f, 6,-1);
3979 path.close();
3980 pathB.moveTo(1,4);
3981 pathB.cubicTo(-3.83333325f,0.166666627f, 6,-1, 0,1);
3982 pathB.close();
3983 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
3984}
3985
3986static void loop9(skiatest::Reporter* reporter, const char* filename) {
3987 SkPath path, pathB;
3988 path.moveTo(0,1);
3989 path.cubicTo(1,3, -2.5f,0, 3.33333325f,-0.666666627f);
3990 path.close();
3991 pathB.moveTo(1,3);
3992 pathB.cubicTo(-2.5f,0, 3.33333325f,-0.666666627f, 0,1);
3993 pathB.close();
3994 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
3995}
3996
3997static void circlesOp3(skiatest::Reporter* reporter, const char* filename) {
3998 SkPath path, pathB;
3999 path.setFillType(SkPath::kWinding_FillType);
4000 path.addCircle(0, 1, 2, SkPath::kCCW_Direction);
4001 pathB.setFillType(SkPath::kWinding_FillType);
4002 pathB.addCircle(3, 5, 3, SkPath::kCW_Direction);
4003 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4004}
4005
4006static void loop10(skiatest::Reporter* reporter, const char* filename) {
4007 SkPath path, pathB;
4008 path.moveTo(5,6);
4009 path.cubicTo(1,2, 1,2, -3.66666651f,13.333334f);
4010 path.close();
4011 pathB.moveTo(1,2);
4012 pathB.cubicTo(1,2, -3.66666651f,13.333334f, 5,6);
4013 pathB.close();
4014 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4015}
4016
4017static void loop11(skiatest::Reporter* reporter, const char* filename) {
4018 SkPath path, pathB;
4019 path.moveTo(0,1);
4020 path.cubicTo(1,3, -1.83333349f,1.33333337f, 4,-1);
4021 path.close();
4022 pathB.moveTo(1,3);
4023 pathB.cubicTo(-1.83333349f,1.33333337f, 4,-1, 0,1);
4024 pathB.close();
4025 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4026}
4027
4028static void cubicOp132(skiatest::Reporter* reporter, const char* filename) {
4029 SkPath path, pathB;
4030 path.setFillType(SkPath::kWinding_FillType);
4031 path.moveTo(5,6);
4032 path.cubicTo(3,4, 3,0, 3,2);
4033 path.close();
4034 pathB.setFillType(SkPath::kWinding_FillType);
4035 pathB.moveTo(0,3);
4036 pathB.cubicTo(2,3, 6,5, 4,3);
4037 pathB.close();
4038 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4039}
4040
caryclark03b03ca2015-04-23 09:13:37 -07004041static void loop12(skiatest::Reporter* reporter, const char* filename) {
4042 SkPath path, pathB;
4043 path.moveTo(1,2);
4044 path.cubicTo(0,6, -3.16666675f,3.66666675f, 6.33333349f,3.33333349f);
4045 path.close();
4046 pathB.moveTo(0,6);
4047 pathB.cubicTo(-3.16666675f,3.66666675f, 6.33333349f,3.33333349f, 1,2);
4048 pathB.close();
4049 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4050}
4051
caryclark03b03ca2015-04-23 09:13:37 -07004052static void cubicOp133(skiatest::Reporter* reporter, const char* filename) {
4053 SkPath path, pathB;
4054 path.setFillType(SkPath::kWinding_FillType);
4055 path.moveTo(5,6);
4056 path.cubicTo(5,6, 5,0, 4,1);
4057 path.close();
4058 pathB.setFillType(SkPath::kWinding_FillType);
4059 pathB.moveTo(0,5);
4060 pathB.cubicTo(1,4, 6,5, 6,5);
4061 pathB.close();
4062 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4063}
4064
4065static void cubicOp134(skiatest::Reporter* reporter, const char* filename) {
4066 SkPath path, pathB;
4067 path.setFillType(SkPath::kWinding_FillType);
4068 path.moveTo(5,6);
4069 path.cubicTo(5,6, 6,0, 3,1);
4070 path.close();
4071 pathB.setFillType(SkPath::kWinding_FillType);
4072 pathB.moveTo(0,6);
4073 pathB.cubicTo(1,3, 6,5, 6,5);
4074 pathB.close();
4075 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4076}
4077
4078static void cubicOp135(skiatest::Reporter* reporter, const char* filename) {
4079 SkPath path, pathB;
4080 path.setFillType(SkPath::kWinding_FillType);
4081 path.moveTo(5,6);
4082 path.cubicTo(5,6, 6,0, 4,1);
4083 path.close();
4084 pathB.setFillType(SkPath::kWinding_FillType);
4085 pathB.moveTo(0,6);
4086 pathB.cubicTo(1,4, 6,5, 6,5);
4087 pathB.close();
4088 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4089}
4090
4091static void cubicOp136(skiatest::Reporter* reporter, const char* filename) {
4092 SkPath path, pathB;
4093 path.setFillType(SkPath::kWinding_FillType);
4094 path.moveTo(5,6);
4095 path.cubicTo(5,6, 5,0, 3,1);
4096 path.close();
4097 pathB.setFillType(SkPath::kWinding_FillType);
4098 pathB.moveTo(0,5);
4099 pathB.cubicTo(1,3, 6,5, 6,5);
4100 pathB.close();
4101 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4102}
4103
4104static void cubicOp136a(skiatest::Reporter* reporter, const char* filename) {
4105 SkPath path, pathB;
4106 path.setFillType(SkPath::kWinding_FillType);
4107 path.moveTo(5,6);
4108 path.quadTo(5,0, 3,1);
4109 path.close();
4110 pathB.setFillType(SkPath::kWinding_FillType);
4111 pathB.moveTo(0,5);
4112 pathB.cubicTo(1,3, 6,5, 6,5);
4113 pathB.close();
4114 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4115}
4116
4117static void cubics137(skiatest::Reporter* reporter, const char* filename) {
4118 SkPath path, pathB;
4119 path.setFillType(SkPath::kWinding_FillType);
4120 path.moveTo(0, 5);
4121 path.cubicTo(3, 6, 1, 0, 3, 2);
4122 path.close();
4123 pathB.setFillType(SkPath::kWinding_FillType);
4124 pathB.moveTo(0, 1);
4125 pathB.cubicTo(2, 3, 5, 0, 6, 3);
4126 pathB.close();
4127 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4128}
4129
4130static void cubics138(skiatest::Reporter* reporter, const char* filename) {
4131 SkPath path, pathB;
4132 path.setFillType(SkPath::kWinding_FillType);
4133 path.moveTo(0, 5);
4134 path.cubicTo(3, 6, 1, 0, 4, 2);
4135 path.close();
4136 pathB.setFillType(SkPath::kWinding_FillType);
4137 pathB.moveTo(0, 1);
4138 pathB.cubicTo(2, 4, 5, 0, 6, 3);
4139 pathB.close();
4140 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4141}
4142
4143// three curves intersect successfully nearby -- the angle only gets 2 of the 3 pts
4144static void cubicOp139(skiatest::Reporter* reporter, const char* filename) {
4145 SkPath path, pathB;
4146 path.setFillType(SkPath::kWinding_FillType);
4147 path.moveTo(0,2);
4148 path.cubicTo(0,4, 3,1, 5,1);
4149 path.close();
4150 pathB.setFillType(SkPath::kWinding_FillType);
4151 pathB.moveTo(1,3);
4152 pathB.cubicTo(1,5, 2,0, 4,0);
4153 pathB.close();
caryclark08bc8482015-04-24 09:08:57 -07004154 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark03b03ca2015-04-23 09:13:37 -07004155}
4156
4157static void cubicOp140(skiatest::Reporter* reporter, const char* filename) {
4158 SkPath path, pathB;
4159 path.setFillType(SkPath::kWinding_FillType);
4160 path.moveTo(0,2);
4161 path.cubicTo(1,2, 5,4, 3,2);
4162 path.close();
4163 pathB.setFillType(SkPath::kWinding_FillType);
4164 pathB.moveTo(4,5);
4165 pathB.cubicTo(2,3, 2,0, 2,1);
4166 pathB.close();
4167 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4168}
4169
4170static void cubicOp141(skiatest::Reporter* reporter, const char* filename) {
4171 SkPath path, pathB;
4172 path.setFillType(SkPath::kWinding_FillType);
4173 path.moveTo(0,2);
4174 path.cubicTo(1,2, 6,4, 3,2);
4175 path.close();
4176 pathB.setFillType(SkPath::kWinding_FillType);
4177 pathB.moveTo(4,6);
4178 pathB.cubicTo(2,3, 2,0, 2,1);
4179 pathB.close();
4180 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4181}
4182
4183static void quadRect1(skiatest::Reporter* reporter, const char* filename) {
4184 SkPath path, pathB;
4185 path.moveTo(6,15);
4186 path.quadTo(16,0, 8,4);
4187 path.quadTo(2,7, 12,12);
4188 path.close();
4189 pathB.addRect(4,11, 13,16);
4190 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4191}
4192
4193static void quadRect2(skiatest::Reporter* reporter, const char* filename) {
4194 SkPath path, pathB;
4195 path.moveTo(5,12);
4196 path.quadTo(15,7, 9,4);
4197 path.quadTo(1,0, 11,15);
4198 path.close();
4199 pathB.addRect(4,11, 13,16);
4200 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4201}
4202
4203static void quadRect3(skiatest::Reporter* reporter, const char* filename) {
4204 SkPath path, pathB;
4205 path.moveTo(12,12);
4206 path.quadTo(2,7, 8,4);
4207 path.quadTo(16,0, 6,15);
4208 path.close();
4209 pathB.addRect(4,11, 13,16);
4210 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4211}
4212
4213static void quadRect4(skiatest::Reporter* reporter, const char* filename) {
4214 SkPath path, pathB;
4215 path.moveTo(11,15);
4216 path.quadTo(1,0, 9,4);
4217 path.quadTo(15,7, 5,12);
4218 path.close();
4219 pathB.addRect(4,11, 13,16);
4220 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4221}
4222
4223static void quadRect5(skiatest::Reporter* reporter, const char* filename) {
4224 SkPath path, pathB;
4225 path.moveTo(11,13);
4226 path.quadTo(4,4, 8,4);
4227 path.quadTo(12,4, 5,13);
4228 path.close();
4229 pathB.addRect(4,11, 13,16);
4230 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4231}
4232
4233static void quadRect6(skiatest::Reporter* reporter, const char* filename) {
4234 SkPath path, pathB;
4235 path.moveTo(5,13);
4236 path.quadTo(12,4, 8,4);
4237 path.quadTo(4,4, 11,13);
4238 path.close();
4239 pathB.addRect(4,11, 13,16);
4240 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4241}
4242
4243static void loops4i(skiatest::Reporter* reporter, const char* filename) {
4244 SkPath path, pathB;
4245 path.setFillType(SkPath::kWinding_FillType);
4246 path.moveTo(0, 3);
4247 path.cubicTo(0, 2, 0, 2, -1.66666663f, 2.16666675f);
4248 path.close();
4249 pathB.setFillType(SkPath::kWinding_FillType);
4250 pathB.moveTo(0, 2);
4251 pathB.cubicTo(0, 2, -1.66666663f, 2.16666675f, 0, 3);
4252 pathB.close();
4253 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4254}
4255
4256static void loops5i(skiatest::Reporter* reporter, const char* filename) {
4257 SkPath path, pathB;
4258 path.setFillType(SkPath::kWinding_FillType);
4259 path.moveTo(1, 2);
4260 path.cubicTo(0, 2, 0, 2, 0.166666672f, 2.66666675f);
4261 path.close();
4262 pathB.setFillType(SkPath::kWinding_FillType);
4263 pathB.moveTo(0, 2);
4264 pathB.cubicTo(0, 2, 0.166666672f, 2.66666675f, 1, 2);
4265 pathB.close();
4266 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4267}
4268
caryclark08bc8482015-04-24 09:08:57 -07004269static void cubicOp142(skiatest::Reporter* reporter, const char* filename) {
4270 SkPath path, pathB;
4271 path.setFillType(SkPath::kWinding_FillType);
4272 path.moveTo(5,6);
4273 path.cubicTo(2,5, 2,1, 1,0);
4274 path.close();
4275 pathB.setFillType(SkPath::kWinding_FillType);
4276 pathB.moveTo(1,2);
4277 pathB.cubicTo(0,1, 6,5, 5,2);
4278 pathB.close();
4279 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4280}
4281
4282static void cubics6d(skiatest::Reporter* reporter, const char* filename) {
4283 SkPath path, pathB;
4284 path.setFillType(SkPath::kWinding_FillType);
4285 path.moveTo(3, 5);
4286 path.cubicTo(1, 5, 4, 2, 4, 0);
4287 path.close();
4288 pathB.setFillType(SkPath::kWinding_FillType);
4289 pathB.moveTo(2, 4);
4290 pathB.cubicTo(0, 4, 5, 3, 5, 1);
4291 pathB.close();
4292 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4293}
4294
4295static void cubics7d(skiatest::Reporter* reporter, const char* filename) {
4296 SkPath path, pathB;
4297 path.setFillType(SkPath::kWinding_FillType);
4298 path.moveTo(2, 6);
4299 path.cubicTo(2, 4, 5, 1, 3, 1);
4300 path.close();
4301 pathB.setFillType(SkPath::kWinding_FillType);
4302 pathB.moveTo(1, 5);
4303 pathB.cubicTo(1, 3, 6, 2, 4, 2);
4304 pathB.close();
4305 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4306}
4307
4308static void cubics8d(skiatest::Reporter* reporter, const char* filename) {
4309 SkPath path, pathB;
4310 path.setFillType(SkPath::kWinding_FillType);
4311 path.moveTo(2, 5);
4312 path.cubicTo(2, 4, 5, 1, 3, 2);
4313 path.close();
4314 pathB.setFillType(SkPath::kWinding_FillType);
4315 pathB.moveTo(1, 5);
4316 pathB.cubicTo(2, 3, 5, 2, 4, 2);
4317 pathB.close();
4318 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4319}
4320
4321static void cubics9d(skiatest::Reporter* reporter, const char* filename) {
4322 SkPath path, pathB;
4323 path.setFillType(SkPath::kWinding_FillType);
4324 path.moveTo(2, 4);
4325 path.cubicTo(2, 6, 3, 1, 5, 1);
4326 path.close();
4327 pathB.setFillType(SkPath::kWinding_FillType);
4328 pathB.moveTo(1, 3);
4329 pathB.cubicTo(1, 5, 4, 2, 6, 2);
4330 pathB.close();
4331 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4332}
4333
4334static void cubics10u(skiatest::Reporter* reporter, const char* filename) {
4335 SkPath path, pathB;
4336 path.setFillType(SkPath::kWinding_FillType);
4337 path.moveTo(2, 4);
4338 path.cubicTo(1, 6, 4, 1, 5, 1);
4339 path.close();
4340 pathB.setFillType(SkPath::kWinding_FillType);
4341 pathB.moveTo(1, 4);
4342 pathB.cubicTo(1, 5, 4, 2, 6, 1);
4343 pathB.close();
4344 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
4345}
4346
4347static void cubics11i(skiatest::Reporter* reporter, const char* filename) {
4348 SkPath path, pathB;
4349 path.setFillType(SkPath::kWinding_FillType);
4350 path.moveTo(2, 4);
4351 path.cubicTo(2, 5, 3, 2, 5, 1);
4352 path.close();
4353 pathB.setFillType(SkPath::kWinding_FillType);
4354 pathB.moveTo(2, 3);
4355 pathB.cubicTo(1, 5, 4, 2, 5, 2);
4356 pathB.close();
4357 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4358}
4359
4360static void cubics12d(skiatest::Reporter* reporter, const char* filename) {
4361 SkPath path, pathB;
4362 path.setFillType(SkPath::kWinding_FillType);
4363 path.moveTo(2, 4);
4364 path.cubicTo(0, 4, 5, 3, 5, 1);
4365 path.close();
4366 pathB.setFillType(SkPath::kWinding_FillType);
4367 pathB.moveTo(3, 5);
4368 pathB.cubicTo(1, 5, 4, 2, 4, 0);
4369 pathB.close();
4370 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4371}
4372
4373static void cubics13d(skiatest::Reporter* reporter, const char* filename) {
4374 SkPath path, pathB;
4375 path.setFillType(SkPath::kWinding_FillType);
4376 path.moveTo(2, 3);
4377 path.cubicTo(1, 5, 4, 2, 5, 2);
4378 path.close();
4379 pathB.setFillType(SkPath::kWinding_FillType);
4380 pathB.moveTo(2, 4);
4381 pathB.cubicTo(2, 5, 3, 2, 5, 1);
4382 pathB.close();
4383 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4384}
4385
4386static void cubics14d(skiatest::Reporter* reporter, const char* filename) {
4387 SkPath path, pathB;
4388 path.setFillType(SkPath::kWinding_FillType);
4389 path.moveTo(2, 3);
4390 path.cubicTo(0, 4, 3, 1, 3, 0);
4391 path.close();
4392 pathB.setFillType(SkPath::kWinding_FillType);
4393 pathB.moveTo(1, 3);
4394 pathB.cubicTo(0, 3, 3, 2, 4, 0);
4395 pathB.close();
4396 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4397}
4398
4399static void cubics15d(skiatest::Reporter* reporter, const char* filename) {
4400 SkPath path, pathB;
4401 path.setFillType(SkPath::kWinding_FillType);
4402 path.moveTo(1, 5);
4403 path.cubicTo(3, 5, 4, 0, 4, 2);
4404 path.close();
4405 pathB.setFillType(SkPath::kWinding_FillType);
4406 pathB.moveTo(0, 4);
4407 pathB.cubicTo(2, 4, 5, 1, 5, 3);
4408 pathB.close();
4409 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4410}
4411
4412static void cubics16i(skiatest::Reporter* reporter, const char* filename) {
4413 SkPath path, pathB;
4414 path.setFillType(SkPath::kWinding_FillType);
4415 path.moveTo(1, 5);
4416 path.cubicTo(2, 5, 5, 0, 4, 2);
4417 path.close();
4418 pathB.setFillType(SkPath::kWinding_FillType);
4419 pathB.moveTo(0, 5);
4420 pathB.cubicTo(2, 4, 5, 1, 5, 2);
4421 pathB.close();
4422 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4423}
4424
4425static void cubics17d(skiatest::Reporter* reporter, const char* filename) {
4426 SkPath path, pathB;
4427 path.setFillType(SkPath::kWinding_FillType);
4428 path.moveTo(1, 5);
4429 path.cubicTo(3, 4, 4, 1, 4, 2);
4430 path.close();
4431 pathB.setFillType(SkPath::kWinding_FillType);
4432 pathB.moveTo(1, 4);
4433 pathB.cubicTo(2, 4, 5, 1, 4, 3);
4434 pathB.close();
4435 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4436}
4437
4438static void cubics18d(skiatest::Reporter* reporter, const char* filename) {
4439 SkPath path, pathB;
4440 path.setFillType(SkPath::kWinding_FillType);
4441 path.moveTo(1, 5);
4442 path.cubicTo(1, 3, 4, 0, 2, 0);
4443 path.close();
4444 pathB.setFillType(SkPath::kWinding_FillType);
4445 pathB.moveTo(0, 4);
4446 pathB.cubicTo(0, 2, 5, 1, 3, 1);
4447 pathB.close();
4448 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4449}
4450
4451static void cubics19d(skiatest::Reporter* reporter, const char* filename) {
4452 SkPath path, pathB;
4453 path.setFillType(SkPath::kWinding_FillType);
4454 path.moveTo(1, 5);
4455 path.cubicTo(2, 3, 5, 2, 4, 2);
4456 path.close();
4457 pathB.setFillType(SkPath::kWinding_FillType);
4458 pathB.moveTo(2, 5);
4459 pathB.cubicTo(2, 4, 5, 1, 3, 2);
4460 pathB.close();
4461 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4462}
4463
4464static void cubicOp157(skiatest::Reporter* reporter, const char* filename) {
4465 SkPath path, pathB;
4466 path.setFillType(SkPath::kWinding_FillType);
4467 path.moveTo(1,5);
4468 path.cubicTo(1,3, 6,2, 4,2);
4469 path.close();
4470 pathB.setFillType(SkPath::kWinding_FillType);
4471 pathB.moveTo(2,6);
4472 pathB.cubicTo(2,4, 5,1, 3,1);
4473 pathB.close();
4474 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4475}
4476
caryclarkaec25102015-04-29 08:28:30 -07004477static void cubics20d(skiatest::Reporter* reporter, const char* filename) {
4478 SkPath path, pathB;
4479 path.setFillType(SkPath::kWinding_FillType);
4480 path.moveTo(1, 2);
4481 path.cubicTo(0, 3, 6, 0, 3, 2);
4482 path.close();
4483 pathB.setFillType(SkPath::kWinding_FillType);
4484 pathB.moveTo(0, 6);
4485 pathB.cubicTo(2, 3, 2, 1, 3, 0);
4486 pathB.close();
4487 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4488}
4489
4490static void loops20i(skiatest::Reporter* reporter, const char* filename) {
4491 SkPath path, pathB;
4492 path.setFillType(SkPath::kWinding_FillType);
4493 path.moveTo(1, 2);
4494 path.cubicTo(0, 2, 0.833333313f, 2, 1, 3.66666651f);
4495 path.close();
4496 pathB.setFillType(SkPath::kWinding_FillType);
4497 pathB.moveTo(0, 2);
4498 pathB.cubicTo(0.833333313f, 2, 1, 3.66666651f, 1, 2);
4499 pathB.close();
4500 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4501}
4502
4503static void loops21i(skiatest::Reporter* reporter, const char* filename) {
4504 SkPath path, pathB;
4505 path.setFillType(SkPath::kWinding_FillType);
4506 path.moveTo(1, 2);
4507 path.cubicTo(0, 2, 0.833333313f, 2, 1, 4);
4508 path.close();
4509 pathB.setFillType(SkPath::kWinding_FillType);
4510 pathB.moveTo(0, 2);
4511 pathB.cubicTo(0.833333313f, 2, 1, 4, 1, 2);
4512 pathB.close();
4513 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4514}
4515
4516static void loops22i(skiatest::Reporter* reporter, const char* filename) {
4517 SkPath path, pathB;
4518 path.setFillType(SkPath::kWinding_FillType);
4519 path.moveTo(1, 3);
4520 path.cubicTo(0, 3, 0.833333313f, 3, 1, 4.66666651f);
4521 path.close();
4522 pathB.setFillType(SkPath::kWinding_FillType);
4523 pathB.moveTo(0, 3);
4524 pathB.cubicTo(0.833333313f, 3, 1, 4.66666651f, 1, 3);
4525 pathB.close();
4526 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4527}
4528
4529static void loops23i(skiatest::Reporter* reporter, const char* filename) {
4530 SkPath path, pathB;
4531 path.setFillType(SkPath::kWinding_FillType);
4532 path.moveTo(1, 5);
4533 path.cubicTo(0, 1, 6.16666698f, 5.66666698f, -5.66666651f, 6.66666651f);
4534 path.close();
4535 pathB.setFillType(SkPath::kWinding_FillType);
4536 pathB.moveTo(0, 1);
4537 pathB.cubicTo(6.16666698f, 5.66666698f, -5.66666651f, 6.66666651f, 1, 5);
4538 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004539 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004540}
4541
4542static void loops24i(skiatest::Reporter* reporter, const char* filename) {
4543 SkPath path, pathB;
4544 path.setFillType(SkPath::kWinding_FillType);
4545 path.moveTo(1, 2);
4546 path.cubicTo(0, 2, 0.833333313f, 2, 1, 3);
4547 path.close();
4548 pathB.setFillType(SkPath::kWinding_FillType);
4549 pathB.moveTo(0, 2);
4550 pathB.cubicTo(0.833333313f, 2, 1, 3, 1, 2);
4551 pathB.close();
4552 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4553}
4554
4555static void loops25i(skiatest::Reporter* reporter, const char* filename) {
4556 SkPath path, pathB;
4557 path.setFillType(SkPath::kWinding_FillType);
4558 path.moveTo(1, 5);
4559 path.cubicTo(0, 5, 0.833333313f, 5, 1, 7);
4560 path.close();
4561 pathB.setFillType(SkPath::kWinding_FillType);
4562 pathB.moveTo(0, 5);
4563 pathB.cubicTo(0.833333313f, 5, 1, 7, 1, 5);
4564 pathB.close();
4565 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4566}
4567
4568static void loops26i(skiatest::Reporter* reporter, const char* filename) {
4569 SkPath path, pathB;
4570 path.setFillType(SkPath::kWinding_FillType);
4571 path.moveTo(1, 6);
4572 path.cubicTo(0, 2, 6.16666698f, 6.66666698f, -5.66666651f, 7.66666651f);
4573 path.close();
4574 pathB.setFillType(SkPath::kWinding_FillType);
4575 pathB.moveTo(0, 2);
4576 pathB.cubicTo(6.16666698f, 6.66666698f, -5.66666651f, 7.66666651f, 1, 6);
4577 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004578 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004579}
4580
4581static void loops27i(skiatest::Reporter* reporter, const char* filename) {
4582 SkPath path, pathB;
4583 path.setFillType(SkPath::kWinding_FillType);
4584 path.moveTo(1, 3);
4585 path.cubicTo(0, 3, 0.833333313f, 3, 1, 4.33333349f);
4586 path.close();
4587 pathB.setFillType(SkPath::kWinding_FillType);
4588 pathB.moveTo(0, 3);
4589 pathB.cubicTo(0.833333313f, 3, 1, 4.33333349f, 1, 3);
4590 pathB.close();
4591 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4592}
4593
4594static void loops28i(skiatest::Reporter* reporter, const char* filename) {
4595 SkPath path, pathB;
4596 path.setFillType(SkPath::kWinding_FillType);
4597 path.moveTo(2, 3);
4598 path.cubicTo(1, 3, 1.83333337f, 3, 2, 4.66666651f);
4599 path.close();
4600 pathB.setFillType(SkPath::kWinding_FillType);
4601 pathB.moveTo(1, 3);
4602 pathB.cubicTo(1.83333337f, 3, 2, 4.66666651f, 2, 3);
4603 pathB.close();
4604 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4605}
4606
4607static void loops29i(skiatest::Reporter* reporter, const char* filename) {
4608 SkPath path, pathB;
4609 path.setFillType(SkPath::kWinding_FillType);
4610 path.moveTo(2, 4);
4611 path.cubicTo(0, 4, 1.66666663f, 4, 2, 7.33333302f);
4612 path.close();
4613 pathB.setFillType(SkPath::kWinding_FillType);
4614 pathB.moveTo(0, 4);
4615 pathB.cubicTo(1.66666663f, 4, 2, 7.33333302f, 2, 4);
4616 pathB.close();
4617 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4618}
4619
4620static void loops30i(skiatest::Reporter* reporter, const char* filename) {
4621 SkPath path, pathB;
4622 path.setFillType(SkPath::kWinding_FillType);
4623 path.moveTo(2, 4);
4624 path.cubicTo(0, 4, 1.66666663f, 4, 2, 8);
4625 path.close();
4626 pathB.setFillType(SkPath::kWinding_FillType);
4627 pathB.moveTo(0, 4);
4628 pathB.cubicTo(1.66666663f, 4, 2, 8, 2, 4);
4629 pathB.close();
4630 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4631}
4632
4633static void loops31i(skiatest::Reporter* reporter, const char* filename) {
4634 SkPath path, pathB;
4635 path.setFillType(SkPath::kWinding_FillType);
4636 path.moveTo(2, 5);
4637 path.cubicTo(1, 5, 1.83333337f, 5, 2, 6.66666651f);
4638 path.close();
4639 pathB.setFillType(SkPath::kWinding_FillType);
4640 pathB.moveTo(1, 5);
4641 pathB.cubicTo(1.83333337f, 5, 2, 6.66666651f, 2, 5);
4642 pathB.close();
4643 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4644}
4645
4646static void loops32i(skiatest::Reporter* reporter, const char* filename) {
4647 SkPath path, pathB;
4648 path.setFillType(SkPath::kWinding_FillType);
4649 path.moveTo(2, 6);
4650 path.cubicTo(1, 6, 1.83333337f, 6, 2, 8);
4651 path.close();
4652 pathB.setFillType(SkPath::kWinding_FillType);
4653 pathB.moveTo(1, 6);
4654 pathB.cubicTo(1.83333337f, 6, 2, 8, 2, 6);
4655 pathB.close();
4656 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4657}
4658
4659static void loops33i(skiatest::Reporter* reporter, const char* filename) {
4660 SkPath path, pathB;
4661 path.setFillType(SkPath::kWinding_FillType);
4662 path.moveTo(2, 6);
4663 path.cubicTo(1, 2, 7.16666698f, 6.66666698f, -4.66666651f, 7.66666651f);
4664 path.close();
4665 pathB.setFillType(SkPath::kWinding_FillType);
4666 pathB.moveTo(1, 2);
4667 pathB.cubicTo(7.16666698f, 6.66666698f, -4.66666651f, 7.66666651f, 2, 6);
4668 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004669 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004670}
4671
4672static void loops33iMod(skiatest::Reporter* reporter, const char* filename) {
4673 SkPoint pts[] = {{2, 6}, {1, 2}, {7.16666698f, 6.66666698f}, {-4.66666651f, 7.66666651f},
4674 {1, 2}, {7.16666698f, 6.66666698f}, {-4.66666651f, 7.66666651f}, {2, 6}};
4675 bool up = false;
4676 float offset = 0.0380172729f;
4677 float step = 7.62939453e-006f;
4678 bool lastResult = true;
4679 // for (int i = 0; i < 30; ++i) {
4680 SkString name(filename);
4681 // name.appendS32(i);
4682 // if (i > 0) {
4683 // SkDebugf("\n\n<div id=\"%s\">\n", name.c_str());
4684 // }
4685 pts[5].fY = 6.66666698f + offset;
4686 SkPath path, pathB;
4687 path.setFillType(SkPath::kWinding_FillType);
4688 path.moveTo(pts[0]);
4689 path.cubicTo(pts[1], pts[2], pts[3]);
4690 path.close();
4691 pathB.setFillType(SkPath::kWinding_FillType);
4692 pathB.moveTo(pts[4]);
4693 pathB.cubicTo(pts[5], pts[6], pts[7]);
4694 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004695 bool result = testPathOp(reporter, path, pathB, kIntersect_SkPathOp, name.c_str());
caryclarkaec25102015-04-29 08:28:30 -07004696 if (lastResult != result) {
4697 up = !up;
4698 }
4699 step /= 2;
4700 offset += up ? step : -step;
4701 lastResult = result;
4702 // }
4703}
4704
4705
4706static void loops33iAsQuads(skiatest::Reporter* reporter, const char* filename) {
4707 SkPath path, pathB;
4708 path.setFillType(SkPath::kWinding_FillType);
4709 path.moveTo(2, 6);
4710 path.cubicTo(1, 2, 7.16666698f, 6.66666698f, -4.66666651f, 7.66666651f);
4711 path.close();
4712 pathB.setFillType(SkPath::kWinding_FillType);
4713 pathB.moveTo(1, 2);
4714 pathB.cubicTo(7.16666698f, 6.66666698f, -4.66666651f, 7.66666651f, 2, 6);
4715 pathB.close();
4716 SkPath qPath, qPathB;
4717 CubicPathToQuads(path, &qPath);
4718 CubicPathToQuads(pathB, &qPathB);
4719 testPathOp(reporter, qPath, qPathB, kIntersect_SkPathOp, filename);
4720}
4721
4722static void loops34i(skiatest::Reporter* reporter, const char* filename) {
4723 SkPath path, pathB;
4724 path.setFillType(SkPath::kWinding_FillType);
4725 path.moveTo(3, 4);
4726 path.cubicTo(0, 4, 2.5f, 4, 3, 9);
4727 path.close();
4728 pathB.setFillType(SkPath::kWinding_FillType);
4729 pathB.moveTo(0, 4);
4730 pathB.cubicTo(2.5f, 4, 3, 9, 3, 4);
4731 pathB.close();
4732 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4733}
4734
4735static void loops35i(skiatest::Reporter* reporter, const char* filename) {
4736 SkPath path, pathB;
4737 path.setFillType(SkPath::kWinding_FillType);
4738 path.moveTo(3, 4);
4739 path.cubicTo(0, 4, 2.5f, 4, 3, 10);
4740 path.close();
4741 pathB.setFillType(SkPath::kWinding_FillType);
4742 pathB.moveTo(0, 4);
4743 pathB.cubicTo(2.5f, 4, 3, 10, 3, 4);
4744 pathB.close();
4745 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4746}
4747
4748static void loops36i(skiatest::Reporter* reporter, const char* filename) {
4749 SkPath path, pathB;
4750 path.setFillType(SkPath::kWinding_FillType);
4751 path.moveTo(3, 4);
4752 path.cubicTo(1, 4, 2.66666675f, 4, 3, 8);
4753 path.close();
4754 pathB.setFillType(SkPath::kWinding_FillType);
4755 pathB.moveTo(1, 4);
4756 pathB.cubicTo(2.66666675f, 4, 3, 8, 3, 4);
4757 pathB.close();
4758 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4759}
4760
4761static void loops37i(skiatest::Reporter* reporter, const char* filename) {
4762 SkPath path, pathB;
4763 path.setFillType(SkPath::kWinding_FillType);
4764 path.moveTo(2, 4);
4765 path.cubicTo(1, 4, 1.83333337f, 4, 2, 5.33333349f);
4766 path.close();
4767 pathB.setFillType(SkPath::kWinding_FillType);
4768 pathB.moveTo(1, 4);
4769 pathB.cubicTo(1.83333337f, 4, 2, 5.33333349f, 2, 4);
4770 pathB.close();
4771 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4772}
4773
4774static void loops38i(skiatest::Reporter* reporter, const char* filename) {
4775 SkPath path, pathB;
4776 path.setFillType(SkPath::kWinding_FillType);
4777 path.moveTo(3, 4);
4778 path.cubicTo(2, 4, 2.83333325f, 4, 3, 6);
4779 path.close();
4780 pathB.setFillType(SkPath::kWinding_FillType);
4781 pathB.moveTo(2, 4);
4782 pathB.cubicTo(2.83333325f, 4, 3, 6, 3, 4);
4783 pathB.close();
4784 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4785}
4786
4787static void loops39i(skiatest::Reporter* reporter, const char* filename) {
4788 SkPath path, pathB;
4789 path.setFillType(SkPath::kWinding_FillType);
4790 path.moveTo(3, 5);
4791 path.cubicTo(0, 5, 2.5f, 5, 3, 10);
4792 path.close();
4793 pathB.setFillType(SkPath::kWinding_FillType);
4794 pathB.moveTo(0, 5);
4795 pathB.cubicTo(2.5f, 5, 3, 10, 3, 5);
4796 pathB.close();
4797 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4798}
4799
4800static void loops40i(skiatest::Reporter* reporter, const char* filename) {
4801 SkPath path, pathB;
4802 path.setFillType(SkPath::kWinding_FillType);
4803 path.moveTo(3, 5);
4804 path.cubicTo(0, 5, 2.5f, 5, 3, 11);
4805 path.close();
4806 pathB.setFillType(SkPath::kWinding_FillType);
4807 pathB.moveTo(0, 5);
4808 pathB.cubicTo(2.5f, 5, 3, 11, 3, 5);
4809 pathB.close();
4810 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4811}
4812
4813static void loops40iAsQuads(skiatest::Reporter* reporter, const char* filename) {
4814 SkPath path, pathB;
4815 path.setFillType(SkPath::kWinding_FillType);
4816 path.moveTo(3, 5);
4817 path.cubicTo(0, 5, 2.5f, 5, 3, 11);
4818 path.close();
4819 pathB.setFillType(SkPath::kWinding_FillType);
4820 pathB.moveTo(0, 5);
4821 pathB.cubicTo(2.5f, 5, 3, 11, 3, 5);
4822 pathB.close();
4823 SkPath qPath, qPathB;
4824 CubicPathToQuads(path, &qPath);
4825 CubicPathToQuads(pathB, &qPathB);
4826 testPathOp(reporter, qPath, qPathB, kIntersect_SkPathOp, filename);
4827}
4828
caryclarkaec25102015-04-29 08:28:30 -07004829static void loops44i(skiatest::Reporter* reporter, const char* filename) {
4830 SkPath path, pathB;
4831 path.setFillType(SkPath::kWinding_FillType);
4832 path.moveTo(1, 5);
4833 path.cubicTo(0, 1, 7.33333302f, 5.33333349f, -7, 7);
4834 path.close();
4835 pathB.setFillType(SkPath::kWinding_FillType);
4836 pathB.moveTo(0, 1);
4837 pathB.cubicTo(7.33333302f, 5.33333349f, -7, 7, 1, 5);
4838 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004839 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004840}
4841
caryclarkaec25102015-04-29 08:28:30 -07004842static void loops45i(skiatest::Reporter* reporter, const char* filename) {
4843 SkPath path, pathB;
4844 path.setFillType(SkPath::kWinding_FillType);
4845 path.moveTo(1, 6);
4846 path.cubicTo(0, 2, 7.33333302f, 6.33333302f, -7, 8);
4847 path.close();
4848 pathB.setFillType(SkPath::kWinding_FillType);
4849 pathB.moveTo(0, 2);
4850 pathB.cubicTo(7.33333302f, 6.33333302f, -7, 8, 1, 6);
4851 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004852 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004853}
4854
caryclarkaec25102015-04-29 08:28:30 -07004855static void loops46i(skiatest::Reporter* reporter, const char* filename) {
4856 SkPath path, pathB;
4857 path.setFillType(SkPath::kWinding_FillType);
4858 path.moveTo(2, 6);
4859 path.cubicTo(1, 2, 8.33333302f, 6.33333302f, -6, 8);
4860 path.close();
4861 pathB.setFillType(SkPath::kWinding_FillType);
4862 pathB.moveTo(1, 2);
4863 pathB.cubicTo(8.33333302f, 6.33333302f, -6, 8, 2, 6);
4864 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004865 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004866}
4867
4868/*
4869FAILED: d:\cygwin\puregit\tests\pathopsextendedtest.cpp:346 0 */
4870static void loops47i(skiatest::Reporter* reporter, const char* filename) {
4871 SkPath path, pathB;
4872 path.setFillType(SkPath::kWinding_FillType);
4873 path.moveTo(2, 4);
4874 path.cubicTo(0, 1, 6, 5.83333302f, -4, 8);
4875 path.close();
4876 pathB.setFillType(SkPath::kWinding_FillType);
4877 pathB.moveTo(0, 1);
4878 pathB.cubicTo(6, 5.83333302f, -4, 8, 2, 4);
4879 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004880 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004881}
4882
caryclarkaec25102015-04-29 08:28:30 -07004883static void loops48i(skiatest::Reporter* reporter, const char* filename) {
4884 SkPath path, pathB;
4885 path.setFillType(SkPath::kWinding_FillType);
4886 path.moveTo(2, 6);
4887 path.cubicTo(0, 1, 9.33333302f, 6.83333302f, -8.33333302f, 9.16666603f);
4888 path.close();
4889 pathB.setFillType(SkPath::kWinding_FillType);
4890 pathB.moveTo(0, 1);
4891 pathB.cubicTo(9.33333302f, 6.83333302f, -8.33333302f, 9.16666603f, 2, 6);
4892 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004893 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004894}
4895
caryclarkaec25102015-04-29 08:28:30 -07004896static void loops49i(skiatest::Reporter* reporter, const char* filename) {
4897 SkPath path, pathB;
4898 path.setFillType(SkPath::kWinding_FillType);
4899 path.moveTo(0, 2);
4900 path.cubicTo(1, 4, -0.166666687f, 2.66666675f, 1.66666675f, 2);
4901 path.close();
4902 pathB.setFillType(SkPath::kWinding_FillType);
4903 pathB.moveTo(1, 4);
4904 pathB.cubicTo(-0.166666687f, 2.66666675f, 1.66666675f, 2, 0, 2);
4905 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004906 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004907}
4908
caryclarkaec25102015-04-29 08:28:30 -07004909static void loops50i(skiatest::Reporter* reporter, const char* filename) {
4910 SkPath path, pathB;
4911 path.setFillType(SkPath::kWinding_FillType);
4912 path.moveTo(0, 3);
4913 path.cubicTo(1, 5, -0.166666687f, 3.66666675f, 1.66666675f, 3);
4914 path.close();
4915 pathB.setFillType(SkPath::kWinding_FillType);
4916 pathB.moveTo(1, 5);
4917 pathB.cubicTo(-0.166666687f, 3.66666675f, 1.66666675f, 3, 0, 3);
4918 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004919 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004920}
4921
caryclarkaec25102015-04-29 08:28:30 -07004922static void loops51i(skiatest::Reporter* reporter, const char* filename) {
4923 SkPath path, pathB;
4924 path.setFillType(SkPath::kWinding_FillType);
4925 path.moveTo(1, 2);
4926 path.cubicTo(2, 4, 0.833333313f, 2.66666675f, 2.66666675f, 2);
4927 path.close();
4928 pathB.setFillType(SkPath::kWinding_FillType);
4929 pathB.moveTo(2, 4);
4930 pathB.cubicTo(0.833333313f, 2.66666675f, 2.66666675f, 2, 1, 2);
4931 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004932 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004933}
4934
caryclarkaec25102015-04-29 08:28:30 -07004935static void loops52i(skiatest::Reporter* reporter, const char* filename) {
4936 SkPath path, pathB;
4937 path.setFillType(SkPath::kWinding_FillType);
4938 path.moveTo(1, 3);
4939 path.cubicTo(2, 5, 0.833333313f, 3.66666675f, 2.66666675f, 3);
4940 path.close();
4941 pathB.setFillType(SkPath::kWinding_FillType);
4942 pathB.moveTo(2, 5);
4943 pathB.cubicTo(0.833333313f, 3.66666675f, 2.66666675f, 3, 1, 3);
4944 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004945 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004946}
4947
caryclarkaec25102015-04-29 08:28:30 -07004948static void loops53i(skiatest::Reporter* reporter, const char* filename) {
4949 SkPath path, pathB;
4950 path.setFillType(SkPath::kWinding_FillType);
4951 path.moveTo(2, 3);
4952 path.cubicTo(3, 5, 1.83333325f, 3.66666675f, 3.66666651f, 3);
4953 path.close();
4954 pathB.setFillType(SkPath::kWinding_FillType);
4955 pathB.moveTo(3, 5);
4956 pathB.cubicTo(1.83333325f, 3.66666675f, 3.66666651f, 3, 2, 3);
4957 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004958 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004959}
4960
caryclarkaec25102015-04-29 08:28:30 -07004961static void loops54i(skiatest::Reporter* reporter, const char* filename) {
4962 SkPath path, pathB;
4963 path.setFillType(SkPath::kWinding_FillType);
4964 path.moveTo(0, 2);
4965 path.cubicTo(1, 4, 0, 3, 1.66666675f, 2);
4966 path.close();
4967 pathB.setFillType(SkPath::kWinding_FillType);
4968 pathB.moveTo(1, 4);
4969 pathB.cubicTo(0, 3, 1.66666675f, 2, 0, 2);
4970 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004971 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004972}
4973
caryclarkaec25102015-04-29 08:28:30 -07004974static void loops55i(skiatest::Reporter* reporter, const char* filename) {
4975 SkPath path, pathB;
4976 path.setFillType(SkPath::kWinding_FillType);
4977 path.moveTo(0, 3);
4978 path.cubicTo(1, 5, 0, 4, 1.66666675f, 3);
4979 path.close();
4980 pathB.setFillType(SkPath::kWinding_FillType);
4981 pathB.moveTo(1, 5);
4982 pathB.cubicTo(0, 4, 1.66666675f, 3, 0, 3);
4983 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004984 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004985}
4986
caryclarkaec25102015-04-29 08:28:30 -07004987static void loops56i(skiatest::Reporter* reporter, const char* filename) {
4988 SkPath path, pathB;
4989 path.setFillType(SkPath::kWinding_FillType);
4990 path.moveTo(1, 2);
4991 path.cubicTo(2, 4, 0.99999994f, 3, 2.66666675f, 2);
4992 path.close();
4993 pathB.setFillType(SkPath::kWinding_FillType);
4994 pathB.moveTo(2, 4);
4995 pathB.cubicTo(0.99999994f, 3, 2.66666675f, 2, 1, 2);
4996 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004997 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004998}
4999
caryclarkaec25102015-04-29 08:28:30 -07005000static void loops57i(skiatest::Reporter* reporter, const char* filename) {
5001 SkPath path, pathB;
5002 path.setFillType(SkPath::kWinding_FillType);
5003 path.moveTo(1, 3);
5004 path.cubicTo(2, 5, 0.99999994f, 4, 2.66666675f, 3);
5005 path.close();
5006 pathB.setFillType(SkPath::kWinding_FillType);
5007 pathB.moveTo(2, 5);
5008 pathB.cubicTo(0.99999994f, 4, 2.66666675f, 3, 1, 3);
5009 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07005010 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07005011}
5012
caryclarkaec25102015-04-29 08:28:30 -07005013static void loops58i(skiatest::Reporter* reporter, const char* filename) {
5014 SkPath path, pathB;
5015 path.setFillType(SkPath::kWinding_FillType);
5016 path.moveTo(2, 3);
5017 path.cubicTo(3, 5, 2, 4, 3.66666651f, 3);
5018 path.close();
5019 pathB.setFillType(SkPath::kWinding_FillType);
5020 pathB.moveTo(3, 5);
5021 pathB.cubicTo(2, 4, 3.66666651f, 3, 2, 3);
5022 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07005023 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07005024}
5025
caryclark624637c2015-05-11 07:21:27 -07005026static void loops58iAsQuads(skiatest::Reporter* reporter, const char* filename) {
5027 SkPath path, pathB;
5028 path.setFillType(SkPath::kWinding_FillType);
5029 path.moveTo(2, 3);
5030 path.cubicTo(3, 5, 2, 4, 3.66666651f, 3);
5031 path.close();
5032 pathB.setFillType(SkPath::kWinding_FillType);
5033 pathB.moveTo(3, 5);
5034 pathB.cubicTo(2, 4, 3.66666651f, 3, 2, 3);
5035 pathB.close();
5036 SkPath qPath, qPathB;
5037 CubicPathToQuads(path, &qPath);
5038 CubicPathToQuads(pathB, &qPathB);
5039// SkPoint from = {2.61714339f,1.90228665f};
5040// SkPoint to = {2.617045833359139f,1.9013528935803314f};
5041// path_edit(from, to, &qPathB);
5042 testPathOp(reporter, qPath, qPathB, kIntersect_SkPathOp, filename);
5043}
5044
caryclarkaec25102015-04-29 08:28:30 -07005045static void loops59i(skiatest::Reporter* reporter, const char* filename) {
5046 SkPath path, pathB;
5047 path.setFillType(SkPath::kWinding_FillType);
5048 path.moveTo(0, 6);
5049 path.cubicTo(1, 2, 7.33333302f, 1.66666663f, -7.5f, 2);
5050 path.close();
5051 pathB.setFillType(SkPath::kWinding_FillType);
5052 pathB.moveTo(1, 2);
5053 pathB.cubicTo(7.33333302f, 1.66666663f, -7.5f, 2, 0, 6);
5054 pathB.close();
5055 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
5056}
5057
caryclarkaec25102015-04-29 08:28:30 -07005058static void loops59iasQuads(skiatest::Reporter* reporter, const char* filename) {
5059 SkPath path, pathB;
5060 path.setFillType(SkPath::kWinding_FillType);
5061 path.moveTo(0, 6);
5062 path.cubicTo(1, 2, 7.33333302f, 1.66666663f, -7.5f, 2);
5063 path.close();
5064 pathB.setFillType(SkPath::kWinding_FillType);
5065 pathB.moveTo(1, 2);
5066 pathB.cubicTo(7.33333302f, 1.66666663f, -7.5f, 2, 0, 6);
5067 pathB.close();
5068 SkPath qPath, qPathB;
5069 CubicPathToQuads(path, &qPath);
5070 CubicPathToQuads(pathB, &qPathB);
5071 SkPoint from = {2.61714339f,1.90228665f};
5072 SkPoint to = {2.617045833359139f,1.9013528935803314f};
5073 path_edit(from, to, &qPathB);
5074 testPathOp(reporter, qPath, qPathB, kIntersect_SkPathOp, filename);
5075}
5076
5077static void cubics41d(skiatest::Reporter* reporter, const char* filename) {
5078 SkPath path, pathB;
5079 path.setFillType(SkPath::kWinding_FillType);
5080 path.moveTo(0, 1);
5081 path.cubicTo(1, 4, 3, 0, 3, 1);
5082 path.close();
5083 pathB.setFillType(SkPath::kWinding_FillType);
5084 pathB.moveTo(0, 3);
5085 pathB.cubicTo(1, 3, 1, 0, 4, 1);
5086 pathB.close();
5087 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
5088}
5089
caryclark624637c2015-05-11 07:21:27 -07005090void loops61i(skiatest::Reporter* reporter, const char* filename) {
5091 SkPath path, pathB;
5092 path.setFillType(SkPath::kWinding_FillType);
5093 path.moveTo(0, 1);
5094 path.cubicTo(1, 5, -6.33333302f, 0.666666627f, 8, -1);
5095 path.close();
5096 pathB.setFillType(SkPath::kWinding_FillType);
5097 pathB.moveTo(1, 5);
5098 pathB.cubicTo(-6.33333302f, 0.666666627f, 8, -1, 0, 1);
5099 pathB.close();
caryclarkbca19f72015-05-13 08:23:48 -07005100 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark624637c2015-05-11 07:21:27 -07005101}
5102
5103static void loops62i(skiatest::Reporter* reporter, const char* filename) {
5104 SkPath path, pathB;
5105 path.setFillType(SkPath::kWinding_FillType);
5106 path.moveTo(0, 2);
5107 path.cubicTo(1, 6, -6.33333302f, 1.66666663f, 8, 0);
5108 path.close();
5109 pathB.setFillType(SkPath::kWinding_FillType);
5110 pathB.moveTo(1, 6);
5111 pathB.cubicTo(-6.33333302f, 1.66666663f, 8, 0, 0, 2);
5112 pathB.close();
caryclarkbca19f72015-05-13 08:23:48 -07005113 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark624637c2015-05-11 07:21:27 -07005114}
5115
5116static void loops63i(skiatest::Reporter* reporter, const char* filename) {
5117 SkPath path, pathB;
5118 path.setFillType(SkPath::kWinding_FillType);
5119 path.moveTo(0, 1);
5120 path.cubicTo(2, 4, -4, -0.833333254f, 6, -3);
5121 path.close();
5122 pathB.setFillType(SkPath::kWinding_FillType);
5123 pathB.moveTo(2, 4);
5124 pathB.cubicTo(-4, -0.833333254f, 6, -3, 0, 1);
5125 pathB.close();
caryclarkbca19f72015-05-13 08:23:48 -07005126 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark624637c2015-05-11 07:21:27 -07005127}
5128
5129static void cubics44d(skiatest::Reporter* reporter, const char* filename) {
5130 SkPath path, pathB;
5131 path.setFillType(SkPath::kWinding_FillType);
5132 path.moveTo(3, 4);
5133 path.cubicTo(2, 5, 3, 1, 6, 2);
5134 path.close();
5135 pathB.setFillType(SkPath::kWinding_FillType);
5136 pathB.moveTo(1, 3);
5137 pathB.cubicTo(2, 6, 4, 3, 5, 2);
5138 pathB.close();
caryclarkbca19f72015-05-13 08:23:48 -07005139 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark624637c2015-05-11 07:21:27 -07005140}
5141
5142static void cubics45u(skiatest::Reporter* reporter, const char* filename) {
5143 SkPath path, pathB;
5144 path.setFillType(SkPath::kWinding_FillType);
5145 path.moveTo(1, 3);
5146 path.cubicTo(2, 6, 4, 3, 5, 2);
5147 path.close();
5148 pathB.setFillType(SkPath::kWinding_FillType);
5149 pathB.moveTo(3, 4);
5150 pathB.cubicTo(2, 5, 3, 1, 6, 2);
5151 pathB.close();
caryclarkbca19f72015-05-13 08:23:48 -07005152 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
caryclark624637c2015-05-11 07:21:27 -07005153}
5154
caryclark94c902e2015-08-18 07:12:43 -07005155static void fuzz38(skiatest::Reporter* reporter, const char* filename) {
5156 SkPath path, pathB;
5157 path.moveTo(100.34f, 303.312f);
5158 path.lineTo(-1e+08, 303.312f);
5159 path.lineTo(102, 310.156f);
5160 path.lineTo(100.34f, 310.156f);
5161 path.lineTo(100.34f, 303.312f);
5162 path.close();
5163 testPathOpCheck(reporter, path, pathB, kUnion_SkPathOp, filename, FLAGS_runFail);
5164}
5165
caryclark580c40a2015-09-01 06:22:36 -07005166static void crbug_526025(skiatest::Reporter* reporter, const char* filename) {
caryclarkae576b72015-08-31 09:46:20 -07005167 SkPath path;
5168 path.setFillType((SkPath::FillType) 1);
5169path.moveTo(SkBits2Float(0x43b40000), SkBits2Float(0xcf000000)); // 360, -2.14748e+09f
5170path.cubicTo(SkBits2Float(0x4e0d628f), SkBits2Float(0xceffffff), SkBits2Float(0x4e800003), SkBits2Float(0xcec6b143), SkBits2Float(0x4e800002), SkBits2Float(0xce7ffffc)); // 5.93012e+08f, -2.14748e+09f, 1.07374e+09f, -1.66675e+09f, 1.07374e+09f, -1.07374e+09f
5171path.cubicTo(SkBits2Float(0x4e800002), SkBits2Float(0xcde53aee), SkBits2Float(0x4e0d6292), SkBits2Float(0xc307820e), SkBits2Float(0x44627d00), SkBits2Float(0x437ffff2)); // 1.07374e+09f, -4.80731e+08f, 5.93012e+08f, -135.508f, 905.953f, 256
5172path.lineTo(SkBits2Float(0x444bf3bc), SkBits2Float(0x4460537e)); // 815.808f, 897.305f
5173path.lineTo(SkBits2Float(0x43553abd), SkBits2Float(0x440f3cbd)); // 213.229f, 572.949f
5174path.lineTo(SkBits2Float(0x42000000), SkBits2Float(0x41800000)); // 32, 16
5175path.lineTo(SkBits2Float(0x42c80000), SkBits2Float(0x44000000)); // 100, 512
5176path.lineTo(SkBits2Float(0x43553abd), SkBits2Float(0x440f3cbd)); // 213.229f, 572.949f
5177path.lineTo(SkBits2Float(0x43b40000), SkBits2Float(0x44800000)); // 360, 1024
5178path.lineTo(SkBits2Float(0x43b40000), SkBits2Float(0x45816000)); // 360, 4140
5179
5180 SkPath path1(path);
5181 path.reset();
5182 path.setFillType((SkPath::FillType) 0);
5183path.moveTo(SkBits2Float(0x42fe0000), SkBits2Float(0x43a08000)); // 127, 321
5184path.lineTo(SkBits2Float(0x45d5c000), SkBits2Float(0x43870000)); // 6840, 270
5185path.lineTo(SkBits2Float(0xd0a00000), SkBits2Float(0x4cbebc20)); // -2.14748e+10f, 1e+08
5186path.lineTo(SkBits2Float(0x451f7000), SkBits2Float(0x42800000)); // 2551, 64
5187path.lineTo(SkBits2Float(0x42fe0000), SkBits2Float(0x43a08000)); // 127, 321
5188path.close();
5189
5190 SkPath path2(path);
5191 testPathOp(reporter, path1, path2, (SkPathOp) 2, filename);
5192}
5193
caryclark54359292015-03-26 07:52:43 -07005194static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0;
caryclark94c902e2015-08-18 07:12:43 -07005195static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0;
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00005196static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0;
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005197
caryclark624637c2015-05-11 07:21:27 -07005198#define TEST(name) { name, #name }
5199
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005200static struct TestDesc tests[] = {
caryclark580c40a2015-09-01 06:22:36 -07005201 TEST(crbug_526025),
caryclark94c902e2015-08-18 07:12:43 -07005202 TEST(fuzz38),
caryclark624637c2015-05-11 07:21:27 -07005203 TEST(cubics44d),
5204 TEST(cubics45u),
5205 TEST(loops61i),
5206 TEST(loops62i),
5207 TEST(loops63i),
5208 TEST(loops58iAsQuads),
caryclarkaec25102015-04-29 08:28:30 -07005209 TEST(cubics41d),
5210 TEST(loops59iasQuads),
5211 TEST(loops59i),
caryclarkaec25102015-04-29 08:28:30 -07005212 TEST(loops44i),
5213 TEST(loops45i),
5214 TEST(loops46i),
5215 TEST(loops47i),
5216 TEST(loops48i),
5217 TEST(loops49i),
5218 TEST(loops50i),
5219 TEST(loops51i),
5220 TEST(loops52i),
5221 TEST(loops53i),
5222 TEST(loops54i),
5223 TEST(loops55i),
5224 TEST(loops56i),
5225 TEST(loops57i),
5226 TEST(loops58i),
5227 TEST(loops33iMod),
5228 TEST(loops33iAsQuads),
5229 TEST(loops33i),
5230 TEST(loops40i),
5231 TEST(loops40iAsQuads),
5232 TEST(loops39i),
5233 TEST(loops38i),
5234 TEST(loops37i),
5235 TEST(loops36i),
5236 TEST(loops35i),
5237 TEST(loops34i),
5238 TEST(loops32i),
5239 TEST(loops31i),
5240 TEST(loops30i),
5241 TEST(loops29i),
5242 TEST(loops28i),
5243 TEST(loops27i),
5244 TEST(loops26i),
5245 TEST(loops25i),
5246 TEST(loops24i),
5247 TEST(loops23i),
5248 TEST(loops22i),
5249 TEST(loops21i),
5250 TEST(loops20i),
5251 TEST(cubics20d),
caryclark08bc8482015-04-24 09:08:57 -07005252 TEST(cubics6d),
5253 TEST(cubics7d),
5254 TEST(cubics8d),
5255 TEST(cubics9d),
5256 TEST(cubics10u),
5257 TEST(cubics11i),
5258 TEST(cubics12d),
5259 TEST(cubics13d),
5260 TEST(cubics14d),
5261 TEST(cubics15d),
5262 TEST(cubics16i),
5263 TEST(cubics17d),
5264 TEST(cubics18d),
5265 TEST(cubics19d),
5266 TEST(cubicOp157),
5267 TEST(cubicOp142),
caryclark03b03ca2015-04-23 09:13:37 -07005268 TEST(loops4i),
5269 TEST(quadRect1),
5270 TEST(quadRect2),
5271 TEST(quadRect3),
5272 TEST(quadRect4),
5273 TEST(quadRect5),
5274 TEST(quadRect6),
5275 TEST(cubicOp141),
5276 TEST(cubicOp58d),
5277 TEST(loops5i),
5278 TEST(cubicOp140),
5279 TEST(cubicOp139),
5280 TEST(cubics138),
5281 TEST(cubics137),
5282 TEST(cubicOp136a),
5283 TEST(cubicOp136),
5284 TEST(cubicOp135),
5285 TEST(cubicOp134),
5286 TEST(cubicOp133),
caryclark03b03ca2015-04-23 09:13:37 -07005287 TEST(loop12),
caryclark1049f122015-04-20 08:31:59 -07005288 TEST(cubicOp132),
5289 TEST(loop11),
5290 TEST(loop10),
5291 TEST(circlesOp3),
5292 TEST(loop9),
5293 TEST(loop8),
5294 TEST(rects5),
5295 TEST(loop7),
5296 TEST(cubicOp130a),
5297 TEST(rRect1x),
5298 TEST(circlesOp2),
5299 TEST(circlesOp1),
5300 TEST(cubicOp131),
5301 TEST(cubicOp130),
5302 TEST(cubicOp129),
caryclark54359292015-03-26 07:52:43 -07005303 TEST(cubicOp128),
5304 TEST(cubicOp127),
5305 TEST(cubicOp126),
5306 TEST(cubicOp125),
5307 TEST(cubicOp124),
5308 TEST(loop6),
5309 TEST(loop5),
5310 TEST(cubicOp123),
5311 TEST(cubicOp122),
5312 TEST(cubicOp121),
5313 TEST(cubicOp120),
5314 TEST(cubicOp119),
5315 TEST(loop4),
5316 TEST(loop3),
5317 TEST(loop2),
5318 TEST(loop1asQuad),
5319 TEST(loop1),
5320 TEST(issue3517),
5321 TEST(cubicOp118),
5322 TEST(cubicOp117),
5323 TEST(cubicOp116),
5324 TEST(testRect2),
5325 TEST(testRect1),
caryclark65f55312014-11-13 06:58:52 -08005326 TEST(cubicOp115),
caryclark54359292015-03-26 07:52:43 -07005327 TEST(issue2753),
caryclark03b03ca2015-04-23 09:13:37 -07005328 TEST(cubicOp114),
caryclark80a83ad2014-08-12 05:49:37 -07005329 TEST(issue2808),
caryclarke4097e32014-06-18 07:24:19 -07005330 TEST(cubicOp114asQuad),
caryclarkdac1d172014-06-17 05:15:38 -07005331 TEST(rects4),
5332 TEST(rects3),
5333 TEST(rects2),
5334 TEST(rects1),
caryclarkdac1d172014-06-17 05:15:38 -07005335 TEST(issue2540),
commit-bot@chromium.org2db7fe72014-05-07 15:31:40 +00005336 TEST(issue2504),
commit-bot@chromium.org91fc81c2014-04-30 13:37:48 +00005337 TEST(kari1),
commit-bot@chromium.org8cb1daa2014-04-25 12:59:11 +00005338 TEST(quadOp10i),
commit-bot@chromium.org8cb1daa2014-04-25 12:59:11 +00005339 TEST(cubicOp113),
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00005340 TEST(skpcarrot_is24),
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00005341 TEST(issue1417),
commit-bot@chromium.org8cb1daa2014-04-25 12:59:11 +00005342 TEST(cubicOp112),
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00005343 TEST(skpadspert_net23),
5344 TEST(skpadspert_de11),
5345 TEST(findFirst1),
5346 TEST(xOp2i),
5347 TEST(xOp3i),
5348 TEST(xOp1u),
5349 TEST(xOp1i),
5350 TEST(cubicOp111),
5351 TEST(cubicOp110),
5352 TEST(cubicOp109),
5353 TEST(cubicOp108),
5354 TEST(cubicOp107),
5355 TEST(cubicOp106),
5356 TEST(cubicOp105),
5357 TEST(cubicOp104),
5358 TEST(cubicOp103),
5359 TEST(cubicOp102),
5360 TEST(cubicOp101),
5361 TEST(cubicOp100),
5362 TEST(cubicOp99),
5363 TEST(issue1435),
caryclark@google.coma2bbc6e2013-11-01 17:36:03 +00005364 TEST(cubicOp98x),
5365 TEST(cubicOp97x),
caryclark54359292015-03-26 07:52:43 -07005366 TEST(skpcarpetplanet_ru22),
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00005367 TEST(cubicOp96d),
5368 TEST(cubicOp95u),
5369 TEST(skpadbox_lt15),
5370 TEST(skpagentxsites_com55),
5371 TEST(skpadventistmission_org572),
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00005372 TEST(skpadoption_org196),
5373 TEST(skpbambootheme_com12),
5374 TEST(skpbakosoft_com10),
5375 TEST(skpakmmos_ru100),
5376 TEST(skpbangalorenest_com4),
5377 TEST(skpbingoentertainment_net189),
5378 TEST(skpbestred_ru37),
5379 TEST(skpbenzoteh_ru152),
5380 TEST(skpcamcorder_kz21),
5381 TEST(skpcaffelavazzait_com_ua21),
5382 TEST(skpcarrefour_ro62),
5383 TEST(skpcavablar_net563),
5384 TEST(skpinsomnia_gr72),
5385 TEST(skpadbox_lt8),
5386 TEST(skpact_com43),
5387 TEST(skpacesoftech_com47),
5388 TEST(skpabcspark_ca103),
5389 TEST(cubicOp94u),
5390 TEST(cubicOp93d),
5391 TEST(cubicOp92i),
5392 TEST(skpadithya_putr4_blogspot_com551),
5393 TEST(skpadindex_de4),
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00005394 TEST(skpaiaigames_com870),
5395 TEST(skpaaalgarve_org53),
5396 TEST(skpkkiste_to716),
caryclark@google.com570863f2013-09-16 15:55:01 +00005397 TEST(cubicOp91u),
5398 TEST(cubicOp90u),
5399 TEST(cubicOp89u),
5400 TEST(cubicOp88u),
5401 TEST(cubicOp87u),
5402 TEST(cubicOp86i),
5403 TEST(loopEdge2),
5404 TEST(loopEdge1),
5405 TEST(rectOp3x),
5406 TEST(rectOp2i),
5407 TEST(rectOp1i),
5408 TEST(issue1418b),
caryclark@google.com4fdbb222013-07-23 15:27:41 +00005409 TEST(cubicOp85i),
caryclark@google.com4fdbb222013-07-23 15:27:41 +00005410 TEST(issue1418),
5411 TEST(skpkkiste_to98),
caryclark@google.comfa2aeee2013-07-15 13:29:13 +00005412 TEST(skpahrefs_com29),
5413 TEST(cubicOp85d),
5414 TEST(skpahrefs_com88),
caryclark@google.com07e97fc2013-07-08 17:17:02 +00005415 TEST(skphealth_com76),
5416 TEST(skpancestry_com1),
5417 TEST(skpbyte_com1),
5418 TEST(skpeldorado_com_ua1),
5419 TEST(skp96prezzi1),
caryclark@google.comcffbcc32013-06-04 17:59:42 +00005420 TEST(skpClip2),
caryclark@google.comcffbcc32013-06-04 17:59:42 +00005421 TEST(skpClip1),
5422 TEST(cubicOp84d),
5423 TEST(cubicOp83i),
reed@google.com277c3f82013-05-31 15:17:50 +00005424 TEST(cubicOp82i),
5425 TEST(cubicOp81d),
5426 TEST(cubicOp80i),
5427 TEST(cubicOp79u),
reed@google.com277c3f82013-05-31 15:17:50 +00005428 TEST(cubicOp78u),
5429 TEST(cubicOp77i),
caryclark@google.comcffbcc32013-06-04 17:59:42 +00005430 TEST(cubicOp76u),
reed@google.com277c3f82013-05-31 15:17:50 +00005431 TEST(cubicOp75d),
caryclark@google.comcffbcc32013-06-04 17:59:42 +00005432 TEST(cubicOp74d),
reed@google.com277c3f82013-05-31 15:17:50 +00005433 TEST(cubicOp73d),
5434 TEST(cubicOp72i),
5435 TEST(cubicOp71d),
caryclark@google.coma5e55922013-05-07 18:51:31 +00005436 TEST(skp5),
5437 TEST(skp4),
5438 TEST(skp3),
5439 TEST(skp2),
5440 TEST(skp1),
caryclark@google.com6dc7df62013-04-25 11:51:54 +00005441 TEST(rRect1),
caryclark@google.coma5e55922013-05-07 18:51:31 +00005442 TEST(cubicOp70d),
caryclark@google.com03610322013-04-18 15:58:21 +00005443 TEST(cubicOp69d),
5444 TEST(cubicOp68u),
caryclark@google.comb3f09212013-04-17 15:49:16 +00005445 TEST(cubicOp67u),
5446 TEST(cubicOp66u),
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005447 TEST(rectOp1d),
5448 TEST(cubicOp65d),
5449 TEST(cubicOp64d),
5450 TEST(cubicOp63d),
5451 TEST(cubicOp62d),
5452 TEST(cubicOp61d),
5453 TEST(cubicOp60d),
5454 TEST(cubicOp59d),
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005455 TEST(cubicOp57d),
5456 TEST(cubicOp56d),
5457 TEST(cubicOp55d),
5458 TEST(cubicOp54d),
5459 TEST(cubicOp53d),
5460 TEST(cubicOp52d),
5461 TEST(cubicOp51d),
5462 TEST(cubicOp50d),
5463 TEST(cubicOp49d),
5464 TEST(cubicOp48d),
5465 TEST(cubicOp47d),
5466 TEST(cubicOp46d),
5467 TEST(cubicOp45d),
5468 TEST(cubicOp44d),
5469 TEST(cubicOp43d),
5470 TEST(cubicOp42d),
5471 TEST(cubicOp41i),
5472 TEST(cubicOp40d),
5473 TEST(cubicOp39d),
5474 TEST(cubicOp38d),
5475 TEST(cubicOp37d),
5476 TEST(cubicOp36u),
5477 TEST(cubicOp35d),
5478 TEST(cubicOp34d),
5479 TEST(cubicOp33i),
5480 TEST(cubicOp32d),
5481 TEST(cubicOp31d),
5482 TEST(cubicOp31x),
5483 TEST(cubicOp31u),
5484 TEST(cubicOp30d),
5485 TEST(cubicOp29d),
5486 TEST(cubicOp28u),
5487 TEST(cubicOp27d),
5488 TEST(cubicOp26d),
5489 TEST(cubicOp25i),
5490 TEST(testOp8d),
5491 TEST(testDiff1),
5492 TEST(testIntersect1),
5493 TEST(testUnion1),
5494 TEST(testXor1),
5495 TEST(testDiff2),
5496 TEST(testIntersect2),
5497 TEST(testUnion2),
5498 TEST(testXor2),
5499 TEST(testOp1d),
5500 TEST(testOp2d),
5501 TEST(testOp3d),
5502 TEST(testOp1u),
5503 TEST(testOp4d),
5504 TEST(testOp5d),
5505 TEST(testOp6d),
5506 TEST(testOp7d),
5507 TEST(testOp2u),
5508
5509 TEST(cubicOp24d),
5510 TEST(cubicOp23d),
5511 TEST(cubicOp22d),
5512 TEST(cubicOp21d),
5513 TEST(cubicOp20d),
5514 TEST(cubicOp19i),
5515 TEST(cubicOp18d),
5516 TEST(cubicOp17d),
5517 TEST(cubicOp16d),
5518 TEST(cubicOp15d),
5519 TEST(cubicOp14d),
5520 TEST(cubicOp13d),
5521 TEST(cubicOp12d),
5522 TEST(cubicOp11d),
5523 TEST(cubicOp10d),
5524 TEST(cubicOp1i),
5525 TEST(cubicOp9d),
5526 TEST(quadOp9d),
5527 TEST(lineOp9d),
5528 TEST(cubicOp8d),
5529 TEST(cubicOp7d),
5530 TEST(cubicOp6d),
5531 TEST(cubicOp5d),
5532 TEST(cubicOp3d),
5533 TEST(cubicOp2d),
5534 TEST(cubicOp1d),
5535};
5536
caryclark@google.comad65a3e2013-04-15 19:13:59 +00005537static const size_t testCount = SK_ARRAY_COUNT(tests);
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005538
5539static struct TestDesc subTests[] = {
caryclarkbca19f72015-05-13 08:23:48 -07005540 TEST(loops47i),
caryclark624637c2015-05-11 07:21:27 -07005541 TEST(loops61i),
5542 TEST(loops62i),
caryclarkbca19f72015-05-13 08:23:48 -07005543 TEST(issue3517),
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005544};
5545
caryclark@google.comad65a3e2013-04-15 19:13:59 +00005546static const size_t subTestCount = SK_ARRAY_COUNT(subTests);
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005547
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00005548static void (*firstSubTest)(skiatest::Reporter* , const char* filename) = 0;
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005549
caryclarkbca19f72015-05-13 08:23:48 -07005550static bool runSubTests = false;
caryclark03b03ca2015-04-23 09:13:37 -07005551static bool runSubTestsFirst = true;
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005552static bool runReverse = false;
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005553
tfarina@chromium.org78e7b4e2014-01-02 21:45:03 +00005554DEF_TEST(PathOpsOp, reporter) {
caryclark@google.com07e97fc2013-07-08 17:17:02 +00005555#if DEBUG_SHOW_TEST_NAME
5556 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH);
5557#endif
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00005558 if (runSubTests && runSubTestsFirst) {
halcanary96fcdcc2015-08-27 07:41:13 -07005559 RunTestSet(reporter, subTests, subTestCount, firstSubTest, nullptr, stopTest, runReverse);
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005560 }
caryclark54359292015-03-26 07:52:43 -07005561 RunTestSet(reporter, tests, testCount, firstTest, skipTest, stopTest, runReverse);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00005562 if (runSubTests && !runSubTestsFirst) {
halcanary96fcdcc2015-08-27 07:41:13 -07005563 RunTestSet(reporter, subTests, subTestCount, firstSubTest, nullptr, stopTest, runReverse);
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005564 }
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005565}
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00005566
5567static void bufferOverflow(skiatest::Reporter* reporter, const char* filename) {
5568 SkPath path;
5569 path.addRect(0,0, 300,170141183460469231731687303715884105728.f);
5570 SkPath pathB;
5571 pathB.addRect(0,0, 300,16);
caryclarkbca19f72015-05-13 08:23:48 -07005572 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00005573}
5574
caryclark361b8b02014-09-08 10:25:38 -07005575// m 100,0 60,170 -160,-110 200,0 -170,11000000000 z
5576static void fuzz433(skiatest::Reporter* reporter, const char* filename) {
5577 SkPath path1, path2;
5578 path1.moveTo(100,0);
5579 path1.lineTo(60,170);
5580 path1.lineTo(-160,-110);
5581 path1.lineTo(200,0);
5582 path1.lineTo(-170,11000000000.0f);
5583 path1.close();
5584
5585 path2.moveTo(100 + 20,0 + 20);
5586 path2.lineTo(60 + 20,170 + 20);
5587 path2.lineTo(-160 + 20,-110 + 20);
5588 path2.lineTo(200 + 20,0 + 20);
5589 path2.lineTo(-170 + 20,11000000000.0f + 20);
5590 path2.close();
5591
caryclarkbca19f72015-05-13 08:23:48 -07005592 testPathOpCheck(reporter, path1, path2, kIntersect_SkPathOp, filename, FLAGS_runFail);
caryclark361b8b02014-09-08 10:25:38 -07005593}
5594
5595static void fuzz433b(skiatest::Reporter* reporter, const char* filename) {
5596 SkPath path1, path2;
5597 path1.setFillType(SkPath::kEvenOdd_FillType);
5598 path1.moveTo(140, 40);
5599 path1.lineTo(200, 210);
5600 path1.lineTo(40, 100);
5601 path1.lineTo(240, 100);
5602 path1.lineTo(70, 1.1e+10f);
5603 path1.lineTo(140, 40);
5604 path1.close();
5605
5606 path1.setFillType(SkPath::kWinding_FillType);
5607 path2.moveTo(190, 60);
5608 path2.lineTo(250, 230);
5609 path2.lineTo(90, 120);
5610 path2.lineTo(290, 120);
5611 path2.lineTo(120, 1.1e+10f);
5612 path2.lineTo(190, 60);
5613 path2.close();
5614
caryclarkbca19f72015-05-13 08:23:48 -07005615 testPathOpCheck(reporter, path1, path2, kUnion_SkPathOp, filename, FLAGS_runFail);
caryclark361b8b02014-09-08 10:25:38 -07005616}
5617
caryclark630240d2014-09-19 06:33:31 -07005618static void fuzz487a(skiatest::Reporter* reporter, const char* filename) {
5619 SkPath path;
5620 path.setFillType((SkPath::FillType) 0);
5621path.moveTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000));
5622path.lineTo(SkBits2Float(0x4309999a), SkBits2Float(0x42c00000));
5623path.cubicTo(SkBits2Float(0x4309999a), SkBits2Float(0x429a6666), SkBits2Float(0x42f9999a), SkBits2Float(0x4275999a), SkBits2Float(0x42d70001), SkBits2Float(0x42633333));
5624path.lineTo(SkBits2Float(0x42e90001), SkBits2Float(0x41b8cccc));
5625path.cubicTo(SkBits2Float(0x42dc6667), SkBits2Float(0x41ab3332), SkBits2Float(0x42cf3334), SkBits2Float(0x41a3ffff), SkBits2Float(0x42c20001), SkBits2Float(0x41a3ffff));
5626path.lineTo(SkBits2Float(0x42c20001), SkBits2Float(0x425d999a));
5627path.lineTo(SkBits2Float(0x42c20001), SkBits2Float(0x425d999a));
5628path.cubicTo(SkBits2Float(0x429c6668), SkBits2Float(0x425d999a), SkBits2Float(0x4279999c), SkBits2Float(0x42886667), SkBits2Float(0x42673335), SkBits2Float(0x42ab0000));
5629path.lineTo(SkBits2Float(0x41c0ccd0), SkBits2Float(0x42990000));
5630path.cubicTo(SkBits2Float(0x41b33336), SkBits2Float(0x42a5999a), SkBits2Float(0x41ac0003), SkBits2Float(0x42b2cccd), SkBits2Float(0x41ac0003), SkBits2Float(0x42c00000));
5631path.lineTo(SkBits2Float(0x4261999c), SkBits2Float(0x42c00000));
5632path.lineTo(SkBits2Float(0x4261999c), SkBits2Float(0x42c00000));
5633path.cubicTo(SkBits2Float(0x4261999c), SkBits2Float(0x434d3333), SkBits2Float(0x4364e667), SkBits2Float(0x4346b333), SkBits2Float(0x4364e667), SkBits2Float(0x43400000));
5634path.lineTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000));
5635path.close();
5636
5637 SkPath path1(path);
5638 path.reset();
5639 path.setFillType((SkPath::FillType) 0);
5640path.moveTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000));
5641path.lineTo(SkBits2Float(0x4309999a), SkBits2Float(0x42c00000));
5642path.cubicTo(SkBits2Float(0x4309999a), SkBits2Float(0x42a20000), SkBits2Float(0x43016667), SkBits2Float(0x4287cccd), SkBits2Float(0x42ea999a), SkBits2Float(0x4273999a));
5643path.lineTo(SkBits2Float(0x4306cccd), SkBits2Float(0x41f5999a));
5644path.cubicTo(SkBits2Float(0x42f76667), SkBits2Float(0x41c26667), SkBits2Float(0x42dd999a), SkBits2Float(0x41a4cccd), SkBits2Float(0x42c23334), SkBits2Float(0x41a4cccd));
5645path.lineTo(SkBits2Float(0x42c23334), SkBits2Float(0x425e0000));
5646path.cubicTo(SkBits2Float(0x42a43334), SkBits2Float(0x425e0000), SkBits2Float(0x428a0001), SkBits2Float(0x427ecccd), SkBits2Float(0x42780002), SkBits2Float(0x4297999a));
5647path.lineTo(SkBits2Float(0x41fccccd), SkBits2Float(0x42693333));
5648path.cubicTo(SkBits2Float(0x41c9999a), SkBits2Float(0x428acccd), SkBits2Float(0x41ac0000), SkBits2Float(0x42a4999a), SkBits2Float(0x41ac0000), SkBits2Float(0x42c00000));
5649path.lineTo(SkBits2Float(0x4261999a), SkBits2Float(0x42c00000));
5650path.cubicTo(SkBits2Float(0x4261999a), SkBits2Float(0x42de0000), SkBits2Float(0x42813333), SkBits2Float(0x42f83333), SkBits2Float(0x42996666), SkBits2Float(0x4303199a));
5651path.cubicTo(SkBits2Float(0x4272cccc), SkBits2Float(0x4303199a), SkBits2Float(0x423d3332), SkBits2Float(0x430de667), SkBits2Float(0x422d9999), SkBits2Float(0x431cb334));
5652path.lineTo(SkBits2Float(0x7086a1dc), SkBits2Float(0x42eecccd));
5653path.lineTo(SkBits2Float(0x41eb3333), SkBits2Float(0xc12ccccd));
5654path.lineTo(SkBits2Float(0x42053333), SkBits2Float(0xc1cccccd));
5655path.lineTo(SkBits2Float(0x42780000), SkBits2Float(0xc18f3334));
5656path.cubicTo(SkBits2Float(0x43206666), SkBits2Float(0x43134ccd), SkBits2Float(0x43213333), SkBits2Float(0x430db333), SkBits2Float(0x43213333), SkBits2Float(0x43080000));
5657path.lineTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000));
5658path.close();
5659
5660 SkPath path2(path);
caryclarkbca19f72015-05-13 08:23:48 -07005661 testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFail);
caryclark630240d2014-09-19 06:33:31 -07005662}
5663
5664static void fuzz487b(skiatest::Reporter* reporter, const char* filename) {
5665 SkPath path;
5666 path.setFillType((SkPath::FillType) 0);
5667path.moveTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000));
5668path.lineTo(SkBits2Float(0x4309999a), SkBits2Float(0x42c00000));
5669path.cubicTo(SkBits2Float(0x4309999a), SkBits2Float(0x429a6666), SkBits2Float(0x42f9999a), SkBits2Float(0x4275999a), SkBits2Float(0x42d70001), SkBits2Float(0x42633333));
5670path.lineTo(SkBits2Float(0x42e90001), SkBits2Float(0x41b8cccc));
5671path.cubicTo(SkBits2Float(0x42dc6667), SkBits2Float(0x41ab3332), SkBits2Float(0x42cf3334), SkBits2Float(0x41a3ffff), SkBits2Float(0x42c20001), SkBits2Float(0x41a3ffff));
5672path.lineTo(SkBits2Float(0x42c20001), SkBits2Float(0x425d999a));
5673path.lineTo(SkBits2Float(0x42c20001), SkBits2Float(0x425d999a));
5674path.cubicTo(SkBits2Float(0x429c6668), SkBits2Float(0x425d999a), SkBits2Float(0x4279999c), SkBits2Float(0x42886667), SkBits2Float(0x42673335), SkBits2Float(0x42ab0000));
5675path.lineTo(SkBits2Float(0x41c0ccd0), SkBits2Float(0x42990000));
5676path.cubicTo(SkBits2Float(0x41b33336), SkBits2Float(0x42a5999a), SkBits2Float(0x41ac0003), SkBits2Float(0x42b2cccd), SkBits2Float(0x41ac0003), SkBits2Float(0x42c00000));
5677path.lineTo(SkBits2Float(0x4261999c), SkBits2Float(0x42c00000));
5678path.lineTo(SkBits2Float(0x4261999c), SkBits2Float(0x42c00000));
5679path.cubicTo(SkBits2Float(0x4261999c), SkBits2Float(0x434d3333), SkBits2Float(0x4364e667), SkBits2Float(0x4346b333), SkBits2Float(0x4364e667), SkBits2Float(0x43400000));
5680path.lineTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000));
5681path.close();
5682
5683 SkPath path1(path);
5684 path.reset();
5685 path.setFillType((SkPath::FillType) 0);
5686path.moveTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000));
5687path.lineTo(SkBits2Float(0x4309999a), SkBits2Float(0x42c00000));
5688path.cubicTo(SkBits2Float(0x4309999a), SkBits2Float(0x42a20000), SkBits2Float(0x43016667), SkBits2Float(0x4287cccd), SkBits2Float(0x42ea999a), SkBits2Float(0x4273999a));
5689path.lineTo(SkBits2Float(0x4306cccd), SkBits2Float(0x41f5999a));
5690path.cubicTo(SkBits2Float(0x42f76667), SkBits2Float(0x41c26667), SkBits2Float(0x42dd999a), SkBits2Float(0x41a4cccd), SkBits2Float(0x42c23334), SkBits2Float(0x41a4cccd));
5691path.lineTo(SkBits2Float(0x42c23334), SkBits2Float(0x425e0000));
5692path.cubicTo(SkBits2Float(0x42a43334), SkBits2Float(0x425e0000), SkBits2Float(0x428a0001), SkBits2Float(0x427ecccd), SkBits2Float(0x42780002), SkBits2Float(0x4297999a));
5693path.lineTo(SkBits2Float(0x41fccccd), SkBits2Float(0x42693333));
5694path.cubicTo(SkBits2Float(0x41c9999a), SkBits2Float(0x428acccd), SkBits2Float(0x41ac0000), SkBits2Float(0x42a4999a), SkBits2Float(0x41ac0000), SkBits2Float(0x42c00000));
5695path.lineTo(SkBits2Float(0x4261999a), SkBits2Float(0x42c00000));
5696path.cubicTo(SkBits2Float(0x4261999a), SkBits2Float(0x42de0000), SkBits2Float(0x42813333), SkBits2Float(0x42f83333), SkBits2Float(0x42996666), SkBits2Float(0x4303199a));
5697path.cubicTo(SkBits2Float(0x4272cccc), SkBits2Float(0x4303199a), SkBits2Float(0x423d3332), SkBits2Float(0x430de667), SkBits2Float(0x422d9999), SkBits2Float(0x431cb334));
5698path.lineTo(SkBits2Float(0x7086a1dc), SkBits2Float(0x42eecccd));
5699path.lineTo(SkBits2Float(0x41eb3333), SkBits2Float(0xc12ccccd));
5700path.lineTo(SkBits2Float(0x42053333), SkBits2Float(0xc1cccccd));
5701path.lineTo(SkBits2Float(0x42780000), SkBits2Float(0xc18f3334));
5702path.cubicTo(SkBits2Float(0x43206666), SkBits2Float(0x43134ccd), SkBits2Float(0x43213333), SkBits2Float(0x430db333), SkBits2Float(0x43213333), SkBits2Float(0x43080000));
5703path.lineTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000));
5704path.close();
5705
5706 SkPath path2(path);
caryclarkbca19f72015-05-13 08:23:48 -07005707 testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFail);
caryclark630240d2014-09-19 06:33:31 -07005708}
5709
caryclarkc06d9a72014-09-29 06:58:41 -07005710static void fuzz714(skiatest::Reporter* reporter, const char* filename) {
5711 SkPath path;
5712 path.setFillType((SkPath::FillType) 1);
5713path.moveTo(SkBits2Float(0x430c0000), SkBits2Float(0x42200000));
5714path.lineTo(SkBits2Float(0x43480000), SkBits2Float(0x43520000));
5715path.lineTo(SkBits2Float(0x42200000), SkBits2Float(0x42c80000));
caryclark08bc8482015-04-24 09:08:57 -07005716path.lineTo(SkBits2Float(0x64969569), SkBits2Float(0x42c80000)); // 2.22222e+022f
5717path.lineTo(SkBits2Float(0x64969569), SkBits2Float(0x43520000)); // 2.22222e+022f
caryclarkc06d9a72014-09-29 06:58:41 -07005718path.lineTo(SkBits2Float(0x430c0000), SkBits2Float(0x42200000));
5719path.close();
5720
5721 SkPath path1(path);
5722 path.reset();
5723 path.setFillType((SkPath::FillType) 0);
5724path.moveTo(SkBits2Float(0x43200000), SkBits2Float(0x42700000));
5725path.lineTo(SkBits2Float(0x435c0000), SkBits2Float(0x43660000));
5726path.lineTo(SkBits2Float(0x42700000), SkBits2Float(0x42f00000));
caryclark08bc8482015-04-24 09:08:57 -07005727path.lineTo(SkBits2Float(0x64969569), SkBits2Float(0x42f00000)); // 2.22222e+022f
5728path.lineTo(SkBits2Float(0x64969569), SkBits2Float(0x43660000)); // 2.22222e+022f
caryclarkc06d9a72014-09-29 06:58:41 -07005729path.lineTo(SkBits2Float(0x43200000), SkBits2Float(0x42700000));
5730path.close();
5731
5732 SkPath path2(path);
caryclarkbca19f72015-05-13 08:23:48 -07005733 testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFail);
caryclarkc06d9a72014-09-29 06:58:41 -07005734}
5735
caryclarkd751ac02014-10-03 05:36:27 -07005736static void fuzz1(skiatest::Reporter* reporter, const char* filename) {
5737 SkPath path;
5738 path.setFillType((SkPath::FillType) 0);
5739path.moveTo(SkBits2Float(0x7f800000), SkBits2Float(0x7f800000));
5740path.quadTo(SkBits2Float(0x7f800000), SkBits2Float(0x7f800000), SkBits2Float(0x7f800000), SkBits2Float(0x7f800000));
5741path.quadTo(SkBits2Float(0x7f800000), SkBits2Float(0x7f800000), SkBits2Float(0x7f800000), SkBits2Float(0x7f800000));
5742path.quadTo(SkBits2Float(0xffc00000), SkBits2Float(0x7f800000), SkBits2Float(0xffc00000), SkBits2Float(0x7f800000));
5743path.quadTo(SkBits2Float(0xff000001), SkBits2Float(0x7f800000), SkBits2Float(0xff000001), SkBits2Float(0x7f800000));
5744path.quadTo(SkBits2Float(0xff000001), SkBits2Float(0xffc00000), SkBits2Float(0xffc00000), SkBits2Float(0xffc00000));
5745path.quadTo(SkBits2Float(0xffc00000), SkBits2Float(0xff000001), SkBits2Float(0x7f800000), SkBits2Float(0xff000001));
5746path.quadTo(SkBits2Float(0x7f800000), SkBits2Float(0xff000001), SkBits2Float(0x7f800000), SkBits2Float(0xffc00000));
5747path.quadTo(SkBits2Float(0x7f800000), SkBits2Float(0xffc00000), SkBits2Float(0x7f800000), SkBits2Float(0x7f800000));
5748path.close();
5749
5750 SkPath path1(path);
5751 path.reset();
5752 path.setFillType((SkPath::FillType) 0);
5753
5754 SkPath path2(path);
5755 testPathFailOp(reporter, path1, path2, (SkPathOp) 2, filename);
5756}
5757
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00005758static struct TestDesc failTests[] = {
caryclark624637c2015-05-11 07:21:27 -07005759 TEST(fuzz487a),
caryclark08bc8482015-04-24 09:08:57 -07005760 TEST(fuzz433),
caryclarkd751ac02014-10-03 05:36:27 -07005761 TEST(fuzz1),
caryclarkc06d9a72014-09-29 06:58:41 -07005762 TEST(fuzz714),
caryclark630240d2014-09-19 06:33:31 -07005763 TEST(fuzz487b),
caryclark361b8b02014-09-08 10:25:38 -07005764 TEST(fuzz433b),
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00005765 TEST(bufferOverflow),
5766};
5767
5768static const size_t failTestCount = SK_ARRAY_COUNT(failTests);
5769
5770DEF_TEST(PathOpsFailOp, reporter) {
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00005771#if DEBUG_SHOW_TEST_NAME
5772 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH);
5773#endif
halcanary96fcdcc2015-08-27 07:41:13 -07005774 RunTestSet(reporter, failTests, failTestCount, nullptr, nullptr, nullptr, false);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00005775}