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