blob: 637bd042d249fd8d79444509b84c850e3fb4e82a [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;
caryclark03b03ca2015-04-23 09:13:37 -07003848 SkDCubic::CubicType dType;
3849 if (SkDCubic::ComplexBreak(pts, &loopT, &dType)) {
caryclark1049f122015-04-20 08:31:59 -07003850 SkPoint cubicPair[7];
3851 SkChopCubicAt(pts, cubicPair, loopT);
3852 SkDCubic c1, c2;
3853 c1.set(cubicPair);
3854 c2.set(&cubicPair[3]);
3855 SkDQuad q1 = c1.toQuad();
3856 SkDQuad q2 = c2.toQuad();
3857 path->quadTo(q1[1].asSkPoint(), q1[2].asSkPoint());
3858 path->quadTo(q2[1].asSkPoint(), q2[2].asSkPoint());
3859 } else {
3860 path->cubicTo(pts[1], pts[2], pts[3]);
3861 }
3862}
3863
3864static void cubicOp130a(skiatest::Reporter* reporter, const char* filename) {
3865 SkPath path, pathB;
3866 path.setFillType(SkPath::kWinding_FillType);
3867 path.moveTo(5,6);
3868 SkPoint pts[] = { {5,6}, {4,6}, {3,0}, {2,1} };
3869 complex_to_quads(pts, &path);
3870 path.close();
3871 pathB.setFillType(SkPath::kWinding_FillType);
3872 pathB.moveTo(0,3);
3873 SkPoint pts2[] = { {0,3}, {1,2}, {6,5}, {6,4} };
3874 complex_to_quads(pts2, &path);
3875 pathB.close();
3876 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3877}
3878
3879static void cubicOp131(skiatest::Reporter* reporter, const char* filename) {
3880 SkPath path, pathB;
3881 path.setFillType(SkPath::kWinding_FillType);
3882 path.moveTo(0,1);
3883 path.cubicTo(3,4, 3,0, 6,2);
3884 path.close();
3885 pathB.setFillType(SkPath::kWinding_FillType);
3886 pathB.moveTo(0,3);
3887 pathB.cubicTo(2,6, 1,0, 4,3);
3888 pathB.close();
3889 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3890}
3891
3892static void circlesOp1(skiatest::Reporter* reporter, const char* filename) {
3893 SkPath path, pathB;
3894 path.setFillType(SkPath::kWinding_FillType);
3895 path.addCircle(0, 1, 2, SkPath::kCCW_Direction);
3896 pathB.setFillType(SkPath::kWinding_FillType);
3897 pathB.addCircle(0, 1, 1, SkPath::kCW_Direction);
3898 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3899}
3900
3901static void circlesOp2(skiatest::Reporter* reporter, const char* filename) {
3902 SkPath path, pathB;
3903 path.setFillType(SkPath::kWinding_FillType);
3904 path.addCircle(0, 1, 4, SkPath::kCCW_Direction);
3905 pathB.setFillType(SkPath::kWinding_FillType);
3906 pathB.addCircle(0, 4, 3, SkPath::kCW_Direction);
3907 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
3908}
3909
3910static void rRect1x(skiatest::Reporter* reporter, const char* filename) {
3911 SkPath path, pathB;
3912 path.setFillType(SkPath::kEvenOdd_FillType);
3913 path.moveTo(20.65f, 5.65f);
3914 path.conicTo(20.65f, 1.13612f, 25.1404f, 0.65f, 0.888488f);
3915 path.lineTo(25.65f, 0.65f);
3916 path.lineTo(26.1596f, 0.67604f);
3917 path.conicTo(30.65f, 1.13612f, 30.65f, 5.65f, 0.888488f);
3918 path.lineTo(30.65f, 25.65f);
3919 path.conicTo(30.65f, 20.65f, 25.65f, 20.65f, 0.707107f);
3920 path.lineTo(20.65f, 20.65f);
3921 path.lineTo(20.65f, 5.65f);
3922 path.close();
3923 path.moveTo(20.65f, 20.65f);
3924 path.lineTo(5.65f, 20.65f);
3925 path.conicTo(0.65f, 20.65f, 0.65f, 25.65f, 0.707107f);
3926 path.lineTo(0.65f, 45.65f);
3927 path.conicTo(0.65f, 50.65f, 5.65f, 50.65f, 0.707107f);
3928 path.lineTo(25.65f, 50.65f);
3929 path.conicTo(30.65f, 50.65f, 30.65f, 45.65f, 0.707107f);
3930 path.lineTo(30.65f, 25.65f);
3931 path.conicTo(30.65f, 30.65f, 25.65f, 30.65f, 0.707107f);
3932 path.conicTo(20.65f, 30.65f, 20.65f, 25.65f, 0.707107f);
3933 path.lineTo(20.65f, 20.65f);
3934 path.close();
3935 SkPath path1(path);
3936
3937 path.reset();
3938 path.setFillType(SkPath::kWinding_FillType);
3939 path.moveTo(20.65f, 45.65f);
3940 path.lineTo(20.65f, 25.65f);
3941 path.conicTo(20.65f, 20.65f, 25.65f, 20.65f, 0.707107f);
3942 path.lineTo(45.65f, 20.65f);
3943 path.conicTo(50.65f, 20.65f, 50.65f, 25.65f, 0.707107f);
3944 path.lineTo(50.65f, 45.65f);
3945 path.conicTo(50.65f, 50.65f, 45.65f, 50.65f, 0.707107f);
3946 path.lineTo(25.65f, 50.65f);
3947 path.conicTo(20.65f, 50.65f, 20.65f, 45.65f, 0.707107f);
3948 path.close();
3949 SkPath path2(path);
3950
3951 testPathOp(reporter, path1, path2, kDifference_SkPathOp, filename);
3952}
3953
3954static void loop7(skiatest::Reporter* reporter, const char* filename) {
3955 SkPath path, pathB;
3956 path.moveTo(0,1);
3957 path.cubicTo(3,4, -1,0, 8.5f,-2.5f);
3958 path.close();
3959 pathB.moveTo(3,4);
3960 pathB.cubicTo(-1,0, 8.5f,-2.5f, 0,1);
3961 pathB.close();
3962 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
3963}
3964
3965static void rects5(skiatest::Reporter* reporter, const char* filename) {
3966 SkPath path, pathB;
3967 path.setFillType(SkPath::kWinding_FillType);
3968 path.addRect(5, 5, 6, 6, SkPath::kCW_Direction);
3969 path.addRect(5, 5, 6, 6, SkPath::kCW_Direction);
3970 pathB.setFillType(SkPath::kEvenOdd_FillType);
3971 pathB.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
3972 pathB.addRect(5, 5, 6, 6, SkPath::kCW_Direction);
3973 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3974}
3975
3976static void loop8(skiatest::Reporter* reporter, const char* filename) {
3977 SkPath path, pathB;
3978 path.moveTo(0,1);
3979 path.cubicTo(1,4, -3.83333325f,0.166666627f, 6,-1);
3980 path.close();
3981 pathB.moveTo(1,4);
3982 pathB.cubicTo(-3.83333325f,0.166666627f, 6,-1, 0,1);
3983 pathB.close();
3984 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
3985}
3986
3987static void loop9(skiatest::Reporter* reporter, const char* filename) {
3988 SkPath path, pathB;
3989 path.moveTo(0,1);
3990 path.cubicTo(1,3, -2.5f,0, 3.33333325f,-0.666666627f);
3991 path.close();
3992 pathB.moveTo(1,3);
3993 pathB.cubicTo(-2.5f,0, 3.33333325f,-0.666666627f, 0,1);
3994 pathB.close();
3995 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
3996}
3997
3998static void circlesOp3(skiatest::Reporter* reporter, const char* filename) {
3999 SkPath path, pathB;
4000 path.setFillType(SkPath::kWinding_FillType);
4001 path.addCircle(0, 1, 2, SkPath::kCCW_Direction);
4002 pathB.setFillType(SkPath::kWinding_FillType);
4003 pathB.addCircle(3, 5, 3, SkPath::kCW_Direction);
4004 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4005}
4006
4007static void loop10(skiatest::Reporter* reporter, const char* filename) {
4008 SkPath path, pathB;
4009 path.moveTo(5,6);
4010 path.cubicTo(1,2, 1,2, -3.66666651f,13.333334f);
4011 path.close();
4012 pathB.moveTo(1,2);
4013 pathB.cubicTo(1,2, -3.66666651f,13.333334f, 5,6);
4014 pathB.close();
4015 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4016}
4017
4018static void loop11(skiatest::Reporter* reporter, const char* filename) {
4019 SkPath path, pathB;
4020 path.moveTo(0,1);
4021 path.cubicTo(1,3, -1.83333349f,1.33333337f, 4,-1);
4022 path.close();
4023 pathB.moveTo(1,3);
4024 pathB.cubicTo(-1.83333349f,1.33333337f, 4,-1, 0,1);
4025 pathB.close();
4026 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4027}
4028
4029static void cubicOp132(skiatest::Reporter* reporter, const char* filename) {
4030 SkPath path, pathB;
4031 path.setFillType(SkPath::kWinding_FillType);
4032 path.moveTo(5,6);
4033 path.cubicTo(3,4, 3,0, 3,2);
4034 path.close();
4035 pathB.setFillType(SkPath::kWinding_FillType);
4036 pathB.moveTo(0,3);
4037 pathB.cubicTo(2,3, 6,5, 4,3);
4038 pathB.close();
4039 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4040}
4041
caryclark03b03ca2015-04-23 09:13:37 -07004042static void loop12(skiatest::Reporter* reporter, const char* filename) {
4043 SkPath path, pathB;
4044 path.moveTo(1,2);
4045 path.cubicTo(0,6, -3.16666675f,3.66666675f, 6.33333349f,3.33333349f);
4046 path.close();
4047 pathB.moveTo(0,6);
4048 pathB.cubicTo(-3.16666675f,3.66666675f, 6.33333349f,3.33333349f, 1,2);
4049 pathB.close();
4050 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4051}
4052
caryclark03b03ca2015-04-23 09:13:37 -07004053static void cubicOp133(skiatest::Reporter* reporter, const char* filename) {
4054 SkPath path, pathB;
4055 path.setFillType(SkPath::kWinding_FillType);
4056 path.moveTo(5,6);
4057 path.cubicTo(5,6, 5,0, 4,1);
4058 path.close();
4059 pathB.setFillType(SkPath::kWinding_FillType);
4060 pathB.moveTo(0,5);
4061 pathB.cubicTo(1,4, 6,5, 6,5);
4062 pathB.close();
4063 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4064}
4065
4066static void cubicOp134(skiatest::Reporter* reporter, const char* filename) {
4067 SkPath path, pathB;
4068 path.setFillType(SkPath::kWinding_FillType);
4069 path.moveTo(5,6);
4070 path.cubicTo(5,6, 6,0, 3,1);
4071 path.close();
4072 pathB.setFillType(SkPath::kWinding_FillType);
4073 pathB.moveTo(0,6);
4074 pathB.cubicTo(1,3, 6,5, 6,5);
4075 pathB.close();
4076 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4077}
4078
4079static void cubicOp135(skiatest::Reporter* reporter, const char* filename) {
4080 SkPath path, pathB;
4081 path.setFillType(SkPath::kWinding_FillType);
4082 path.moveTo(5,6);
4083 path.cubicTo(5,6, 6,0, 4,1);
4084 path.close();
4085 pathB.setFillType(SkPath::kWinding_FillType);
4086 pathB.moveTo(0,6);
4087 pathB.cubicTo(1,4, 6,5, 6,5);
4088 pathB.close();
4089 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4090}
4091
4092static void cubicOp136(skiatest::Reporter* reporter, const char* filename) {
4093 SkPath path, pathB;
4094 path.setFillType(SkPath::kWinding_FillType);
4095 path.moveTo(5,6);
4096 path.cubicTo(5,6, 5,0, 3,1);
4097 path.close();
4098 pathB.setFillType(SkPath::kWinding_FillType);
4099 pathB.moveTo(0,5);
4100 pathB.cubicTo(1,3, 6,5, 6,5);
4101 pathB.close();
4102 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4103}
4104
4105static void cubicOp136a(skiatest::Reporter* reporter, const char* filename) {
4106 SkPath path, pathB;
4107 path.setFillType(SkPath::kWinding_FillType);
4108 path.moveTo(5,6);
4109 path.quadTo(5,0, 3,1);
4110 path.close();
4111 pathB.setFillType(SkPath::kWinding_FillType);
4112 pathB.moveTo(0,5);
4113 pathB.cubicTo(1,3, 6,5, 6,5);
4114 pathB.close();
4115 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4116}
4117
4118static void cubics137(skiatest::Reporter* reporter, const char* filename) {
4119 SkPath path, pathB;
4120 path.setFillType(SkPath::kWinding_FillType);
4121 path.moveTo(0, 5);
4122 path.cubicTo(3, 6, 1, 0, 3, 2);
4123 path.close();
4124 pathB.setFillType(SkPath::kWinding_FillType);
4125 pathB.moveTo(0, 1);
4126 pathB.cubicTo(2, 3, 5, 0, 6, 3);
4127 pathB.close();
4128 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4129}
4130
4131static void cubics138(skiatest::Reporter* reporter, const char* filename) {
4132 SkPath path, pathB;
4133 path.setFillType(SkPath::kWinding_FillType);
4134 path.moveTo(0, 5);
4135 path.cubicTo(3, 6, 1, 0, 4, 2);
4136 path.close();
4137 pathB.setFillType(SkPath::kWinding_FillType);
4138 pathB.moveTo(0, 1);
4139 pathB.cubicTo(2, 4, 5, 0, 6, 3);
4140 pathB.close();
4141 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4142}
4143
4144// three curves intersect successfully nearby -- the angle only gets 2 of the 3 pts
4145static void cubicOp139(skiatest::Reporter* reporter, const char* filename) {
4146 SkPath path, pathB;
4147 path.setFillType(SkPath::kWinding_FillType);
4148 path.moveTo(0,2);
4149 path.cubicTo(0,4, 3,1, 5,1);
4150 path.close();
4151 pathB.setFillType(SkPath::kWinding_FillType);
4152 pathB.moveTo(1,3);
4153 pathB.cubicTo(1,5, 2,0, 4,0);
4154 pathB.close();
caryclark08bc8482015-04-24 09:08:57 -07004155 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark03b03ca2015-04-23 09:13:37 -07004156}
4157
4158static void cubicOp140(skiatest::Reporter* reporter, const char* filename) {
4159 SkPath path, pathB;
4160 path.setFillType(SkPath::kWinding_FillType);
4161 path.moveTo(0,2);
4162 path.cubicTo(1,2, 5,4, 3,2);
4163 path.close();
4164 pathB.setFillType(SkPath::kWinding_FillType);
4165 pathB.moveTo(4,5);
4166 pathB.cubicTo(2,3, 2,0, 2,1);
4167 pathB.close();
4168 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4169}
4170
4171static void cubicOp141(skiatest::Reporter* reporter, const char* filename) {
4172 SkPath path, pathB;
4173 path.setFillType(SkPath::kWinding_FillType);
4174 path.moveTo(0,2);
4175 path.cubicTo(1,2, 6,4, 3,2);
4176 path.close();
4177 pathB.setFillType(SkPath::kWinding_FillType);
4178 pathB.moveTo(4,6);
4179 pathB.cubicTo(2,3, 2,0, 2,1);
4180 pathB.close();
4181 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4182}
4183
4184static void quadRect1(skiatest::Reporter* reporter, const char* filename) {
4185 SkPath path, pathB;
4186 path.moveTo(6,15);
4187 path.quadTo(16,0, 8,4);
4188 path.quadTo(2,7, 12,12);
4189 path.close();
4190 pathB.addRect(4,11, 13,16);
4191 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4192}
4193
4194static void quadRect2(skiatest::Reporter* reporter, const char* filename) {
4195 SkPath path, pathB;
4196 path.moveTo(5,12);
4197 path.quadTo(15,7, 9,4);
4198 path.quadTo(1,0, 11,15);
4199 path.close();
4200 pathB.addRect(4,11, 13,16);
4201 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4202}
4203
4204static void quadRect3(skiatest::Reporter* reporter, const char* filename) {
4205 SkPath path, pathB;
4206 path.moveTo(12,12);
4207 path.quadTo(2,7, 8,4);
4208 path.quadTo(16,0, 6,15);
4209 path.close();
4210 pathB.addRect(4,11, 13,16);
4211 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4212}
4213
4214static void quadRect4(skiatest::Reporter* reporter, const char* filename) {
4215 SkPath path, pathB;
4216 path.moveTo(11,15);
4217 path.quadTo(1,0, 9,4);
4218 path.quadTo(15,7, 5,12);
4219 path.close();
4220 pathB.addRect(4,11, 13,16);
4221 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4222}
4223
4224static void quadRect5(skiatest::Reporter* reporter, const char* filename) {
4225 SkPath path, pathB;
4226 path.moveTo(11,13);
4227 path.quadTo(4,4, 8,4);
4228 path.quadTo(12,4, 5,13);
4229 path.close();
4230 pathB.addRect(4,11, 13,16);
4231 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4232}
4233
4234static void quadRect6(skiatest::Reporter* reporter, const char* filename) {
4235 SkPath path, pathB;
4236 path.moveTo(5,13);
4237 path.quadTo(12,4, 8,4);
4238 path.quadTo(4,4, 11,13);
4239 path.close();
4240 pathB.addRect(4,11, 13,16);
4241 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4242}
4243
4244static void loops4i(skiatest::Reporter* reporter, const char* filename) {
4245 SkPath path, pathB;
4246 path.setFillType(SkPath::kWinding_FillType);
4247 path.moveTo(0, 3);
4248 path.cubicTo(0, 2, 0, 2, -1.66666663f, 2.16666675f);
4249 path.close();
4250 pathB.setFillType(SkPath::kWinding_FillType);
4251 pathB.moveTo(0, 2);
4252 pathB.cubicTo(0, 2, -1.66666663f, 2.16666675f, 0, 3);
4253 pathB.close();
4254 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4255}
4256
4257static void loops5i(skiatest::Reporter* reporter, const char* filename) {
4258 SkPath path, pathB;
4259 path.setFillType(SkPath::kWinding_FillType);
4260 path.moveTo(1, 2);
4261 path.cubicTo(0, 2, 0, 2, 0.166666672f, 2.66666675f);
4262 path.close();
4263 pathB.setFillType(SkPath::kWinding_FillType);
4264 pathB.moveTo(0, 2);
4265 pathB.cubicTo(0, 2, 0.166666672f, 2.66666675f, 1, 2);
4266 pathB.close();
4267 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4268}
4269
caryclark08bc8482015-04-24 09:08:57 -07004270static void cubicOp142(skiatest::Reporter* reporter, const char* filename) {
4271 SkPath path, pathB;
4272 path.setFillType(SkPath::kWinding_FillType);
4273 path.moveTo(5,6);
4274 path.cubicTo(2,5, 2,1, 1,0);
4275 path.close();
4276 pathB.setFillType(SkPath::kWinding_FillType);
4277 pathB.moveTo(1,2);
4278 pathB.cubicTo(0,1, 6,5, 5,2);
4279 pathB.close();
4280 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4281}
4282
4283static void cubics6d(skiatest::Reporter* reporter, const char* filename) {
4284 SkPath path, pathB;
4285 path.setFillType(SkPath::kWinding_FillType);
4286 path.moveTo(3, 5);
4287 path.cubicTo(1, 5, 4, 2, 4, 0);
4288 path.close();
4289 pathB.setFillType(SkPath::kWinding_FillType);
4290 pathB.moveTo(2, 4);
4291 pathB.cubicTo(0, 4, 5, 3, 5, 1);
4292 pathB.close();
4293 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4294}
4295
4296static void cubics7d(skiatest::Reporter* reporter, const char* filename) {
4297 SkPath path, pathB;
4298 path.setFillType(SkPath::kWinding_FillType);
4299 path.moveTo(2, 6);
4300 path.cubicTo(2, 4, 5, 1, 3, 1);
4301 path.close();
4302 pathB.setFillType(SkPath::kWinding_FillType);
4303 pathB.moveTo(1, 5);
4304 pathB.cubicTo(1, 3, 6, 2, 4, 2);
4305 pathB.close();
4306 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4307}
4308
4309static void cubics8d(skiatest::Reporter* reporter, const char* filename) {
4310 SkPath path, pathB;
4311 path.setFillType(SkPath::kWinding_FillType);
4312 path.moveTo(2, 5);
4313 path.cubicTo(2, 4, 5, 1, 3, 2);
4314 path.close();
4315 pathB.setFillType(SkPath::kWinding_FillType);
4316 pathB.moveTo(1, 5);
4317 pathB.cubicTo(2, 3, 5, 2, 4, 2);
4318 pathB.close();
4319 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4320}
4321
4322static void cubics9d(skiatest::Reporter* reporter, const char* filename) {
4323 SkPath path, pathB;
4324 path.setFillType(SkPath::kWinding_FillType);
4325 path.moveTo(2, 4);
4326 path.cubicTo(2, 6, 3, 1, 5, 1);
4327 path.close();
4328 pathB.setFillType(SkPath::kWinding_FillType);
4329 pathB.moveTo(1, 3);
4330 pathB.cubicTo(1, 5, 4, 2, 6, 2);
4331 pathB.close();
4332 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4333}
4334
4335static void cubics10u(skiatest::Reporter* reporter, const char* filename) {
4336 SkPath path, pathB;
4337 path.setFillType(SkPath::kWinding_FillType);
4338 path.moveTo(2, 4);
4339 path.cubicTo(1, 6, 4, 1, 5, 1);
4340 path.close();
4341 pathB.setFillType(SkPath::kWinding_FillType);
4342 pathB.moveTo(1, 4);
4343 pathB.cubicTo(1, 5, 4, 2, 6, 1);
4344 pathB.close();
4345 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
4346}
4347
4348static void cubics11i(skiatest::Reporter* reporter, const char* filename) {
4349 SkPath path, pathB;
4350 path.setFillType(SkPath::kWinding_FillType);
4351 path.moveTo(2, 4);
4352 path.cubicTo(2, 5, 3, 2, 5, 1);
4353 path.close();
4354 pathB.setFillType(SkPath::kWinding_FillType);
4355 pathB.moveTo(2, 3);
4356 pathB.cubicTo(1, 5, 4, 2, 5, 2);
4357 pathB.close();
4358 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4359}
4360
4361static void cubics12d(skiatest::Reporter* reporter, const char* filename) {
4362 SkPath path, pathB;
4363 path.setFillType(SkPath::kWinding_FillType);
4364 path.moveTo(2, 4);
4365 path.cubicTo(0, 4, 5, 3, 5, 1);
4366 path.close();
4367 pathB.setFillType(SkPath::kWinding_FillType);
4368 pathB.moveTo(3, 5);
4369 pathB.cubicTo(1, 5, 4, 2, 4, 0);
4370 pathB.close();
4371 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4372}
4373
4374static void cubics13d(skiatest::Reporter* reporter, const char* filename) {
4375 SkPath path, pathB;
4376 path.setFillType(SkPath::kWinding_FillType);
4377 path.moveTo(2, 3);
4378 path.cubicTo(1, 5, 4, 2, 5, 2);
4379 path.close();
4380 pathB.setFillType(SkPath::kWinding_FillType);
4381 pathB.moveTo(2, 4);
4382 pathB.cubicTo(2, 5, 3, 2, 5, 1);
4383 pathB.close();
4384 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4385}
4386
4387static void cubics14d(skiatest::Reporter* reporter, const char* filename) {
4388 SkPath path, pathB;
4389 path.setFillType(SkPath::kWinding_FillType);
4390 path.moveTo(2, 3);
4391 path.cubicTo(0, 4, 3, 1, 3, 0);
4392 path.close();
4393 pathB.setFillType(SkPath::kWinding_FillType);
4394 pathB.moveTo(1, 3);
4395 pathB.cubicTo(0, 3, 3, 2, 4, 0);
4396 pathB.close();
4397 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4398}
4399
4400static void cubics15d(skiatest::Reporter* reporter, const char* filename) {
4401 SkPath path, pathB;
4402 path.setFillType(SkPath::kWinding_FillType);
4403 path.moveTo(1, 5);
4404 path.cubicTo(3, 5, 4, 0, 4, 2);
4405 path.close();
4406 pathB.setFillType(SkPath::kWinding_FillType);
4407 pathB.moveTo(0, 4);
4408 pathB.cubicTo(2, 4, 5, 1, 5, 3);
4409 pathB.close();
4410 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4411}
4412
4413static void cubics16i(skiatest::Reporter* reporter, const char* filename) {
4414 SkPath path, pathB;
4415 path.setFillType(SkPath::kWinding_FillType);
4416 path.moveTo(1, 5);
4417 path.cubicTo(2, 5, 5, 0, 4, 2);
4418 path.close();
4419 pathB.setFillType(SkPath::kWinding_FillType);
4420 pathB.moveTo(0, 5);
4421 pathB.cubicTo(2, 4, 5, 1, 5, 2);
4422 pathB.close();
4423 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4424}
4425
4426static void cubics17d(skiatest::Reporter* reporter, const char* filename) {
4427 SkPath path, pathB;
4428 path.setFillType(SkPath::kWinding_FillType);
4429 path.moveTo(1, 5);
4430 path.cubicTo(3, 4, 4, 1, 4, 2);
4431 path.close();
4432 pathB.setFillType(SkPath::kWinding_FillType);
4433 pathB.moveTo(1, 4);
4434 pathB.cubicTo(2, 4, 5, 1, 4, 3);
4435 pathB.close();
4436 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4437}
4438
4439static void cubics18d(skiatest::Reporter* reporter, const char* filename) {
4440 SkPath path, pathB;
4441 path.setFillType(SkPath::kWinding_FillType);
4442 path.moveTo(1, 5);
4443 path.cubicTo(1, 3, 4, 0, 2, 0);
4444 path.close();
4445 pathB.setFillType(SkPath::kWinding_FillType);
4446 pathB.moveTo(0, 4);
4447 pathB.cubicTo(0, 2, 5, 1, 3, 1);
4448 pathB.close();
4449 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4450}
4451
4452static void cubics19d(skiatest::Reporter* reporter, const char* filename) {
4453 SkPath path, pathB;
4454 path.setFillType(SkPath::kWinding_FillType);
4455 path.moveTo(1, 5);
4456 path.cubicTo(2, 3, 5, 2, 4, 2);
4457 path.close();
4458 pathB.setFillType(SkPath::kWinding_FillType);
4459 pathB.moveTo(2, 5);
4460 pathB.cubicTo(2, 4, 5, 1, 3, 2);
4461 pathB.close();
4462 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4463}
4464
4465static void cubicOp157(skiatest::Reporter* reporter, const char* filename) {
4466 SkPath path, pathB;
4467 path.setFillType(SkPath::kWinding_FillType);
4468 path.moveTo(1,5);
4469 path.cubicTo(1,3, 6,2, 4,2);
4470 path.close();
4471 pathB.setFillType(SkPath::kWinding_FillType);
4472 pathB.moveTo(2,6);
4473 pathB.cubicTo(2,4, 5,1, 3,1);
4474 pathB.close();
4475 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4476}
4477
caryclarkaec25102015-04-29 08:28:30 -07004478static void cubics20d(skiatest::Reporter* reporter, const char* filename) {
4479 SkPath path, pathB;
4480 path.setFillType(SkPath::kWinding_FillType);
4481 path.moveTo(1, 2);
4482 path.cubicTo(0, 3, 6, 0, 3, 2);
4483 path.close();
4484 pathB.setFillType(SkPath::kWinding_FillType);
4485 pathB.moveTo(0, 6);
4486 pathB.cubicTo(2, 3, 2, 1, 3, 0);
4487 pathB.close();
4488 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4489}
4490
4491static void loops20i(skiatest::Reporter* reporter, const char* filename) {
4492 SkPath path, pathB;
4493 path.setFillType(SkPath::kWinding_FillType);
4494 path.moveTo(1, 2);
4495 path.cubicTo(0, 2, 0.833333313f, 2, 1, 3.66666651f);
4496 path.close();
4497 pathB.setFillType(SkPath::kWinding_FillType);
4498 pathB.moveTo(0, 2);
4499 pathB.cubicTo(0.833333313f, 2, 1, 3.66666651f, 1, 2);
4500 pathB.close();
4501 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4502}
4503
4504static void loops21i(skiatest::Reporter* reporter, const char* filename) {
4505 SkPath path, pathB;
4506 path.setFillType(SkPath::kWinding_FillType);
4507 path.moveTo(1, 2);
4508 path.cubicTo(0, 2, 0.833333313f, 2, 1, 4);
4509 path.close();
4510 pathB.setFillType(SkPath::kWinding_FillType);
4511 pathB.moveTo(0, 2);
4512 pathB.cubicTo(0.833333313f, 2, 1, 4, 1, 2);
4513 pathB.close();
4514 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4515}
4516
4517static void loops22i(skiatest::Reporter* reporter, const char* filename) {
4518 SkPath path, pathB;
4519 path.setFillType(SkPath::kWinding_FillType);
4520 path.moveTo(1, 3);
4521 path.cubicTo(0, 3, 0.833333313f, 3, 1, 4.66666651f);
4522 path.close();
4523 pathB.setFillType(SkPath::kWinding_FillType);
4524 pathB.moveTo(0, 3);
4525 pathB.cubicTo(0.833333313f, 3, 1, 4.66666651f, 1, 3);
4526 pathB.close();
4527 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4528}
4529
4530static void loops23i(skiatest::Reporter* reporter, const char* filename) {
4531 SkPath path, pathB;
4532 path.setFillType(SkPath::kWinding_FillType);
4533 path.moveTo(1, 5);
4534 path.cubicTo(0, 1, 6.16666698f, 5.66666698f, -5.66666651f, 6.66666651f);
4535 path.close();
4536 pathB.setFillType(SkPath::kWinding_FillType);
4537 pathB.moveTo(0, 1);
4538 pathB.cubicTo(6.16666698f, 5.66666698f, -5.66666651f, 6.66666651f, 1, 5);
4539 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004540 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004541}
4542
4543static void loops24i(skiatest::Reporter* reporter, const char* filename) {
4544 SkPath path, pathB;
4545 path.setFillType(SkPath::kWinding_FillType);
4546 path.moveTo(1, 2);
4547 path.cubicTo(0, 2, 0.833333313f, 2, 1, 3);
4548 path.close();
4549 pathB.setFillType(SkPath::kWinding_FillType);
4550 pathB.moveTo(0, 2);
4551 pathB.cubicTo(0.833333313f, 2, 1, 3, 1, 2);
4552 pathB.close();
4553 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4554}
4555
4556static void loops25i(skiatest::Reporter* reporter, const char* filename) {
4557 SkPath path, pathB;
4558 path.setFillType(SkPath::kWinding_FillType);
4559 path.moveTo(1, 5);
4560 path.cubicTo(0, 5, 0.833333313f, 5, 1, 7);
4561 path.close();
4562 pathB.setFillType(SkPath::kWinding_FillType);
4563 pathB.moveTo(0, 5);
4564 pathB.cubicTo(0.833333313f, 5, 1, 7, 1, 5);
4565 pathB.close();
4566 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4567}
4568
4569static void loops26i(skiatest::Reporter* reporter, const char* filename) {
4570 SkPath path, pathB;
4571 path.setFillType(SkPath::kWinding_FillType);
4572 path.moveTo(1, 6);
4573 path.cubicTo(0, 2, 6.16666698f, 6.66666698f, -5.66666651f, 7.66666651f);
4574 path.close();
4575 pathB.setFillType(SkPath::kWinding_FillType);
4576 pathB.moveTo(0, 2);
4577 pathB.cubicTo(6.16666698f, 6.66666698f, -5.66666651f, 7.66666651f, 1, 6);
4578 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004579 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004580}
4581
4582static void loops27i(skiatest::Reporter* reporter, const char* filename) {
4583 SkPath path, pathB;
4584 path.setFillType(SkPath::kWinding_FillType);
4585 path.moveTo(1, 3);
4586 path.cubicTo(0, 3, 0.833333313f, 3, 1, 4.33333349f);
4587 path.close();
4588 pathB.setFillType(SkPath::kWinding_FillType);
4589 pathB.moveTo(0, 3);
4590 pathB.cubicTo(0.833333313f, 3, 1, 4.33333349f, 1, 3);
4591 pathB.close();
4592 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4593}
4594
4595static void loops28i(skiatest::Reporter* reporter, const char* filename) {
4596 SkPath path, pathB;
4597 path.setFillType(SkPath::kWinding_FillType);
4598 path.moveTo(2, 3);
4599 path.cubicTo(1, 3, 1.83333337f, 3, 2, 4.66666651f);
4600 path.close();
4601 pathB.setFillType(SkPath::kWinding_FillType);
4602 pathB.moveTo(1, 3);
4603 pathB.cubicTo(1.83333337f, 3, 2, 4.66666651f, 2, 3);
4604 pathB.close();
4605 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4606}
4607
4608static void loops29i(skiatest::Reporter* reporter, const char* filename) {
4609 SkPath path, pathB;
4610 path.setFillType(SkPath::kWinding_FillType);
4611 path.moveTo(2, 4);
4612 path.cubicTo(0, 4, 1.66666663f, 4, 2, 7.33333302f);
4613 path.close();
4614 pathB.setFillType(SkPath::kWinding_FillType);
4615 pathB.moveTo(0, 4);
4616 pathB.cubicTo(1.66666663f, 4, 2, 7.33333302f, 2, 4);
4617 pathB.close();
4618 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4619}
4620
4621static void loops30i(skiatest::Reporter* reporter, const char* filename) {
4622 SkPath path, pathB;
4623 path.setFillType(SkPath::kWinding_FillType);
4624 path.moveTo(2, 4);
4625 path.cubicTo(0, 4, 1.66666663f, 4, 2, 8);
4626 path.close();
4627 pathB.setFillType(SkPath::kWinding_FillType);
4628 pathB.moveTo(0, 4);
4629 pathB.cubicTo(1.66666663f, 4, 2, 8, 2, 4);
4630 pathB.close();
4631 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4632}
4633
4634static void loops31i(skiatest::Reporter* reporter, const char* filename) {
4635 SkPath path, pathB;
4636 path.setFillType(SkPath::kWinding_FillType);
4637 path.moveTo(2, 5);
4638 path.cubicTo(1, 5, 1.83333337f, 5, 2, 6.66666651f);
4639 path.close();
4640 pathB.setFillType(SkPath::kWinding_FillType);
4641 pathB.moveTo(1, 5);
4642 pathB.cubicTo(1.83333337f, 5, 2, 6.66666651f, 2, 5);
4643 pathB.close();
4644 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4645}
4646
4647static void loops32i(skiatest::Reporter* reporter, const char* filename) {
4648 SkPath path, pathB;
4649 path.setFillType(SkPath::kWinding_FillType);
4650 path.moveTo(2, 6);
4651 path.cubicTo(1, 6, 1.83333337f, 6, 2, 8);
4652 path.close();
4653 pathB.setFillType(SkPath::kWinding_FillType);
4654 pathB.moveTo(1, 6);
4655 pathB.cubicTo(1.83333337f, 6, 2, 8, 2, 6);
4656 pathB.close();
4657 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4658}
4659
4660static void loops33i(skiatest::Reporter* reporter, const char* filename) {
4661 SkPath path, pathB;
4662 path.setFillType(SkPath::kWinding_FillType);
4663 path.moveTo(2, 6);
4664 path.cubicTo(1, 2, 7.16666698f, 6.66666698f, -4.66666651f, 7.66666651f);
4665 path.close();
4666 pathB.setFillType(SkPath::kWinding_FillType);
4667 pathB.moveTo(1, 2);
4668 pathB.cubicTo(7.16666698f, 6.66666698f, -4.66666651f, 7.66666651f, 2, 6);
4669 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004670 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004671}
4672
4673static void loops33iMod(skiatest::Reporter* reporter, const char* filename) {
4674 SkPoint pts[] = {{2, 6}, {1, 2}, {7.16666698f, 6.66666698f}, {-4.66666651f, 7.66666651f},
4675 {1, 2}, {7.16666698f, 6.66666698f}, {-4.66666651f, 7.66666651f}, {2, 6}};
4676 bool up = false;
4677 float offset = 0.0380172729f;
4678 float step = 7.62939453e-006f;
4679 bool lastResult = true;
4680 // for (int i = 0; i < 30; ++i) {
4681 SkString name(filename);
4682 // name.appendS32(i);
4683 // if (i > 0) {
4684 // SkDebugf("\n\n<div id=\"%s\">\n", name.c_str());
4685 // }
4686 pts[5].fY = 6.66666698f + offset;
4687 SkPath path, pathB;
4688 path.setFillType(SkPath::kWinding_FillType);
4689 path.moveTo(pts[0]);
4690 path.cubicTo(pts[1], pts[2], pts[3]);
4691 path.close();
4692 pathB.setFillType(SkPath::kWinding_FillType);
4693 pathB.moveTo(pts[4]);
4694 pathB.cubicTo(pts[5], pts[6], pts[7]);
4695 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004696 bool result = testPathOp(reporter, path, pathB, kIntersect_SkPathOp, name.c_str());
caryclarkaec25102015-04-29 08:28:30 -07004697 if (lastResult != result) {
4698 up = !up;
4699 }
4700 step /= 2;
4701 offset += up ? step : -step;
4702 lastResult = result;
4703 // }
4704}
4705
4706
4707static void loops33iAsQuads(skiatest::Reporter* reporter, const char* filename) {
4708 SkPath path, pathB;
4709 path.setFillType(SkPath::kWinding_FillType);
4710 path.moveTo(2, 6);
4711 path.cubicTo(1, 2, 7.16666698f, 6.66666698f, -4.66666651f, 7.66666651f);
4712 path.close();
4713 pathB.setFillType(SkPath::kWinding_FillType);
4714 pathB.moveTo(1, 2);
4715 pathB.cubicTo(7.16666698f, 6.66666698f, -4.66666651f, 7.66666651f, 2, 6);
4716 pathB.close();
4717 SkPath qPath, qPathB;
4718 CubicPathToQuads(path, &qPath);
4719 CubicPathToQuads(pathB, &qPathB);
4720 testPathOp(reporter, qPath, qPathB, kIntersect_SkPathOp, filename);
4721}
4722
4723static void loops34i(skiatest::Reporter* reporter, const char* filename) {
4724 SkPath path, pathB;
4725 path.setFillType(SkPath::kWinding_FillType);
4726 path.moveTo(3, 4);
4727 path.cubicTo(0, 4, 2.5f, 4, 3, 9);
4728 path.close();
4729 pathB.setFillType(SkPath::kWinding_FillType);
4730 pathB.moveTo(0, 4);
4731 pathB.cubicTo(2.5f, 4, 3, 9, 3, 4);
4732 pathB.close();
4733 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4734}
4735
4736static void loops35i(skiatest::Reporter* reporter, const char* filename) {
4737 SkPath path, pathB;
4738 path.setFillType(SkPath::kWinding_FillType);
4739 path.moveTo(3, 4);
4740 path.cubicTo(0, 4, 2.5f, 4, 3, 10);
4741 path.close();
4742 pathB.setFillType(SkPath::kWinding_FillType);
4743 pathB.moveTo(0, 4);
4744 pathB.cubicTo(2.5f, 4, 3, 10, 3, 4);
4745 pathB.close();
4746 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4747}
4748
4749static void loops36i(skiatest::Reporter* reporter, const char* filename) {
4750 SkPath path, pathB;
4751 path.setFillType(SkPath::kWinding_FillType);
4752 path.moveTo(3, 4);
4753 path.cubicTo(1, 4, 2.66666675f, 4, 3, 8);
4754 path.close();
4755 pathB.setFillType(SkPath::kWinding_FillType);
4756 pathB.moveTo(1, 4);
4757 pathB.cubicTo(2.66666675f, 4, 3, 8, 3, 4);
4758 pathB.close();
4759 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4760}
4761
4762static void loops37i(skiatest::Reporter* reporter, const char* filename) {
4763 SkPath path, pathB;
4764 path.setFillType(SkPath::kWinding_FillType);
4765 path.moveTo(2, 4);
4766 path.cubicTo(1, 4, 1.83333337f, 4, 2, 5.33333349f);
4767 path.close();
4768 pathB.setFillType(SkPath::kWinding_FillType);
4769 pathB.moveTo(1, 4);
4770 pathB.cubicTo(1.83333337f, 4, 2, 5.33333349f, 2, 4);
4771 pathB.close();
4772 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4773}
4774
4775static void loops38i(skiatest::Reporter* reporter, const char* filename) {
4776 SkPath path, pathB;
4777 path.setFillType(SkPath::kWinding_FillType);
4778 path.moveTo(3, 4);
4779 path.cubicTo(2, 4, 2.83333325f, 4, 3, 6);
4780 path.close();
4781 pathB.setFillType(SkPath::kWinding_FillType);
4782 pathB.moveTo(2, 4);
4783 pathB.cubicTo(2.83333325f, 4, 3, 6, 3, 4);
4784 pathB.close();
4785 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4786}
4787
4788static void loops39i(skiatest::Reporter* reporter, const char* filename) {
4789 SkPath path, pathB;
4790 path.setFillType(SkPath::kWinding_FillType);
4791 path.moveTo(3, 5);
4792 path.cubicTo(0, 5, 2.5f, 5, 3, 10);
4793 path.close();
4794 pathB.setFillType(SkPath::kWinding_FillType);
4795 pathB.moveTo(0, 5);
4796 pathB.cubicTo(2.5f, 5, 3, 10, 3, 5);
4797 pathB.close();
4798 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4799}
4800
4801static void loops40i(skiatest::Reporter* reporter, const char* filename) {
4802 SkPath path, pathB;
4803 path.setFillType(SkPath::kWinding_FillType);
4804 path.moveTo(3, 5);
4805 path.cubicTo(0, 5, 2.5f, 5, 3, 11);
4806 path.close();
4807 pathB.setFillType(SkPath::kWinding_FillType);
4808 pathB.moveTo(0, 5);
4809 pathB.cubicTo(2.5f, 5, 3, 11, 3, 5);
4810 pathB.close();
4811 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4812}
4813
4814static void loops40iAsQuads(skiatest::Reporter* reporter, const char* filename) {
4815 SkPath path, pathB;
4816 path.setFillType(SkPath::kWinding_FillType);
4817 path.moveTo(3, 5);
4818 path.cubicTo(0, 5, 2.5f, 5, 3, 11);
4819 path.close();
4820 pathB.setFillType(SkPath::kWinding_FillType);
4821 pathB.moveTo(0, 5);
4822 pathB.cubicTo(2.5f, 5, 3, 11, 3, 5);
4823 pathB.close();
4824 SkPath qPath, qPathB;
4825 CubicPathToQuads(path, &qPath);
4826 CubicPathToQuads(pathB, &qPathB);
4827 testPathOp(reporter, qPath, qPathB, kIntersect_SkPathOp, filename);
4828}
4829
caryclarkaec25102015-04-29 08:28:30 -07004830static void loops44i(skiatest::Reporter* reporter, const char* filename) {
4831 SkPath path, pathB;
4832 path.setFillType(SkPath::kWinding_FillType);
4833 path.moveTo(1, 5);
4834 path.cubicTo(0, 1, 7.33333302f, 5.33333349f, -7, 7);
4835 path.close();
4836 pathB.setFillType(SkPath::kWinding_FillType);
4837 pathB.moveTo(0, 1);
4838 pathB.cubicTo(7.33333302f, 5.33333349f, -7, 7, 1, 5);
4839 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004840 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004841}
4842
caryclarkaec25102015-04-29 08:28:30 -07004843static void loops45i(skiatest::Reporter* reporter, const char* filename) {
4844 SkPath path, pathB;
4845 path.setFillType(SkPath::kWinding_FillType);
4846 path.moveTo(1, 6);
4847 path.cubicTo(0, 2, 7.33333302f, 6.33333302f, -7, 8);
4848 path.close();
4849 pathB.setFillType(SkPath::kWinding_FillType);
4850 pathB.moveTo(0, 2);
4851 pathB.cubicTo(7.33333302f, 6.33333302f, -7, 8, 1, 6);
4852 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004853 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004854}
4855
caryclarkaec25102015-04-29 08:28:30 -07004856static void loops46i(skiatest::Reporter* reporter, const char* filename) {
4857 SkPath path, pathB;
4858 path.setFillType(SkPath::kWinding_FillType);
4859 path.moveTo(2, 6);
4860 path.cubicTo(1, 2, 8.33333302f, 6.33333302f, -6, 8);
4861 path.close();
4862 pathB.setFillType(SkPath::kWinding_FillType);
4863 pathB.moveTo(1, 2);
4864 pathB.cubicTo(8.33333302f, 6.33333302f, -6, 8, 2, 6);
4865 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004866 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004867}
4868
4869/*
4870FAILED: d:\cygwin\puregit\tests\pathopsextendedtest.cpp:346 0 */
4871static void loops47i(skiatest::Reporter* reporter, const char* filename) {
4872 SkPath path, pathB;
4873 path.setFillType(SkPath::kWinding_FillType);
4874 path.moveTo(2, 4);
4875 path.cubicTo(0, 1, 6, 5.83333302f, -4, 8);
4876 path.close();
4877 pathB.setFillType(SkPath::kWinding_FillType);
4878 pathB.moveTo(0, 1);
4879 pathB.cubicTo(6, 5.83333302f, -4, 8, 2, 4);
4880 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004881 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004882}
4883
caryclarkaec25102015-04-29 08:28:30 -07004884static void loops48i(skiatest::Reporter* reporter, const char* filename) {
4885 SkPath path, pathB;
4886 path.setFillType(SkPath::kWinding_FillType);
4887 path.moveTo(2, 6);
4888 path.cubicTo(0, 1, 9.33333302f, 6.83333302f, -8.33333302f, 9.16666603f);
4889 path.close();
4890 pathB.setFillType(SkPath::kWinding_FillType);
4891 pathB.moveTo(0, 1);
4892 pathB.cubicTo(9.33333302f, 6.83333302f, -8.33333302f, 9.16666603f, 2, 6);
4893 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004894 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004895}
4896
caryclarkaec25102015-04-29 08:28:30 -07004897static void loops49i(skiatest::Reporter* reporter, const char* filename) {
4898 SkPath path, pathB;
4899 path.setFillType(SkPath::kWinding_FillType);
4900 path.moveTo(0, 2);
4901 path.cubicTo(1, 4, -0.166666687f, 2.66666675f, 1.66666675f, 2);
4902 path.close();
4903 pathB.setFillType(SkPath::kWinding_FillType);
4904 pathB.moveTo(1, 4);
4905 pathB.cubicTo(-0.166666687f, 2.66666675f, 1.66666675f, 2, 0, 2);
4906 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004907 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004908}
4909
caryclarkaec25102015-04-29 08:28:30 -07004910static void loops50i(skiatest::Reporter* reporter, const char* filename) {
4911 SkPath path, pathB;
4912 path.setFillType(SkPath::kWinding_FillType);
4913 path.moveTo(0, 3);
4914 path.cubicTo(1, 5, -0.166666687f, 3.66666675f, 1.66666675f, 3);
4915 path.close();
4916 pathB.setFillType(SkPath::kWinding_FillType);
4917 pathB.moveTo(1, 5);
4918 pathB.cubicTo(-0.166666687f, 3.66666675f, 1.66666675f, 3, 0, 3);
4919 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004920 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004921}
4922
caryclarkaec25102015-04-29 08:28:30 -07004923static void loops51i(skiatest::Reporter* reporter, const char* filename) {
4924 SkPath path, pathB;
4925 path.setFillType(SkPath::kWinding_FillType);
4926 path.moveTo(1, 2);
4927 path.cubicTo(2, 4, 0.833333313f, 2.66666675f, 2.66666675f, 2);
4928 path.close();
4929 pathB.setFillType(SkPath::kWinding_FillType);
4930 pathB.moveTo(2, 4);
4931 pathB.cubicTo(0.833333313f, 2.66666675f, 2.66666675f, 2, 1, 2);
4932 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004933 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004934}
4935
caryclarkaec25102015-04-29 08:28:30 -07004936static void loops52i(skiatest::Reporter* reporter, const char* filename) {
4937 SkPath path, pathB;
4938 path.setFillType(SkPath::kWinding_FillType);
4939 path.moveTo(1, 3);
4940 path.cubicTo(2, 5, 0.833333313f, 3.66666675f, 2.66666675f, 3);
4941 path.close();
4942 pathB.setFillType(SkPath::kWinding_FillType);
4943 pathB.moveTo(2, 5);
4944 pathB.cubicTo(0.833333313f, 3.66666675f, 2.66666675f, 3, 1, 3);
4945 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004946 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004947}
4948
caryclarkaec25102015-04-29 08:28:30 -07004949static void loops53i(skiatest::Reporter* reporter, const char* filename) {
4950 SkPath path, pathB;
4951 path.setFillType(SkPath::kWinding_FillType);
4952 path.moveTo(2, 3);
4953 path.cubicTo(3, 5, 1.83333325f, 3.66666675f, 3.66666651f, 3);
4954 path.close();
4955 pathB.setFillType(SkPath::kWinding_FillType);
4956 pathB.moveTo(3, 5);
4957 pathB.cubicTo(1.83333325f, 3.66666675f, 3.66666651f, 3, 2, 3);
4958 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004959 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004960}
4961
caryclarkaec25102015-04-29 08:28:30 -07004962static void loops54i(skiatest::Reporter* reporter, const char* filename) {
4963 SkPath path, pathB;
4964 path.setFillType(SkPath::kWinding_FillType);
4965 path.moveTo(0, 2);
4966 path.cubicTo(1, 4, 0, 3, 1.66666675f, 2);
4967 path.close();
4968 pathB.setFillType(SkPath::kWinding_FillType);
4969 pathB.moveTo(1, 4);
4970 pathB.cubicTo(0, 3, 1.66666675f, 2, 0, 2);
4971 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004972 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004973}
4974
caryclarkaec25102015-04-29 08:28:30 -07004975static void loops55i(skiatest::Reporter* reporter, const char* filename) {
4976 SkPath path, pathB;
4977 path.setFillType(SkPath::kWinding_FillType);
4978 path.moveTo(0, 3);
4979 path.cubicTo(1, 5, 0, 4, 1.66666675f, 3);
4980 path.close();
4981 pathB.setFillType(SkPath::kWinding_FillType);
4982 pathB.moveTo(1, 5);
4983 pathB.cubicTo(0, 4, 1.66666675f, 3, 0, 3);
4984 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004985 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004986}
4987
caryclarkaec25102015-04-29 08:28:30 -07004988static void loops56i(skiatest::Reporter* reporter, const char* filename) {
4989 SkPath path, pathB;
4990 path.setFillType(SkPath::kWinding_FillType);
4991 path.moveTo(1, 2);
4992 path.cubicTo(2, 4, 0.99999994f, 3, 2.66666675f, 2);
4993 path.close();
4994 pathB.setFillType(SkPath::kWinding_FillType);
4995 pathB.moveTo(2, 4);
4996 pathB.cubicTo(0.99999994f, 3, 2.66666675f, 2, 1, 2);
4997 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07004998 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07004999}
5000
caryclarkaec25102015-04-29 08:28:30 -07005001static void loops57i(skiatest::Reporter* reporter, const char* filename) {
5002 SkPath path, pathB;
5003 path.setFillType(SkPath::kWinding_FillType);
5004 path.moveTo(1, 3);
5005 path.cubicTo(2, 5, 0.99999994f, 4, 2.66666675f, 3);
5006 path.close();
5007 pathB.setFillType(SkPath::kWinding_FillType);
5008 pathB.moveTo(2, 5);
5009 pathB.cubicTo(0.99999994f, 4, 2.66666675f, 3, 1, 3);
5010 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07005011 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07005012}
5013
caryclarkaec25102015-04-29 08:28:30 -07005014static void loops58i(skiatest::Reporter* reporter, const char* filename) {
5015 SkPath path, pathB;
5016 path.setFillType(SkPath::kWinding_FillType);
5017 path.moveTo(2, 3);
5018 path.cubicTo(3, 5, 2, 4, 3.66666651f, 3);
5019 path.close();
5020 pathB.setFillType(SkPath::kWinding_FillType);
5021 pathB.moveTo(3, 5);
5022 pathB.cubicTo(2, 4, 3.66666651f, 3, 2, 3);
5023 pathB.close();
caryclark624637c2015-05-11 07:21:27 -07005024 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclarkaec25102015-04-29 08:28:30 -07005025}
5026
caryclark624637c2015-05-11 07:21:27 -07005027static void loops58iAsQuads(skiatest::Reporter* reporter, const char* filename) {
5028 SkPath path, pathB;
5029 path.setFillType(SkPath::kWinding_FillType);
5030 path.moveTo(2, 3);
5031 path.cubicTo(3, 5, 2, 4, 3.66666651f, 3);
5032 path.close();
5033 pathB.setFillType(SkPath::kWinding_FillType);
5034 pathB.moveTo(3, 5);
5035 pathB.cubicTo(2, 4, 3.66666651f, 3, 2, 3);
5036 pathB.close();
5037 SkPath qPath, qPathB;
5038 CubicPathToQuads(path, &qPath);
5039 CubicPathToQuads(pathB, &qPathB);
5040// SkPoint from = {2.61714339f,1.90228665f};
5041// SkPoint to = {2.617045833359139f,1.9013528935803314f};
5042// path_edit(from, to, &qPathB);
5043 testPathOp(reporter, qPath, qPathB, kIntersect_SkPathOp, filename);
5044}
5045
caryclarkaec25102015-04-29 08:28:30 -07005046static void loops59i(skiatest::Reporter* reporter, const char* filename) {
5047 SkPath path, pathB;
5048 path.setFillType(SkPath::kWinding_FillType);
5049 path.moveTo(0, 6);
5050 path.cubicTo(1, 2, 7.33333302f, 1.66666663f, -7.5f, 2);
5051 path.close();
5052 pathB.setFillType(SkPath::kWinding_FillType);
5053 pathB.moveTo(1, 2);
5054 pathB.cubicTo(7.33333302f, 1.66666663f, -7.5f, 2, 0, 6);
5055 pathB.close();
5056 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
5057}
5058
caryclarkaec25102015-04-29 08:28:30 -07005059static void loops59iasQuads(skiatest::Reporter* reporter, const char* filename) {
5060 SkPath path, pathB;
5061 path.setFillType(SkPath::kWinding_FillType);
5062 path.moveTo(0, 6);
5063 path.cubicTo(1, 2, 7.33333302f, 1.66666663f, -7.5f, 2);
5064 path.close();
5065 pathB.setFillType(SkPath::kWinding_FillType);
5066 pathB.moveTo(1, 2);
5067 pathB.cubicTo(7.33333302f, 1.66666663f, -7.5f, 2, 0, 6);
5068 pathB.close();
5069 SkPath qPath, qPathB;
5070 CubicPathToQuads(path, &qPath);
5071 CubicPathToQuads(pathB, &qPathB);
5072 SkPoint from = {2.61714339f,1.90228665f};
5073 SkPoint to = {2.617045833359139f,1.9013528935803314f};
5074 path_edit(from, to, &qPathB);
5075 testPathOp(reporter, qPath, qPathB, kIntersect_SkPathOp, filename);
5076}
5077
5078static void cubics41d(skiatest::Reporter* reporter, const char* filename) {
5079 SkPath path, pathB;
5080 path.setFillType(SkPath::kWinding_FillType);
5081 path.moveTo(0, 1);
5082 path.cubicTo(1, 4, 3, 0, 3, 1);
5083 path.close();
5084 pathB.setFillType(SkPath::kWinding_FillType);
5085 pathB.moveTo(0, 3);
5086 pathB.cubicTo(1, 3, 1, 0, 4, 1);
5087 pathB.close();
5088 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
5089}
5090
caryclark624637c2015-05-11 07:21:27 -07005091void loops61i(skiatest::Reporter* reporter, const char* filename) {
5092 SkPath path, pathB;
5093 path.setFillType(SkPath::kWinding_FillType);
5094 path.moveTo(0, 1);
5095 path.cubicTo(1, 5, -6.33333302f, 0.666666627f, 8, -1);
5096 path.close();
5097 pathB.setFillType(SkPath::kWinding_FillType);
5098 pathB.moveTo(1, 5);
5099 pathB.cubicTo(-6.33333302f, 0.666666627f, 8, -1, 0, 1);
5100 pathB.close();
caryclarkbca19f72015-05-13 08:23:48 -07005101 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark624637c2015-05-11 07:21:27 -07005102}
5103
5104static void loops62i(skiatest::Reporter* reporter, const char* filename) {
5105 SkPath path, pathB;
5106 path.setFillType(SkPath::kWinding_FillType);
5107 path.moveTo(0, 2);
5108 path.cubicTo(1, 6, -6.33333302f, 1.66666663f, 8, 0);
5109 path.close();
5110 pathB.setFillType(SkPath::kWinding_FillType);
5111 pathB.moveTo(1, 6);
5112 pathB.cubicTo(-6.33333302f, 1.66666663f, 8, 0, 0, 2);
5113 pathB.close();
caryclarkbca19f72015-05-13 08:23:48 -07005114 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark624637c2015-05-11 07:21:27 -07005115}
5116
5117static void loops63i(skiatest::Reporter* reporter, const char* filename) {
5118 SkPath path, pathB;
5119 path.setFillType(SkPath::kWinding_FillType);
5120 path.moveTo(0, 1);
5121 path.cubicTo(2, 4, -4, -0.833333254f, 6, -3);
5122 path.close();
5123 pathB.setFillType(SkPath::kWinding_FillType);
5124 pathB.moveTo(2, 4);
5125 pathB.cubicTo(-4, -0.833333254f, 6, -3, 0, 1);
5126 pathB.close();
caryclarkbca19f72015-05-13 08:23:48 -07005127 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
caryclark624637c2015-05-11 07:21:27 -07005128}
5129
5130static void cubics44d(skiatest::Reporter* reporter, const char* filename) {
5131 SkPath path, pathB;
5132 path.setFillType(SkPath::kWinding_FillType);
5133 path.moveTo(3, 4);
5134 path.cubicTo(2, 5, 3, 1, 6, 2);
5135 path.close();
5136 pathB.setFillType(SkPath::kWinding_FillType);
5137 pathB.moveTo(1, 3);
5138 pathB.cubicTo(2, 6, 4, 3, 5, 2);
5139 pathB.close();
caryclarkbca19f72015-05-13 08:23:48 -07005140 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
caryclark624637c2015-05-11 07:21:27 -07005141}
5142
5143static void cubics45u(skiatest::Reporter* reporter, const char* filename) {
5144 SkPath path, pathB;
5145 path.setFillType(SkPath::kWinding_FillType);
5146 path.moveTo(1, 3);
5147 path.cubicTo(2, 6, 4, 3, 5, 2);
5148 path.close();
5149 pathB.setFillType(SkPath::kWinding_FillType);
5150 pathB.moveTo(3, 4);
5151 pathB.cubicTo(2, 5, 3, 1, 6, 2);
5152 pathB.close();
caryclarkbca19f72015-05-13 08:23:48 -07005153 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
caryclark624637c2015-05-11 07:21:27 -07005154}
5155
caryclark54359292015-03-26 07:52:43 -07005156static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0;
caryclarkbca19f72015-05-13 08:23:48 -07005157static void (*firstTest)(skiatest::Reporter* , const char* filename) = loops63i;
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00005158static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0;
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005159
caryclark624637c2015-05-11 07:21:27 -07005160#define TEST(name) { name, #name }
5161
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005162static struct TestDesc tests[] = {
caryclark624637c2015-05-11 07:21:27 -07005163 TEST(cubics44d),
5164 TEST(cubics45u),
5165 TEST(loops61i),
5166 TEST(loops62i),
5167 TEST(loops63i),
5168 TEST(loops58iAsQuads),
caryclarkaec25102015-04-29 08:28:30 -07005169 TEST(cubics41d),
5170 TEST(loops59iasQuads),
5171 TEST(loops59i),
caryclarkaec25102015-04-29 08:28:30 -07005172 TEST(loops44i),
5173 TEST(loops45i),
5174 TEST(loops46i),
5175 TEST(loops47i),
5176 TEST(loops48i),
5177 TEST(loops49i),
5178 TEST(loops50i),
5179 TEST(loops51i),
5180 TEST(loops52i),
5181 TEST(loops53i),
5182 TEST(loops54i),
5183 TEST(loops55i),
5184 TEST(loops56i),
5185 TEST(loops57i),
5186 TEST(loops58i),
5187 TEST(loops33iMod),
5188 TEST(loops33iAsQuads),
5189 TEST(loops33i),
5190 TEST(loops40i),
5191 TEST(loops40iAsQuads),
5192 TEST(loops39i),
5193 TEST(loops38i),
5194 TEST(loops37i),
5195 TEST(loops36i),
5196 TEST(loops35i),
5197 TEST(loops34i),
5198 TEST(loops32i),
5199 TEST(loops31i),
5200 TEST(loops30i),
5201 TEST(loops29i),
5202 TEST(loops28i),
5203 TEST(loops27i),
5204 TEST(loops26i),
5205 TEST(loops25i),
5206 TEST(loops24i),
5207 TEST(loops23i),
5208 TEST(loops22i),
5209 TEST(loops21i),
5210 TEST(loops20i),
5211 TEST(cubics20d),
caryclark08bc8482015-04-24 09:08:57 -07005212 TEST(cubics6d),
5213 TEST(cubics7d),
5214 TEST(cubics8d),
5215 TEST(cubics9d),
5216 TEST(cubics10u),
5217 TEST(cubics11i),
5218 TEST(cubics12d),
5219 TEST(cubics13d),
5220 TEST(cubics14d),
5221 TEST(cubics15d),
5222 TEST(cubics16i),
5223 TEST(cubics17d),
5224 TEST(cubics18d),
5225 TEST(cubics19d),
5226 TEST(cubicOp157),
5227 TEST(cubicOp142),
caryclark03b03ca2015-04-23 09:13:37 -07005228 TEST(loops4i),
5229 TEST(quadRect1),
5230 TEST(quadRect2),
5231 TEST(quadRect3),
5232 TEST(quadRect4),
5233 TEST(quadRect5),
5234 TEST(quadRect6),
5235 TEST(cubicOp141),
5236 TEST(cubicOp58d),
5237 TEST(loops5i),
5238 TEST(cubicOp140),
5239 TEST(cubicOp139),
5240 TEST(cubics138),
5241 TEST(cubics137),
5242 TEST(cubicOp136a),
5243 TEST(cubicOp136),
5244 TEST(cubicOp135),
5245 TEST(cubicOp134),
5246 TEST(cubicOp133),
caryclark03b03ca2015-04-23 09:13:37 -07005247 TEST(loop12),
caryclark1049f122015-04-20 08:31:59 -07005248 TEST(cubicOp132),
5249 TEST(loop11),
5250 TEST(loop10),
5251 TEST(circlesOp3),
5252 TEST(loop9),
5253 TEST(loop8),
5254 TEST(rects5),
5255 TEST(loop7),
5256 TEST(cubicOp130a),
5257 TEST(rRect1x),
5258 TEST(circlesOp2),
5259 TEST(circlesOp1),
5260 TEST(cubicOp131),
5261 TEST(cubicOp130),
5262 TEST(cubicOp129),
caryclark54359292015-03-26 07:52:43 -07005263 TEST(cubicOp128),
5264 TEST(cubicOp127),
5265 TEST(cubicOp126),
5266 TEST(cubicOp125),
5267 TEST(cubicOp124),
5268 TEST(loop6),
5269 TEST(loop5),
5270 TEST(cubicOp123),
5271 TEST(cubicOp122),
5272 TEST(cubicOp121),
5273 TEST(cubicOp120),
5274 TEST(cubicOp119),
5275 TEST(loop4),
5276 TEST(loop3),
5277 TEST(loop2),
5278 TEST(loop1asQuad),
5279 TEST(loop1),
5280 TEST(issue3517),
5281 TEST(cubicOp118),
5282 TEST(cubicOp117),
5283 TEST(cubicOp116),
5284 TEST(testRect2),
5285 TEST(testRect1),
caryclark65f55312014-11-13 06:58:52 -08005286 TEST(cubicOp115),
caryclark54359292015-03-26 07:52:43 -07005287 TEST(issue2753),
caryclark03b03ca2015-04-23 09:13:37 -07005288 TEST(cubicOp114),
caryclark80a83ad2014-08-12 05:49:37 -07005289 TEST(issue2808),
caryclarke4097e32014-06-18 07:24:19 -07005290 TEST(cubicOp114asQuad),
caryclarkdac1d172014-06-17 05:15:38 -07005291 TEST(rects4),
5292 TEST(rects3),
5293 TEST(rects2),
5294 TEST(rects1),
caryclarkdac1d172014-06-17 05:15:38 -07005295 TEST(issue2540),
commit-bot@chromium.org2db7fe72014-05-07 15:31:40 +00005296 TEST(issue2504),
commit-bot@chromium.org91fc81c2014-04-30 13:37:48 +00005297 TEST(kari1),
commit-bot@chromium.org8cb1daa2014-04-25 12:59:11 +00005298 TEST(quadOp10i),
commit-bot@chromium.org8cb1daa2014-04-25 12:59:11 +00005299 TEST(cubicOp113),
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00005300 TEST(skpcarrot_is24),
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00005301 TEST(issue1417),
commit-bot@chromium.org8cb1daa2014-04-25 12:59:11 +00005302 TEST(cubicOp112),
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00005303 TEST(skpadspert_net23),
5304 TEST(skpadspert_de11),
5305 TEST(findFirst1),
5306 TEST(xOp2i),
5307 TEST(xOp3i),
5308 TEST(xOp1u),
5309 TEST(xOp1i),
5310 TEST(cubicOp111),
5311 TEST(cubicOp110),
5312 TEST(cubicOp109),
5313 TEST(cubicOp108),
5314 TEST(cubicOp107),
5315 TEST(cubicOp106),
5316 TEST(cubicOp105),
5317 TEST(cubicOp104),
5318 TEST(cubicOp103),
5319 TEST(cubicOp102),
5320 TEST(cubicOp101),
5321 TEST(cubicOp100),
5322 TEST(cubicOp99),
5323 TEST(issue1435),
caryclark@google.coma2bbc6e2013-11-01 17:36:03 +00005324 TEST(cubicOp98x),
5325 TEST(cubicOp97x),
caryclark54359292015-03-26 07:52:43 -07005326 TEST(skpcarpetplanet_ru22),
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00005327 TEST(cubicOp96d),
5328 TEST(cubicOp95u),
5329 TEST(skpadbox_lt15),
5330 TEST(skpagentxsites_com55),
5331 TEST(skpadventistmission_org572),
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00005332 TEST(skpadoption_org196),
5333 TEST(skpbambootheme_com12),
5334 TEST(skpbakosoft_com10),
5335 TEST(skpakmmos_ru100),
5336 TEST(skpbangalorenest_com4),
5337 TEST(skpbingoentertainment_net189),
5338 TEST(skpbestred_ru37),
5339 TEST(skpbenzoteh_ru152),
5340 TEST(skpcamcorder_kz21),
5341 TEST(skpcaffelavazzait_com_ua21),
5342 TEST(skpcarrefour_ro62),
5343 TEST(skpcavablar_net563),
5344 TEST(skpinsomnia_gr72),
5345 TEST(skpadbox_lt8),
5346 TEST(skpact_com43),
5347 TEST(skpacesoftech_com47),
5348 TEST(skpabcspark_ca103),
5349 TEST(cubicOp94u),
5350 TEST(cubicOp93d),
5351 TEST(cubicOp92i),
5352 TEST(skpadithya_putr4_blogspot_com551),
5353 TEST(skpadindex_de4),
caryclark@google.com7eaa53d2013-10-02 14:49:34 +00005354 TEST(skpaiaigames_com870),
5355 TEST(skpaaalgarve_org53),
5356 TEST(skpkkiste_to716),
caryclark@google.com570863f2013-09-16 15:55:01 +00005357 TEST(cubicOp91u),
5358 TEST(cubicOp90u),
5359 TEST(cubicOp89u),
5360 TEST(cubicOp88u),
5361 TEST(cubicOp87u),
5362 TEST(cubicOp86i),
5363 TEST(loopEdge2),
5364 TEST(loopEdge1),
5365 TEST(rectOp3x),
5366 TEST(rectOp2i),
5367 TEST(rectOp1i),
5368 TEST(issue1418b),
caryclark@google.com4fdbb222013-07-23 15:27:41 +00005369 TEST(cubicOp85i),
caryclark@google.com4fdbb222013-07-23 15:27:41 +00005370 TEST(issue1418),
5371 TEST(skpkkiste_to98),
caryclark@google.comfa2aeee2013-07-15 13:29:13 +00005372 TEST(skpahrefs_com29),
5373 TEST(cubicOp85d),
5374 TEST(skpahrefs_com88),
caryclark@google.com07e97fc2013-07-08 17:17:02 +00005375 TEST(skphealth_com76),
5376 TEST(skpancestry_com1),
5377 TEST(skpbyte_com1),
5378 TEST(skpeldorado_com_ua1),
5379 TEST(skp96prezzi1),
caryclark@google.comcffbcc32013-06-04 17:59:42 +00005380 TEST(skpClip2),
caryclark@google.comcffbcc32013-06-04 17:59:42 +00005381 TEST(skpClip1),
5382 TEST(cubicOp84d),
5383 TEST(cubicOp83i),
reed@google.com277c3f82013-05-31 15:17:50 +00005384 TEST(cubicOp82i),
5385 TEST(cubicOp81d),
5386 TEST(cubicOp80i),
5387 TEST(cubicOp79u),
reed@google.com277c3f82013-05-31 15:17:50 +00005388 TEST(cubicOp78u),
5389 TEST(cubicOp77i),
caryclark@google.comcffbcc32013-06-04 17:59:42 +00005390 TEST(cubicOp76u),
reed@google.com277c3f82013-05-31 15:17:50 +00005391 TEST(cubicOp75d),
caryclark@google.comcffbcc32013-06-04 17:59:42 +00005392 TEST(cubicOp74d),
reed@google.com277c3f82013-05-31 15:17:50 +00005393 TEST(cubicOp73d),
5394 TEST(cubicOp72i),
5395 TEST(cubicOp71d),
caryclark@google.coma5e55922013-05-07 18:51:31 +00005396 TEST(skp5),
5397 TEST(skp4),
5398 TEST(skp3),
5399 TEST(skp2),
5400 TEST(skp1),
caryclark@google.com6dc7df62013-04-25 11:51:54 +00005401 TEST(rRect1),
caryclark@google.coma5e55922013-05-07 18:51:31 +00005402 TEST(cubicOp70d),
caryclark@google.com03610322013-04-18 15:58:21 +00005403 TEST(cubicOp69d),
5404 TEST(cubicOp68u),
caryclark@google.comb3f09212013-04-17 15:49:16 +00005405 TEST(cubicOp67u),
5406 TEST(cubicOp66u),
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005407 TEST(rectOp1d),
5408 TEST(cubicOp65d),
5409 TEST(cubicOp64d),
5410 TEST(cubicOp63d),
5411 TEST(cubicOp62d),
5412 TEST(cubicOp61d),
5413 TEST(cubicOp60d),
5414 TEST(cubicOp59d),
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005415 TEST(cubicOp57d),
5416 TEST(cubicOp56d),
5417 TEST(cubicOp55d),
5418 TEST(cubicOp54d),
5419 TEST(cubicOp53d),
5420 TEST(cubicOp52d),
5421 TEST(cubicOp51d),
5422 TEST(cubicOp50d),
5423 TEST(cubicOp49d),
5424 TEST(cubicOp48d),
5425 TEST(cubicOp47d),
5426 TEST(cubicOp46d),
5427 TEST(cubicOp45d),
5428 TEST(cubicOp44d),
5429 TEST(cubicOp43d),
5430 TEST(cubicOp42d),
5431 TEST(cubicOp41i),
5432 TEST(cubicOp40d),
5433 TEST(cubicOp39d),
5434 TEST(cubicOp38d),
5435 TEST(cubicOp37d),
5436 TEST(cubicOp36u),
5437 TEST(cubicOp35d),
5438 TEST(cubicOp34d),
5439 TEST(cubicOp33i),
5440 TEST(cubicOp32d),
5441 TEST(cubicOp31d),
5442 TEST(cubicOp31x),
5443 TEST(cubicOp31u),
5444 TEST(cubicOp30d),
5445 TEST(cubicOp29d),
5446 TEST(cubicOp28u),
5447 TEST(cubicOp27d),
5448 TEST(cubicOp26d),
5449 TEST(cubicOp25i),
5450 TEST(testOp8d),
5451 TEST(testDiff1),
5452 TEST(testIntersect1),
5453 TEST(testUnion1),
5454 TEST(testXor1),
5455 TEST(testDiff2),
5456 TEST(testIntersect2),
5457 TEST(testUnion2),
5458 TEST(testXor2),
5459 TEST(testOp1d),
5460 TEST(testOp2d),
5461 TEST(testOp3d),
5462 TEST(testOp1u),
5463 TEST(testOp4d),
5464 TEST(testOp5d),
5465 TEST(testOp6d),
5466 TEST(testOp7d),
5467 TEST(testOp2u),
5468
5469 TEST(cubicOp24d),
5470 TEST(cubicOp23d),
5471 TEST(cubicOp22d),
5472 TEST(cubicOp21d),
5473 TEST(cubicOp20d),
5474 TEST(cubicOp19i),
5475 TEST(cubicOp18d),
5476 TEST(cubicOp17d),
5477 TEST(cubicOp16d),
5478 TEST(cubicOp15d),
5479 TEST(cubicOp14d),
5480 TEST(cubicOp13d),
5481 TEST(cubicOp12d),
5482 TEST(cubicOp11d),
5483 TEST(cubicOp10d),
5484 TEST(cubicOp1i),
5485 TEST(cubicOp9d),
5486 TEST(quadOp9d),
5487 TEST(lineOp9d),
5488 TEST(cubicOp8d),
5489 TEST(cubicOp7d),
5490 TEST(cubicOp6d),
5491 TEST(cubicOp5d),
5492 TEST(cubicOp3d),
5493 TEST(cubicOp2d),
5494 TEST(cubicOp1d),
5495};
5496
caryclark@google.comad65a3e2013-04-15 19:13:59 +00005497static const size_t testCount = SK_ARRAY_COUNT(tests);
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005498
5499static struct TestDesc subTests[] = {
caryclarkbca19f72015-05-13 08:23:48 -07005500 TEST(loops47i),
caryclark624637c2015-05-11 07:21:27 -07005501 TEST(loops61i),
5502 TEST(loops62i),
caryclarkbca19f72015-05-13 08:23:48 -07005503 TEST(issue3517),
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005504};
5505
caryclark@google.comad65a3e2013-04-15 19:13:59 +00005506static const size_t subTestCount = SK_ARRAY_COUNT(subTests);
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005507
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00005508static void (*firstSubTest)(skiatest::Reporter* , const char* filename) = 0;
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005509
caryclarkbca19f72015-05-13 08:23:48 -07005510static bool runSubTests = false;
caryclark03b03ca2015-04-23 09:13:37 -07005511static bool runSubTestsFirst = true;
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005512static bool runReverse = false;
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005513
tfarina@chromium.org78e7b4e2014-01-02 21:45:03 +00005514DEF_TEST(PathOpsOp, reporter) {
caryclark@google.com07e97fc2013-07-08 17:17:02 +00005515#if DEBUG_SHOW_TEST_NAME
5516 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH);
5517#endif
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00005518 if (runSubTests && runSubTestsFirst) {
caryclark54359292015-03-26 07:52:43 -07005519 RunTestSet(reporter, subTests, subTestCount, firstSubTest, NULL, stopTest, runReverse);
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005520 }
caryclark54359292015-03-26 07:52:43 -07005521 RunTestSet(reporter, tests, testCount, firstTest, skipTest, stopTest, runReverse);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00005522 if (runSubTests && !runSubTestsFirst) {
caryclark54359292015-03-26 07:52:43 -07005523 RunTestSet(reporter, subTests, subTestCount, firstSubTest, NULL, stopTest, runReverse);
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005524 }
caryclark@google.com818b0cc2013-04-08 11:50:46 +00005525}
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00005526
5527static void bufferOverflow(skiatest::Reporter* reporter, const char* filename) {
5528 SkPath path;
5529 path.addRect(0,0, 300,170141183460469231731687303715884105728.f);
5530 SkPath pathB;
5531 pathB.addRect(0,0, 300,16);
caryclarkbca19f72015-05-13 08:23:48 -07005532 testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00005533}
5534
caryclark361b8b02014-09-08 10:25:38 -07005535// m 100,0 60,170 -160,-110 200,0 -170,11000000000 z
5536static void fuzz433(skiatest::Reporter* reporter, const char* filename) {
5537 SkPath path1, path2;
5538 path1.moveTo(100,0);
5539 path1.lineTo(60,170);
5540 path1.lineTo(-160,-110);
5541 path1.lineTo(200,0);
5542 path1.lineTo(-170,11000000000.0f);
5543 path1.close();
5544
5545 path2.moveTo(100 + 20,0 + 20);
5546 path2.lineTo(60 + 20,170 + 20);
5547 path2.lineTo(-160 + 20,-110 + 20);
5548 path2.lineTo(200 + 20,0 + 20);
5549 path2.lineTo(-170 + 20,11000000000.0f + 20);
5550 path2.close();
5551
caryclarkbca19f72015-05-13 08:23:48 -07005552 testPathOpCheck(reporter, path1, path2, kIntersect_SkPathOp, filename, FLAGS_runFail);
caryclark361b8b02014-09-08 10:25:38 -07005553}
5554
5555static void fuzz433b(skiatest::Reporter* reporter, const char* filename) {
5556 SkPath path1, path2;
5557 path1.setFillType(SkPath::kEvenOdd_FillType);
5558 path1.moveTo(140, 40);
5559 path1.lineTo(200, 210);
5560 path1.lineTo(40, 100);
5561 path1.lineTo(240, 100);
5562 path1.lineTo(70, 1.1e+10f);
5563 path1.lineTo(140, 40);
5564 path1.close();
5565
5566 path1.setFillType(SkPath::kWinding_FillType);
5567 path2.moveTo(190, 60);
5568 path2.lineTo(250, 230);
5569 path2.lineTo(90, 120);
5570 path2.lineTo(290, 120);
5571 path2.lineTo(120, 1.1e+10f);
5572 path2.lineTo(190, 60);
5573 path2.close();
5574
caryclarkbca19f72015-05-13 08:23:48 -07005575 testPathOpCheck(reporter, path1, path2, kUnion_SkPathOp, filename, FLAGS_runFail);
caryclark361b8b02014-09-08 10:25:38 -07005576}
5577
caryclark630240d2014-09-19 06:33:31 -07005578static void fuzz487a(skiatest::Reporter* reporter, const char* filename) {
5579 SkPath path;
5580 path.setFillType((SkPath::FillType) 0);
5581path.moveTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000));
5582path.lineTo(SkBits2Float(0x4309999a), SkBits2Float(0x42c00000));
5583path.cubicTo(SkBits2Float(0x4309999a), SkBits2Float(0x429a6666), SkBits2Float(0x42f9999a), SkBits2Float(0x4275999a), SkBits2Float(0x42d70001), SkBits2Float(0x42633333));
5584path.lineTo(SkBits2Float(0x42e90001), SkBits2Float(0x41b8cccc));
5585path.cubicTo(SkBits2Float(0x42dc6667), SkBits2Float(0x41ab3332), SkBits2Float(0x42cf3334), SkBits2Float(0x41a3ffff), SkBits2Float(0x42c20001), SkBits2Float(0x41a3ffff));
5586path.lineTo(SkBits2Float(0x42c20001), SkBits2Float(0x425d999a));
5587path.lineTo(SkBits2Float(0x42c20001), SkBits2Float(0x425d999a));
5588path.cubicTo(SkBits2Float(0x429c6668), SkBits2Float(0x425d999a), SkBits2Float(0x4279999c), SkBits2Float(0x42886667), SkBits2Float(0x42673335), SkBits2Float(0x42ab0000));
5589path.lineTo(SkBits2Float(0x41c0ccd0), SkBits2Float(0x42990000));
5590path.cubicTo(SkBits2Float(0x41b33336), SkBits2Float(0x42a5999a), SkBits2Float(0x41ac0003), SkBits2Float(0x42b2cccd), SkBits2Float(0x41ac0003), SkBits2Float(0x42c00000));
5591path.lineTo(SkBits2Float(0x4261999c), SkBits2Float(0x42c00000));
5592path.lineTo(SkBits2Float(0x4261999c), SkBits2Float(0x42c00000));
5593path.cubicTo(SkBits2Float(0x4261999c), SkBits2Float(0x434d3333), SkBits2Float(0x4364e667), SkBits2Float(0x4346b333), SkBits2Float(0x4364e667), SkBits2Float(0x43400000));
5594path.lineTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000));
5595path.close();
5596
5597 SkPath path1(path);
5598 path.reset();
5599 path.setFillType((SkPath::FillType) 0);
5600path.moveTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000));
5601path.lineTo(SkBits2Float(0x4309999a), SkBits2Float(0x42c00000));
5602path.cubicTo(SkBits2Float(0x4309999a), SkBits2Float(0x42a20000), SkBits2Float(0x43016667), SkBits2Float(0x4287cccd), SkBits2Float(0x42ea999a), SkBits2Float(0x4273999a));
5603path.lineTo(SkBits2Float(0x4306cccd), SkBits2Float(0x41f5999a));
5604path.cubicTo(SkBits2Float(0x42f76667), SkBits2Float(0x41c26667), SkBits2Float(0x42dd999a), SkBits2Float(0x41a4cccd), SkBits2Float(0x42c23334), SkBits2Float(0x41a4cccd));
5605path.lineTo(SkBits2Float(0x42c23334), SkBits2Float(0x425e0000));
5606path.cubicTo(SkBits2Float(0x42a43334), SkBits2Float(0x425e0000), SkBits2Float(0x428a0001), SkBits2Float(0x427ecccd), SkBits2Float(0x42780002), SkBits2Float(0x4297999a));
5607path.lineTo(SkBits2Float(0x41fccccd), SkBits2Float(0x42693333));
5608path.cubicTo(SkBits2Float(0x41c9999a), SkBits2Float(0x428acccd), SkBits2Float(0x41ac0000), SkBits2Float(0x42a4999a), SkBits2Float(0x41ac0000), SkBits2Float(0x42c00000));
5609path.lineTo(SkBits2Float(0x4261999a), SkBits2Float(0x42c00000));
5610path.cubicTo(SkBits2Float(0x4261999a), SkBits2Float(0x42de0000), SkBits2Float(0x42813333), SkBits2Float(0x42f83333), SkBits2Float(0x42996666), SkBits2Float(0x4303199a));
5611path.cubicTo(SkBits2Float(0x4272cccc), SkBits2Float(0x4303199a), SkBits2Float(0x423d3332), SkBits2Float(0x430de667), SkBits2Float(0x422d9999), SkBits2Float(0x431cb334));
5612path.lineTo(SkBits2Float(0x7086a1dc), SkBits2Float(0x42eecccd));
5613path.lineTo(SkBits2Float(0x41eb3333), SkBits2Float(0xc12ccccd));
5614path.lineTo(SkBits2Float(0x42053333), SkBits2Float(0xc1cccccd));
5615path.lineTo(SkBits2Float(0x42780000), SkBits2Float(0xc18f3334));
5616path.cubicTo(SkBits2Float(0x43206666), SkBits2Float(0x43134ccd), SkBits2Float(0x43213333), SkBits2Float(0x430db333), SkBits2Float(0x43213333), SkBits2Float(0x43080000));
5617path.lineTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000));
5618path.close();
5619
5620 SkPath path2(path);
caryclarkbca19f72015-05-13 08:23:48 -07005621 testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFail);
caryclark630240d2014-09-19 06:33:31 -07005622}
5623
5624static void fuzz487b(skiatest::Reporter* reporter, const char* filename) {
5625 SkPath path;
5626 path.setFillType((SkPath::FillType) 0);
5627path.moveTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000));
5628path.lineTo(SkBits2Float(0x4309999a), SkBits2Float(0x42c00000));
5629path.cubicTo(SkBits2Float(0x4309999a), SkBits2Float(0x429a6666), SkBits2Float(0x42f9999a), SkBits2Float(0x4275999a), SkBits2Float(0x42d70001), SkBits2Float(0x42633333));
5630path.lineTo(SkBits2Float(0x42e90001), SkBits2Float(0x41b8cccc));
5631path.cubicTo(SkBits2Float(0x42dc6667), SkBits2Float(0x41ab3332), SkBits2Float(0x42cf3334), SkBits2Float(0x41a3ffff), SkBits2Float(0x42c20001), SkBits2Float(0x41a3ffff));
5632path.lineTo(SkBits2Float(0x42c20001), SkBits2Float(0x425d999a));
5633path.lineTo(SkBits2Float(0x42c20001), SkBits2Float(0x425d999a));
5634path.cubicTo(SkBits2Float(0x429c6668), SkBits2Float(0x425d999a), SkBits2Float(0x4279999c), SkBits2Float(0x42886667), SkBits2Float(0x42673335), SkBits2Float(0x42ab0000));
5635path.lineTo(SkBits2Float(0x41c0ccd0), SkBits2Float(0x42990000));
5636path.cubicTo(SkBits2Float(0x41b33336), SkBits2Float(0x42a5999a), SkBits2Float(0x41ac0003), SkBits2Float(0x42b2cccd), SkBits2Float(0x41ac0003), SkBits2Float(0x42c00000));
5637path.lineTo(SkBits2Float(0x4261999c), SkBits2Float(0x42c00000));
5638path.lineTo(SkBits2Float(0x4261999c), SkBits2Float(0x42c00000));
5639path.cubicTo(SkBits2Float(0x4261999c), SkBits2Float(0x434d3333), SkBits2Float(0x4364e667), SkBits2Float(0x4346b333), SkBits2Float(0x4364e667), SkBits2Float(0x43400000));
5640path.lineTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000));
5641path.close();
5642
5643 SkPath path1(path);
5644 path.reset();
5645 path.setFillType((SkPath::FillType) 0);
5646path.moveTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000));
5647path.lineTo(SkBits2Float(0x4309999a), SkBits2Float(0x42c00000));
5648path.cubicTo(SkBits2Float(0x4309999a), SkBits2Float(0x42a20000), SkBits2Float(0x43016667), SkBits2Float(0x4287cccd), SkBits2Float(0x42ea999a), SkBits2Float(0x4273999a));
5649path.lineTo(SkBits2Float(0x4306cccd), SkBits2Float(0x41f5999a));
5650path.cubicTo(SkBits2Float(0x42f76667), SkBits2Float(0x41c26667), SkBits2Float(0x42dd999a), SkBits2Float(0x41a4cccd), SkBits2Float(0x42c23334), SkBits2Float(0x41a4cccd));
5651path.lineTo(SkBits2Float(0x42c23334), SkBits2Float(0x425e0000));
5652path.cubicTo(SkBits2Float(0x42a43334), SkBits2Float(0x425e0000), SkBits2Float(0x428a0001), SkBits2Float(0x427ecccd), SkBits2Float(0x42780002), SkBits2Float(0x4297999a));
5653path.lineTo(SkBits2Float(0x41fccccd), SkBits2Float(0x42693333));
5654path.cubicTo(SkBits2Float(0x41c9999a), SkBits2Float(0x428acccd), SkBits2Float(0x41ac0000), SkBits2Float(0x42a4999a), SkBits2Float(0x41ac0000), SkBits2Float(0x42c00000));
5655path.lineTo(SkBits2Float(0x4261999a), SkBits2Float(0x42c00000));
5656path.cubicTo(SkBits2Float(0x4261999a), SkBits2Float(0x42de0000), SkBits2Float(0x42813333), SkBits2Float(0x42f83333), SkBits2Float(0x42996666), SkBits2Float(0x4303199a));
5657path.cubicTo(SkBits2Float(0x4272cccc), SkBits2Float(0x4303199a), SkBits2Float(0x423d3332), SkBits2Float(0x430de667), SkBits2Float(0x422d9999), SkBits2Float(0x431cb334));
5658path.lineTo(SkBits2Float(0x7086a1dc), SkBits2Float(0x42eecccd));
5659path.lineTo(SkBits2Float(0x41eb3333), SkBits2Float(0xc12ccccd));
5660path.lineTo(SkBits2Float(0x42053333), SkBits2Float(0xc1cccccd));
5661path.lineTo(SkBits2Float(0x42780000), SkBits2Float(0xc18f3334));
5662path.cubicTo(SkBits2Float(0x43206666), SkBits2Float(0x43134ccd), SkBits2Float(0x43213333), SkBits2Float(0x430db333), SkBits2Float(0x43213333), SkBits2Float(0x43080000));
5663path.lineTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000));
5664path.close();
5665
5666 SkPath path2(path);
caryclarkbca19f72015-05-13 08:23:48 -07005667 testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFail);
caryclark630240d2014-09-19 06:33:31 -07005668}
5669
caryclarkc06d9a72014-09-29 06:58:41 -07005670static void fuzz714(skiatest::Reporter* reporter, const char* filename) {
5671 SkPath path;
5672 path.setFillType((SkPath::FillType) 1);
5673path.moveTo(SkBits2Float(0x430c0000), SkBits2Float(0x42200000));
5674path.lineTo(SkBits2Float(0x43480000), SkBits2Float(0x43520000));
5675path.lineTo(SkBits2Float(0x42200000), SkBits2Float(0x42c80000));
caryclark08bc8482015-04-24 09:08:57 -07005676path.lineTo(SkBits2Float(0x64969569), SkBits2Float(0x42c80000)); // 2.22222e+022f
5677path.lineTo(SkBits2Float(0x64969569), SkBits2Float(0x43520000)); // 2.22222e+022f
caryclarkc06d9a72014-09-29 06:58:41 -07005678path.lineTo(SkBits2Float(0x430c0000), SkBits2Float(0x42200000));
5679path.close();
5680
5681 SkPath path1(path);
5682 path.reset();
5683 path.setFillType((SkPath::FillType) 0);
5684path.moveTo(SkBits2Float(0x43200000), SkBits2Float(0x42700000));
5685path.lineTo(SkBits2Float(0x435c0000), SkBits2Float(0x43660000));
5686path.lineTo(SkBits2Float(0x42700000), SkBits2Float(0x42f00000));
caryclark08bc8482015-04-24 09:08:57 -07005687path.lineTo(SkBits2Float(0x64969569), SkBits2Float(0x42f00000)); // 2.22222e+022f
5688path.lineTo(SkBits2Float(0x64969569), SkBits2Float(0x43660000)); // 2.22222e+022f
caryclarkc06d9a72014-09-29 06:58:41 -07005689path.lineTo(SkBits2Float(0x43200000), SkBits2Float(0x42700000));
5690path.close();
5691
5692 SkPath path2(path);
caryclarkbca19f72015-05-13 08:23:48 -07005693 testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFail);
caryclarkc06d9a72014-09-29 06:58:41 -07005694}
5695
caryclarkd751ac02014-10-03 05:36:27 -07005696static void fuzz1(skiatest::Reporter* reporter, const char* filename) {
5697 SkPath path;
5698 path.setFillType((SkPath::FillType) 0);
5699path.moveTo(SkBits2Float(0x7f800000), SkBits2Float(0x7f800000));
5700path.quadTo(SkBits2Float(0x7f800000), SkBits2Float(0x7f800000), SkBits2Float(0x7f800000), SkBits2Float(0x7f800000));
5701path.quadTo(SkBits2Float(0x7f800000), SkBits2Float(0x7f800000), SkBits2Float(0x7f800000), SkBits2Float(0x7f800000));
5702path.quadTo(SkBits2Float(0xffc00000), SkBits2Float(0x7f800000), SkBits2Float(0xffc00000), SkBits2Float(0x7f800000));
5703path.quadTo(SkBits2Float(0xff000001), SkBits2Float(0x7f800000), SkBits2Float(0xff000001), SkBits2Float(0x7f800000));
5704path.quadTo(SkBits2Float(0xff000001), SkBits2Float(0xffc00000), SkBits2Float(0xffc00000), SkBits2Float(0xffc00000));
5705path.quadTo(SkBits2Float(0xffc00000), SkBits2Float(0xff000001), SkBits2Float(0x7f800000), SkBits2Float(0xff000001));
5706path.quadTo(SkBits2Float(0x7f800000), SkBits2Float(0xff000001), SkBits2Float(0x7f800000), SkBits2Float(0xffc00000));
5707path.quadTo(SkBits2Float(0x7f800000), SkBits2Float(0xffc00000), SkBits2Float(0x7f800000), SkBits2Float(0x7f800000));
5708path.close();
5709
5710 SkPath path1(path);
5711 path.reset();
5712 path.setFillType((SkPath::FillType) 0);
5713
5714 SkPath path2(path);
5715 testPathFailOp(reporter, path1, path2, (SkPathOp) 2, filename);
5716}
5717
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00005718static struct TestDesc failTests[] = {
caryclark624637c2015-05-11 07:21:27 -07005719 TEST(fuzz487a),
caryclark08bc8482015-04-24 09:08:57 -07005720 TEST(fuzz433),
caryclarkd751ac02014-10-03 05:36:27 -07005721 TEST(fuzz1),
caryclarkc06d9a72014-09-29 06:58:41 -07005722 TEST(fuzz714),
caryclark630240d2014-09-19 06:33:31 -07005723 TEST(fuzz487b),
caryclark361b8b02014-09-08 10:25:38 -07005724 TEST(fuzz433b),
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00005725 TEST(bufferOverflow),
5726};
5727
5728static const size_t failTestCount = SK_ARRAY_COUNT(failTests);
5729
5730DEF_TEST(PathOpsFailOp, reporter) {
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00005731#if DEBUG_SHOW_TEST_NAME
5732 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH);
5733#endif
caryclark54359292015-03-26 07:52:43 -07005734 RunTestSet(reporter, failTests, failTestCount, NULL, NULL, NULL, false);
commit-bot@chromium.org4431e772014-04-14 17:08:59 +00005735}