caryclark@google.com | af46cff | 2012-05-22 21:12:00 +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 | |
caryclark@google.com | af46cff | 2012-05-22 21:12:00 +0000 | [diff] [blame] | 8 | #include "EdgeWalker_Test.h" |
| 9 | #include "Intersection_Tests.h" |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 10 | #include "ShapeOps.h" |
caryclark@google.com | af46cff | 2012-05-22 21:12:00 +0000 | [diff] [blame] | 11 | |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 12 | #define TEST(name) { name, #name } |
| 13 | |
caryclark@google.com | af46cff | 2012-05-22 21:12:00 +0000 | [diff] [blame] | 14 | static void testLine1() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 15 | SkPath path; |
caryclark@google.com | af46cff | 2012-05-22 21:12:00 +0000 | [diff] [blame] | 16 | path.moveTo(2,0); |
| 17 | path.lineTo(1,1); |
| 18 | path.lineTo(0,0); |
| 19 | path.close(); |
caryclark@google.com | 88f7d0c | 2012-06-07 21:09:20 +0000 | [diff] [blame] | 20 | testSimplifyx(path); |
caryclark@google.com | af46cff | 2012-05-22 21:12:00 +0000 | [diff] [blame] | 21 | } |
| 22 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 23 | static void testLine1x() { |
| 24 | SkPath path; |
| 25 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 26 | path.moveTo(2,0); |
| 27 | path.lineTo(1,1); |
| 28 | path.lineTo(0,0); |
| 29 | path.close(); |
| 30 | testSimplifyx(path); |
| 31 | } |
| 32 | |
caryclark@google.com | af46cff | 2012-05-22 21:12:00 +0000 | [diff] [blame] | 33 | static void addInnerCWTriangle(SkPath& path) { |
| 34 | path.moveTo(3,0); |
| 35 | path.lineTo(4,1); |
| 36 | path.lineTo(2,1); |
| 37 | path.close(); |
| 38 | } |
| 39 | |
| 40 | static void addInnerCCWTriangle(SkPath& path) { |
| 41 | path.moveTo(3,0); |
| 42 | path.lineTo(2,1); |
| 43 | path.lineTo(4,1); |
| 44 | path.close(); |
| 45 | } |
| 46 | |
| 47 | static void addOuterCWTriangle(SkPath& path) { |
| 48 | path.moveTo(3,0); |
| 49 | path.lineTo(6,2); |
| 50 | path.lineTo(0,2); |
| 51 | path.close(); |
| 52 | } |
| 53 | |
| 54 | static void addOuterCCWTriangle(SkPath& path) { |
| 55 | path.moveTo(3,0); |
| 56 | path.lineTo(0,2); |
| 57 | path.lineTo(6,2); |
| 58 | path.close(); |
| 59 | } |
| 60 | |
| 61 | static void testLine2() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 62 | SkPath path; |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 63 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 64 | addInnerCWTriangle(path); |
| 65 | addOuterCWTriangle(path); |
| 66 | testSimplifyx(path); |
| 67 | } |
| 68 | |
| 69 | static void testLine2x() { |
| 70 | SkPath path; |
| 71 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | af46cff | 2012-05-22 21:12:00 +0000 | [diff] [blame] | 72 | addInnerCWTriangle(path); |
| 73 | addOuterCWTriangle(path); |
caryclark@google.com | 88f7d0c | 2012-06-07 21:09:20 +0000 | [diff] [blame] | 74 | testSimplifyx(path); |
caryclark@google.com | af46cff | 2012-05-22 21:12:00 +0000 | [diff] [blame] | 75 | } |
| 76 | |
caryclark@google.com | 495f8e4 | 2012-05-31 13:13:11 +0000 | [diff] [blame] | 77 | static void testLine3() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 78 | SkPath path; |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 79 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 80 | addInnerCCWTriangle(path); |
| 81 | addOuterCWTriangle(path); |
| 82 | testSimplifyx(path); |
| 83 | } |
| 84 | |
| 85 | static void testLine3x() { |
| 86 | SkPath path; |
| 87 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 495f8e4 | 2012-05-31 13:13:11 +0000 | [diff] [blame] | 88 | addInnerCCWTriangle(path); |
| 89 | addOuterCWTriangle(path); |
caryclark@google.com | 88f7d0c | 2012-06-07 21:09:20 +0000 | [diff] [blame] | 90 | testSimplifyx(path); |
caryclark@google.com | 495f8e4 | 2012-05-31 13:13:11 +0000 | [diff] [blame] | 91 | } |
| 92 | |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 93 | static void testLine3a() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 94 | SkPath path; |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 95 | addInnerCWTriangle(path); |
| 96 | addOuterCCWTriangle(path); |
| 97 | testSimplifyx(path); |
| 98 | } |
| 99 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 100 | static void testLine3ax() { |
| 101 | SkPath path; |
| 102 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 103 | addInnerCWTriangle(path); |
| 104 | addOuterCCWTriangle(path); |
| 105 | testSimplifyx(path); |
| 106 | } |
| 107 | |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 108 | static void testLine3b() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 109 | SkPath path; |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 110 | addInnerCCWTriangle(path); |
| 111 | addOuterCCWTriangle(path); |
| 112 | testSimplifyx(path); |
| 113 | } |
| 114 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 115 | static void testLine3bx() { |
| 116 | SkPath path; |
| 117 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 118 | addInnerCCWTriangle(path); |
| 119 | addOuterCCWTriangle(path); |
| 120 | testSimplifyx(path); |
| 121 | } |
| 122 | |
caryclark@google.com | 495f8e4 | 2012-05-31 13:13:11 +0000 | [diff] [blame] | 123 | static void testLine4() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 124 | SkPath path; |
caryclark@google.com | 495f8e4 | 2012-05-31 13:13:11 +0000 | [diff] [blame] | 125 | addOuterCCWTriangle(path); |
| 126 | addOuterCWTriangle(path); |
caryclark@google.com | 88f7d0c | 2012-06-07 21:09:20 +0000 | [diff] [blame] | 127 | testSimplifyx(path); |
caryclark@google.com | 495f8e4 | 2012-05-31 13:13:11 +0000 | [diff] [blame] | 128 | } |
| 129 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 130 | static void testLine4x() { |
| 131 | SkPath path; |
| 132 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 133 | addOuterCCWTriangle(path); |
| 134 | addOuterCWTriangle(path); |
| 135 | testSimplifyx(path); |
| 136 | } |
| 137 | |
caryclark@google.com | 495f8e4 | 2012-05-31 13:13:11 +0000 | [diff] [blame] | 138 | static void testLine5() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 139 | SkPath path; |
caryclark@google.com | 495f8e4 | 2012-05-31 13:13:11 +0000 | [diff] [blame] | 140 | addOuterCWTriangle(path); |
| 141 | addOuterCWTriangle(path); |
caryclark@google.com | 88f7d0c | 2012-06-07 21:09:20 +0000 | [diff] [blame] | 142 | testSimplifyx(path); |
caryclark@google.com | 495f8e4 | 2012-05-31 13:13:11 +0000 | [diff] [blame] | 143 | } |
caryclark@google.com | af46cff | 2012-05-22 21:12:00 +0000 | [diff] [blame] | 144 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 145 | static void testLine5x() { |
| 146 | SkPath path; |
| 147 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 148 | addOuterCWTriangle(path); |
| 149 | addOuterCWTriangle(path); |
| 150 | testSimplifyx(path); |
| 151 | } |
| 152 | |
caryclark@google.com | 88f7d0c | 2012-06-07 21:09:20 +0000 | [diff] [blame] | 153 | static void testLine6() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 154 | SkPath path; |
caryclark@google.com | 88f7d0c | 2012-06-07 21:09:20 +0000 | [diff] [blame] | 155 | path.moveTo(0,0); |
| 156 | path.lineTo(4,0); |
| 157 | path.lineTo(2,2); |
| 158 | path.close(); |
| 159 | path.moveTo(2,0); |
| 160 | path.lineTo(6,0); |
| 161 | path.lineTo(4,2); |
| 162 | path.close(); |
| 163 | testSimplifyx(path); |
| 164 | } |
| 165 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 166 | static void testLine6x() { |
| 167 | SkPath path; |
| 168 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 169 | path.moveTo(0,0); |
| 170 | path.lineTo(4,0); |
| 171 | path.lineTo(2,2); |
| 172 | path.close(); |
| 173 | path.moveTo(2,0); |
| 174 | path.lineTo(6,0); |
| 175 | path.lineTo(4,2); |
| 176 | path.close(); |
| 177 | testSimplifyx(path); |
| 178 | } |
| 179 | |
caryclark@google.com | 88f7d0c | 2012-06-07 21:09:20 +0000 | [diff] [blame] | 180 | static void testLine7() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 181 | SkPath path; |
caryclark@google.com | 88f7d0c | 2012-06-07 21:09:20 +0000 | [diff] [blame] | 182 | path.moveTo(0,0); |
| 183 | path.lineTo(4,0); |
| 184 | path.lineTo(2,2); |
| 185 | path.close(); |
| 186 | path.moveTo(6,0); |
| 187 | path.lineTo(2,0); |
| 188 | path.lineTo(4,2); |
| 189 | path.close(); |
| 190 | testSimplifyx(path); |
| 191 | } |
| 192 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 193 | static void testLine7x() { |
| 194 | SkPath path; |
| 195 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 196 | path.moveTo(0,0); |
| 197 | path.lineTo(4,0); |
| 198 | path.lineTo(2,2); |
| 199 | path.close(); |
| 200 | path.moveTo(6,0); |
| 201 | path.lineTo(2,0); |
| 202 | path.lineTo(4,2); |
| 203 | path.close(); |
| 204 | testSimplifyx(path); |
| 205 | } |
| 206 | |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 207 | static void testLine7a() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 208 | SkPath path; |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 209 | path.moveTo(0,0); |
| 210 | path.lineTo(4,0); |
| 211 | path.lineTo(2,2); |
| 212 | path.close(); |
| 213 | testSimplifyx(path); |
| 214 | } |
| 215 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 216 | static void testLine7ax() { |
| 217 | SkPath path; |
| 218 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 219 | path.moveTo(0,0); |
| 220 | path.lineTo(4,0); |
| 221 | path.lineTo(2,2); |
| 222 | path.close(); |
| 223 | testSimplifyx(path); |
| 224 | } |
| 225 | |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 226 | static void testLine7b() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 227 | SkPath path; |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 228 | path.moveTo(0,0); |
| 229 | path.lineTo(4,0); |
| 230 | path.close(); |
| 231 | path.moveTo(6,0); |
| 232 | path.lineTo(2,0); |
| 233 | path.lineTo(4,2); |
| 234 | path.close(); |
| 235 | testSimplifyx(path); |
| 236 | } |
| 237 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 238 | static void testLine7bx() { |
| 239 | SkPath path; |
| 240 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 241 | path.moveTo(0,0); |
| 242 | path.lineTo(4,0); |
| 243 | path.close(); |
| 244 | path.moveTo(6,0); |
| 245 | path.lineTo(2,0); |
| 246 | path.lineTo(4,2); |
| 247 | path.close(); |
| 248 | testSimplifyx(path); |
| 249 | } |
| 250 | |
caryclark@google.com | 88f7d0c | 2012-06-07 21:09:20 +0000 | [diff] [blame] | 251 | static void testLine8() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 252 | SkPath path; |
caryclark@google.com | 88f7d0c | 2012-06-07 21:09:20 +0000 | [diff] [blame] | 253 | path.moveTo(0,4); |
| 254 | path.lineTo(4,4); |
| 255 | path.lineTo(2,2); |
| 256 | path.close(); |
| 257 | path.moveTo(2,4); |
| 258 | path.lineTo(6,4); |
| 259 | path.lineTo(4,2); |
| 260 | path.close(); |
| 261 | testSimplifyx(path); |
| 262 | } |
| 263 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 264 | static void testLine8x() { |
| 265 | SkPath path; |
| 266 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 267 | path.moveTo(0,4); |
| 268 | path.lineTo(4,4); |
| 269 | path.lineTo(2,2); |
| 270 | path.close(); |
| 271 | path.moveTo(2,4); |
| 272 | path.lineTo(6,4); |
| 273 | path.lineTo(4,2); |
| 274 | path.close(); |
| 275 | testSimplifyx(path); |
| 276 | } |
| 277 | |
caryclark@google.com | 88f7d0c | 2012-06-07 21:09:20 +0000 | [diff] [blame] | 278 | static void testLine9() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 279 | SkPath path; |
caryclark@google.com | 88f7d0c | 2012-06-07 21:09:20 +0000 | [diff] [blame] | 280 | path.moveTo(0,4); |
| 281 | path.lineTo(4,4); |
| 282 | path.lineTo(2,2); |
| 283 | path.close(); |
| 284 | path.moveTo(6,4); |
| 285 | path.lineTo(2,4); |
| 286 | path.lineTo(4,2); |
| 287 | path.close(); |
| 288 | testSimplifyx(path); |
| 289 | } |
| 290 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 291 | static void testLine9x() { |
| 292 | SkPath path; |
| 293 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 294 | path.moveTo(0,4); |
| 295 | path.lineTo(4,4); |
| 296 | path.lineTo(2,2); |
| 297 | path.close(); |
| 298 | path.moveTo(6,4); |
| 299 | path.lineTo(2,4); |
| 300 | path.lineTo(4,2); |
| 301 | path.close(); |
| 302 | testSimplifyx(path); |
| 303 | } |
| 304 | |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 305 | static void testLine10() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 306 | SkPath path; |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 307 | path.moveTo(0,4); |
| 308 | path.lineTo(4,4); |
| 309 | path.lineTo(2,2); |
| 310 | path.close(); |
| 311 | path.moveTo(2,1); |
| 312 | path.lineTo(3,4); |
| 313 | path.lineTo(6,1); |
| 314 | path.close(); |
| 315 | testSimplifyx(path); |
| 316 | } |
caryclark@google.com | 88f7d0c | 2012-06-07 21:09:20 +0000 | [diff] [blame] | 317 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 318 | static void testLine10x() { |
| 319 | SkPath path; |
| 320 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 321 | path.moveTo(0,4); |
| 322 | path.lineTo(4,4); |
| 323 | path.lineTo(2,2); |
| 324 | path.close(); |
| 325 | path.moveTo(2,1); |
| 326 | path.lineTo(3,4); |
| 327 | path.lineTo(6,1); |
| 328 | path.close(); |
| 329 | testSimplifyx(path); |
| 330 | } |
| 331 | |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 332 | static void testLine10a() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 333 | SkPath path; |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 334 | path.moveTo(0,4); |
| 335 | path.lineTo(8,4); |
| 336 | path.lineTo(4,0); |
| 337 | path.close(); |
| 338 | path.moveTo(2,2); |
| 339 | path.lineTo(3,3); |
| 340 | path.lineTo(4,2); |
| 341 | path.close(); |
| 342 | testSimplifyx(path); |
| 343 | } |
| 344 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 345 | static void testLine10ax() { |
| 346 | SkPath path; |
| 347 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 348 | path.moveTo(0,4); |
| 349 | path.lineTo(8,4); |
| 350 | path.lineTo(4,0); |
| 351 | path.close(); |
| 352 | path.moveTo(2,2); |
| 353 | path.lineTo(3,3); |
| 354 | path.lineTo(4,2); |
| 355 | path.close(); |
| 356 | testSimplifyx(path); |
| 357 | } |
| 358 | |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 359 | static void addCWContainer(SkPath& path) { |
| 360 | path.moveTo(6,4); |
| 361 | path.lineTo(0,4); |
| 362 | path.lineTo(3,1); |
| 363 | path.close(); |
| 364 | } |
| 365 | |
| 366 | static void addCCWContainer(SkPath& path) { |
| 367 | path.moveTo(0,4); |
| 368 | path.lineTo(6,4); |
| 369 | path.lineTo(3,1); |
| 370 | path.close(); |
| 371 | } |
| 372 | |
| 373 | static void addCWContents(SkPath& path) { |
| 374 | path.moveTo(2,3); |
| 375 | path.lineTo(3,2); |
| 376 | path.lineTo(4,3); |
| 377 | path.close(); |
| 378 | } |
| 379 | |
| 380 | static void addCCWContents(SkPath& path) { |
| 381 | path.moveTo(3,2); |
| 382 | path.lineTo(2,3); |
| 383 | path.lineTo(4,3); |
| 384 | path.close(); |
| 385 | } |
| 386 | |
| 387 | static void testLine11() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 388 | SkPath path; |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 389 | addCWContainer(path); |
| 390 | addCWContents(path); |
| 391 | testSimplifyx(path); |
| 392 | } |
| 393 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 394 | static void testLine11x() { |
| 395 | SkPath path; |
| 396 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 397 | addCWContainer(path); |
| 398 | addCWContents(path); |
| 399 | testSimplifyx(path); |
| 400 | } |
| 401 | |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 402 | static void testLine12() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 403 | SkPath path; |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 404 | addCCWContainer(path); |
| 405 | addCWContents(path); |
| 406 | testSimplifyx(path); |
| 407 | } |
| 408 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 409 | static void testLine12x() { |
| 410 | SkPath path; |
| 411 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 412 | addCCWContainer(path); |
| 413 | addCWContents(path); |
| 414 | testSimplifyx(path); |
| 415 | } |
| 416 | |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 417 | static void testLine13() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 418 | SkPath path; |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 419 | addCWContainer(path); |
| 420 | addCCWContents(path); |
| 421 | testSimplifyx(path); |
| 422 | } |
| 423 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 424 | static void testLine13x() { |
| 425 | SkPath path; |
| 426 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 427 | addCWContainer(path); |
| 428 | addCCWContents(path); |
| 429 | testSimplifyx(path); |
| 430 | } |
| 431 | |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 432 | static void testLine14() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 433 | SkPath path; |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 434 | addCCWContainer(path); |
| 435 | addCCWContents(path); |
| 436 | testSimplifyx(path); |
| 437 | } |
| 438 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 439 | static void testLine14x() { |
| 440 | SkPath path; |
| 441 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 442 | addCCWContainer(path); |
| 443 | addCCWContents(path); |
| 444 | testSimplifyx(path); |
| 445 | } |
| 446 | |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 447 | static void testLine15() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 448 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 449 | path.addRect(0, 0, 9, 9, SkPath::kCW_Direction); |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 450 | testSimplifyx(path); |
| 451 | } |
| 452 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 453 | static void testLine15x() { |
| 454 | SkPath path; |
| 455 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 456 | path.addRect(0, 0, 9, 9, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 457 | testSimplifyx(path); |
| 458 | } |
| 459 | |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 460 | static void testLine16() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 461 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 462 | path.addRect(0, 0, 12, 12, SkPath::kCW_Direction); |
| 463 | path.addRect(0, 4, 9, 9, SkPath::kCW_Direction); |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 464 | testSimplifyx(path); |
| 465 | } |
| 466 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 467 | static void testLine16x() { |
| 468 | SkPath path; |
| 469 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 470 | path.addRect(0, 0, 12, 12, SkPath::kCW_Direction); |
| 471 | path.addRect(0, 4, 9, 9, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 472 | testSimplifyx(path); |
| 473 | } |
| 474 | |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 475 | static void testLine17() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 476 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 477 | path.addRect(0, 0, 12, 12, SkPath::kCW_Direction); |
| 478 | path.addRect(4, 12, 13, 13, SkPath::kCW_Direction); |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 479 | testSimplifyx(path); |
| 480 | } |
| 481 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 482 | static void testLine17x() { |
| 483 | SkPath path; |
| 484 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 485 | path.addRect(0, 0, 12, 12, SkPath::kCW_Direction); |
| 486 | path.addRect(4, 12, 13, 13, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 487 | testSimplifyx(path); |
| 488 | } |
| 489 | |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 490 | static void testLine18() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 491 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 492 | path.addRect(0, 0, 12, 12, SkPath::kCW_Direction); |
| 493 | path.addRect(12, 4, 21, 21, SkPath::kCW_Direction); |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 494 | testSimplifyx(path); |
| 495 | } |
| 496 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 497 | static void testLine18x() { |
| 498 | SkPath path; |
| 499 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 500 | path.addRect(0, 0, 12, 12, SkPath::kCW_Direction); |
| 501 | path.addRect(12, 4, 21, 21, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 502 | testSimplifyx(path); |
| 503 | } |
| 504 | |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 505 | static void testLine19() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 506 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 507 | path.addRect(0, 0, 12, 12, SkPath::kCW_Direction); |
| 508 | path.addRect(12, 16, 21, 21, SkPath::kCW_Direction); |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 509 | testSimplifyx(path); |
| 510 | } |
| 511 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 512 | static void testLine19x() { |
| 513 | SkPath path; |
| 514 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 515 | path.addRect(0, 0, 12, 12, SkPath::kCW_Direction); |
| 516 | path.addRect(12, 16, 21, 21, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 517 | testSimplifyx(path); |
| 518 | } |
| 519 | |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 520 | static void testLine20() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 521 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 522 | path.addRect(0, 12, 12, 12, SkPath::kCW_Direction); |
| 523 | path.addRect(0, 12, 9, 9, SkPath::kCW_Direction); |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 524 | testSimplifyx(path); |
| 525 | } |
| 526 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 527 | static void testLine20x() { |
| 528 | SkPath path; |
| 529 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 530 | path.addRect(0, 12, 12, 12, SkPath::kCW_Direction); |
| 531 | path.addRect(0, 12, 9, 9, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 532 | testSimplifyx(path); |
| 533 | } |
| 534 | |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 535 | static void testLine21() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 536 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 537 | path.addRect(0, 12, 12, 12, SkPath::kCW_Direction); |
| 538 | path.addRect(0, 16, 9, 9, SkPath::kCW_Direction); |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 539 | testSimplifyx(path); |
| 540 | } |
| 541 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 542 | static void testLine21x() { |
| 543 | SkPath path; |
| 544 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 545 | path.addRect(0, 12, 12, 12, SkPath::kCW_Direction); |
| 546 | path.addRect(0, 16, 9, 9, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 547 | testSimplifyx(path); |
| 548 | } |
| 549 | |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 550 | static void testLine22() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 551 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 552 | path.addRect(0, 12, 12, 12, SkPath::kCW_Direction); |
| 553 | path.addRect(4, 12, 13, 13, SkPath::kCW_Direction); |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 554 | testSimplifyx(path); |
| 555 | } |
| 556 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 557 | static void testLine22x() { |
| 558 | SkPath path; |
| 559 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 560 | path.addRect(0, 12, 12, 12, SkPath::kCW_Direction); |
| 561 | path.addRect(4, 12, 13, 13, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 562 | testSimplifyx(path); |
| 563 | } |
| 564 | |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 565 | static void testLine23() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 566 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 567 | path.addRect(0, 12, 12, 12, SkPath::kCW_Direction); |
| 568 | path.addRect(12, 0, 21, 21, SkPath::kCW_Direction); |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 569 | testSimplifyx(path); |
| 570 | } |
| 571 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 572 | static void testLine23x() { |
| 573 | SkPath path; |
| 574 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 575 | path.addRect(0, 12, 12, 12, SkPath::kCW_Direction); |
| 576 | path.addRect(12, 0, 21, 21, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 577 | testSimplifyx(path); |
| 578 | } |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 579 | |
| 580 | static void testLine24a() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 581 | SkPath path; |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 582 | path.moveTo(2,0); |
| 583 | path.lineTo(4,4); |
| 584 | path.lineTo(0,4); |
| 585 | path.close(); |
| 586 | path.moveTo(2,0); |
| 587 | path.lineTo(1,2); |
| 588 | path.lineTo(2,2); |
| 589 | path.close(); |
| 590 | testSimplifyx(path); |
| 591 | } |
| 592 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 593 | static void testLine24ax() { |
| 594 | SkPath path; |
| 595 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 596 | path.moveTo(2,0); |
| 597 | path.lineTo(4,4); |
| 598 | path.lineTo(0,4); |
| 599 | path.close(); |
| 600 | path.moveTo(2,0); |
| 601 | path.lineTo(1,2); |
| 602 | path.lineTo(2,2); |
| 603 | path.close(); |
| 604 | testSimplifyx(path); |
| 605 | } |
| 606 | |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 607 | static void testLine24() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 608 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 609 | path.addRect(0, 18, 12, 12, SkPath::kCW_Direction); |
| 610 | path.addRect(4, 12, 13, 13, SkPath::kCW_Direction); |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 611 | testSimplifyx(path); |
| 612 | } |
| 613 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 614 | static void testLine24x() { |
| 615 | SkPath path; |
| 616 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 617 | path.addRect(0, 18, 12, 12, SkPath::kCW_Direction); |
| 618 | path.addRect(4, 12, 13, 13, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 619 | testSimplifyx(path); |
| 620 | } |
| 621 | |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 622 | static void testLine25() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 623 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 624 | path.addRect(0, 6, 12, 12, SkPath::kCW_Direction); |
| 625 | path.addRect(12, 0, 21, 21, SkPath::kCW_Direction); |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 626 | testSimplifyx(path); |
| 627 | } |
| 628 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 629 | static void testLine25x() { |
| 630 | SkPath path; |
| 631 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 632 | path.addRect(0, 6, 12, 12, SkPath::kCW_Direction); |
| 633 | path.addRect(12, 0, 21, 21, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 634 | testSimplifyx(path); |
| 635 | } |
| 636 | |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 637 | static void testLine26() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 638 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 639 | path.addRect(0, 18, 12, 12, SkPath::kCW_Direction); |
| 640 | path.addRect(0, 12, 9, 9, SkPath::kCW_Direction); |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 641 | testSimplifyx(path); |
| 642 | } |
| 643 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 644 | static void testLine26x() { |
| 645 | SkPath path; |
| 646 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 647 | path.addRect(0, 18, 12, 12, SkPath::kCW_Direction); |
| 648 | path.addRect(0, 12, 9, 9, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 649 | testSimplifyx(path); |
| 650 | } |
| 651 | |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 652 | static void testLine27() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 653 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 654 | path.addRect(0, 18, 12, 12, SkPath::kCW_Direction); |
| 655 | path.addRect(12, 8, 21, 21, SkPath::kCW_Direction); |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 656 | testSimplifyx(path); |
| 657 | } |
| 658 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 659 | static void testLine27x() { |
| 660 | SkPath path; |
| 661 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 662 | path.addRect(0, 18, 12, 12, SkPath::kCW_Direction); |
| 663 | path.addRect(12, 8, 21, 21, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 664 | testSimplifyx(path); |
| 665 | } |
| 666 | |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 667 | static void testLine28() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 668 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 669 | path.addRect(0, 6, 12, 12, SkPath::kCW_Direction); |
| 670 | path.addRect(0, 0, 9, 9, SkPath::kCW_Direction); |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 671 | testSimplifyx(path); |
| 672 | } |
| 673 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 674 | static void testLine28x() { |
| 675 | SkPath path; |
| 676 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 677 | path.addRect(0, 6, 12, 12, SkPath::kCW_Direction); |
| 678 | path.addRect(0, 0, 9, 9, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 679 | testSimplifyx(path); |
| 680 | } |
| 681 | |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 682 | static void testLine29() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 683 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 684 | path.addRect(0, 18, 12, 12, SkPath::kCW_Direction); |
| 685 | path.addRect(12, 12, 21, 21, SkPath::kCW_Direction); |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 686 | testSimplifyx(path); |
| 687 | } |
| 688 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 689 | static void testLine29x() { |
| 690 | SkPath path; |
| 691 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 692 | path.addRect(0, 18, 12, 12, SkPath::kCW_Direction); |
| 693 | path.addRect(12, 12, 21, 21, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 694 | testSimplifyx(path); |
| 695 | } |
| 696 | |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 697 | static void testLine30() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 698 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 699 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 700 | path.addRect(0, 0, 12, 12, SkPath::kCW_Direction); |
| 701 | path.addRect(4, 4, 13, 13, SkPath::kCW_Direction); |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 702 | testSimplifyx(path); |
| 703 | } |
| 704 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 705 | static void testLine30x() { |
| 706 | SkPath path; |
| 707 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 708 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 709 | path.addRect(0, 0, 12, 12, SkPath::kCW_Direction); |
| 710 | path.addRect(4, 4, 13, 13, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 711 | testSimplifyx(path); |
| 712 | } |
| 713 | |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 714 | static void testLine31() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 715 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 716 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 717 | path.addRect(0, 0, 12, 12, SkPath::kCW_Direction); |
| 718 | path.addRect(0, 4, 9, 9, SkPath::kCW_Direction); |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 719 | testSimplifyx(path); |
| 720 | } |
| 721 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 722 | static void testLine31x() { |
| 723 | SkPath path; |
| 724 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 725 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 726 | path.addRect(0, 0, 12, 12, SkPath::kCW_Direction); |
| 727 | path.addRect(0, 4, 9, 9, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 728 | testSimplifyx(path); |
| 729 | } |
| 730 | |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 731 | static void testLine32() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 732 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 733 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 734 | path.addRect(0, 0, 12, 12, SkPath::kCW_Direction); |
| 735 | path.addRect(4, 12, 13, 13, SkPath::kCW_Direction); |
caryclark@google.com | fa4a6e9 | 2012-07-11 17:52:32 +0000 | [diff] [blame] | 736 | testSimplifyx(path); |
| 737 | } |
| 738 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 739 | static void testLine32x() { |
| 740 | SkPath path; |
| 741 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 742 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 743 | path.addRect(0, 0, 12, 12, SkPath::kCW_Direction); |
| 744 | path.addRect(4, 12, 13, 13, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 745 | testSimplifyx(path); |
| 746 | } |
| 747 | |
caryclark@google.com | 210acaf | 2012-07-12 21:05:13 +0000 | [diff] [blame] | 748 | static void testLine33() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 749 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 750 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 751 | path.addRect(0, 0, 12, 12, SkPath::kCW_Direction); |
| 752 | path.addRect(4, 16, 13, 13, SkPath::kCW_Direction); |
caryclark@google.com | 210acaf | 2012-07-12 21:05:13 +0000 | [diff] [blame] | 753 | testSimplifyx(path); |
| 754 | } |
| 755 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 756 | static void testLine33x() { |
| 757 | SkPath path; |
| 758 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 759 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 760 | path.addRect(0, 0, 12, 12, SkPath::kCW_Direction); |
| 761 | path.addRect(4, 16, 13, 13, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 762 | testSimplifyx(path); |
| 763 | } |
| 764 | |
caryclark@google.com | 210acaf | 2012-07-12 21:05:13 +0000 | [diff] [blame] | 765 | static void testLine34() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 766 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 767 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 768 | path.addRect(0, 6, 12, 12, SkPath::kCW_Direction); |
| 769 | path.addRect(4, 12, 13, 13, SkPath::kCW_Direction); |
caryclark@google.com | 210acaf | 2012-07-12 21:05:13 +0000 | [diff] [blame] | 770 | testSimplifyx(path); |
| 771 | } |
| 772 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 773 | static void testLine34x() { |
| 774 | SkPath path; |
| 775 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 776 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 777 | path.addRect(0, 6, 12, 12, SkPath::kCW_Direction); |
| 778 | path.addRect(4, 12, 13, 13, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 779 | testSimplifyx(path); |
| 780 | } |
| 781 | |
caryclark@google.com | 210acaf | 2012-07-12 21:05:13 +0000 | [diff] [blame] | 782 | static void testLine35() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 783 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 784 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 785 | path.addRect(6, 0, 18, 18, SkPath::kCW_Direction); |
| 786 | path.addRect(4, 16, 13, 13, SkPath::kCW_Direction); |
caryclark@google.com | 210acaf | 2012-07-12 21:05:13 +0000 | [diff] [blame] | 787 | testSimplifyx(path); |
| 788 | } |
| 789 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 790 | static void testLine35x() { |
| 791 | SkPath path; |
| 792 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 793 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 794 | path.addRect(6, 0, 18, 18, SkPath::kCW_Direction); |
| 795 | path.addRect(4, 16, 13, 13, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 796 | testSimplifyx(path); |
| 797 | } |
| 798 | |
caryclark@google.com | 0e08a19 | 2012-07-13 21:07:52 +0000 | [diff] [blame] | 799 | static void testLine36() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 800 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 801 | path.addRect(0, 10, 20, 20, SkPath::kCW_Direction); |
| 802 | path.addRect(6, 12, 18, 18, SkPath::kCW_Direction); |
| 803 | path.addRect(4, 16, 13, 13, SkPath::kCW_Direction); |
caryclark@google.com | 0e08a19 | 2012-07-13 21:07:52 +0000 | [diff] [blame] | 804 | testSimplifyx(path); |
| 805 | } |
| 806 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 807 | static void testLine36x() { |
| 808 | SkPath path; |
| 809 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 810 | path.addRect(0, 10, 20, 20, SkPath::kCW_Direction); |
| 811 | path.addRect(6, 12, 18, 18, SkPath::kCW_Direction); |
| 812 | path.addRect(4, 16, 13, 13, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 813 | testSimplifyx(path); |
| 814 | } |
| 815 | |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 816 | static void testLine37() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 817 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 818 | path.addRect(0, 20, 20, 20, SkPath::kCW_Direction); |
| 819 | path.addRect(18, 24, 30, 30, SkPath::kCW_Direction); |
| 820 | path.addRect(0, 0, 9, 9, SkPath::kCW_Direction); |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 821 | testSimplifyx(path); |
| 822 | } |
| 823 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 824 | static void testLine37x() { |
| 825 | SkPath path; |
| 826 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 827 | path.addRect(0, 20, 20, 20, SkPath::kCW_Direction); |
| 828 | path.addRect(18, 24, 30, 30, SkPath::kCW_Direction); |
| 829 | path.addRect(0, 0, 9, 9, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 830 | testSimplifyx(path); |
| 831 | } |
| 832 | |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 833 | static void testLine38() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 834 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 835 | path.addRect(10, 0, 30, 30, SkPath::kCW_Direction); |
| 836 | path.addRect(6, 12, 18, 18, SkPath::kCW_Direction); |
| 837 | path.addRect(12, 12, 21, 21, SkPath::kCW_Direction); |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 838 | testSimplifyx(path); |
| 839 | } |
| 840 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 841 | static void testLine38x() { |
| 842 | SkPath path; |
| 843 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 844 | path.addRect(10, 0, 30, 30, SkPath::kCW_Direction); |
| 845 | path.addRect(6, 12, 18, 18, SkPath::kCW_Direction); |
| 846 | path.addRect(12, 12, 21, 21, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 847 | testSimplifyx(path); |
| 848 | } |
| 849 | |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 850 | static void testLine40() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 851 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 852 | path.addRect(10, 0, 30, 30, SkPath::kCW_Direction); |
| 853 | path.addRect(12, 18, 24, 24, SkPath::kCW_Direction); |
| 854 | path.addRect(4, 16, 13, 13, SkPath::kCW_Direction); |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 855 | testSimplifyx(path); |
| 856 | } |
| 857 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 858 | static void testLine40x() { |
| 859 | SkPath path; |
| 860 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 861 | path.addRect(10, 0, 30, 30, SkPath::kCW_Direction); |
| 862 | path.addRect(12, 18, 24, 24, SkPath::kCW_Direction); |
| 863 | path.addRect(4, 16, 13, 13, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 864 | testSimplifyx(path); |
| 865 | } |
| 866 | |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 867 | static void testLine41() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 868 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 869 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 870 | path.addRect(18, 24, 30, 30, SkPath::kCW_Direction); |
| 871 | path.addRect(12, 0, 21, 21, SkPath::kCW_Direction); |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 872 | testSimplifyx(path); |
| 873 | } |
| 874 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 875 | static void testLine41x() { |
| 876 | SkPath path; |
| 877 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 878 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 879 | path.addRect(18, 24, 30, 30, SkPath::kCW_Direction); |
| 880 | path.addRect(12, 0, 21, 21, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 881 | testSimplifyx(path); |
| 882 | } |
| 883 | |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 884 | static void testLine42() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 885 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 886 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 887 | path.addRect(0, 0, 12, 12, SkPath::kCW_Direction); |
| 888 | path.addRect(8, 16, 17, 17, SkPath::kCW_Direction); |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 889 | testSimplifyx(path); |
| 890 | } |
| 891 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 892 | static void testLine42x() { |
| 893 | SkPath path; |
| 894 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 895 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 896 | path.addRect(0, 0, 12, 12, SkPath::kCW_Direction); |
| 897 | path.addRect(8, 16, 17, 17, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 898 | testSimplifyx(path); |
| 899 | } |
| 900 | |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 901 | static void testLine43() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 902 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 903 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 904 | path.addRect(6, 24, 18, 18, SkPath::kCW_Direction); |
| 905 | path.addRect(0, 32, 9, 36, SkPath::kCCW_Direction); |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 906 | testSimplifyx(path); |
| 907 | } |
| 908 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 909 | static void testLine43x() { |
| 910 | SkPath path; |
| 911 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 912 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 913 | path.addRect(6, 24, 18, 18, SkPath::kCW_Direction); |
| 914 | path.addRect(0, 32, 9, 36, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 915 | testSimplifyx(path); |
| 916 | } |
| 917 | |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 918 | static void testLine44() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 919 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 920 | path.addRect(10, 40, 30, 30, SkPath::kCW_Direction); |
| 921 | path.addRect(18, 0, 30, 30, SkPath::kCW_Direction); |
| 922 | path.addRect(18, 32, 27, 36, SkPath::kCCW_Direction); |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 923 | testSimplifyx(path); |
| 924 | } |
| 925 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 926 | static void testLine44x() { |
| 927 | SkPath path; |
| 928 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 929 | path.addRect(10, 40, 30, 30, SkPath::kCW_Direction); |
| 930 | path.addRect(18, 0, 30, 30, SkPath::kCW_Direction); |
| 931 | path.addRect(18, 32, 27, 36, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 932 | testSimplifyx(path); |
| 933 | } |
| 934 | |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 935 | static void testLine45() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 936 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 937 | path.addRect(10, 0, 30, 30, SkPath::kCW_Direction); |
| 938 | path.addRect(18, 0, 30, 30, SkPath::kCW_Direction); |
| 939 | path.addRect(24, 32, 33, 36, SkPath::kCW_Direction); |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 940 | testSimplifyx(path); |
| 941 | } |
| 942 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 943 | static void testLine45x() { |
| 944 | SkPath path; |
| 945 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 946 | path.addRect(10, 0, 30, 30, SkPath::kCW_Direction); |
| 947 | path.addRect(18, 0, 30, 30, SkPath::kCW_Direction); |
| 948 | path.addRect(24, 32, 33, 36, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 949 | testSimplifyx(path); |
| 950 | } |
| 951 | |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 952 | static void testLine46() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 953 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 954 | path.addRect(10, 40, 30, 30, SkPath::kCW_Direction); |
| 955 | path.addRect(24, 0, 36, 36, SkPath::kCW_Direction); |
| 956 | path.addRect(24, 32, 33, 36, SkPath::kCW_Direction); |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 957 | testSimplifyx(path); |
| 958 | } |
| 959 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 960 | static void testLine46x() { |
| 961 | SkPath path; |
| 962 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 963 | path.addRect(10, 40, 30, 30, SkPath::kCW_Direction); |
| 964 | path.addRect(24, 0, 36, 36, SkPath::kCW_Direction); |
| 965 | path.addRect(24, 32, 33, 36, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 966 | testSimplifyx(path); |
| 967 | } |
| 968 | |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 969 | static void testLine47() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 970 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 971 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 972 | path.addRect(0, 0, 12, 12, SkPath::kCW_Direction); |
| 973 | path.addRect(0, 0, 9, 9, SkPath::kCCW_Direction); |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 974 | testSimplifyx(path); |
| 975 | } |
| 976 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 977 | static void testLine47x() { |
| 978 | SkPath path; |
| 979 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 980 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 981 | path.addRect(0, 0, 12, 12, SkPath::kCW_Direction); |
| 982 | path.addRect(0, 0, 9, 9, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 983 | testSimplifyx(path); |
| 984 | } |
| 985 | |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 986 | static void testLine48() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 987 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 988 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 989 | path.addRect(0, 6, 12, 12, SkPath::kCW_Direction); |
| 990 | path.addRect(0, 0, 9, 9, SkPath::kCCW_Direction); |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 991 | testSimplifyx(path); |
| 992 | } |
| 993 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 994 | static void testLine48x() { |
| 995 | SkPath path; |
| 996 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 997 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 998 | path.addRect(0, 6, 12, 12, SkPath::kCW_Direction); |
| 999 | path.addRect(0, 0, 9, 9, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1000 | testSimplifyx(path); |
| 1001 | } |
| 1002 | |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 1003 | static void testLine49() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1004 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1005 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 1006 | path.addRect(0, 0, 12, 12, SkPath::kCW_Direction); |
| 1007 | path.addRect(0, 0, 9, 9, SkPath::kCW_Direction); |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 1008 | testSimplifyx(path); |
| 1009 | } |
| 1010 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1011 | static void testLine49x() { |
| 1012 | SkPath path; |
| 1013 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1014 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 1015 | path.addRect(0, 0, 12, 12, SkPath::kCW_Direction); |
| 1016 | path.addRect(0, 0, 9, 9, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1017 | testSimplifyx(path); |
| 1018 | } |
| 1019 | |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 1020 | static void testLine50() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1021 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1022 | path.addRect(10, 30, 30, 30, SkPath::kCW_Direction); |
| 1023 | path.addRect(24, 20, 36, 30, SkPath::kCW_Direction); |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 1024 | testSimplifyx(path); |
| 1025 | } |
| 1026 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1027 | static void testLine50x() { |
| 1028 | SkPath path; |
| 1029 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1030 | path.addRect(10, 30, 30, 30, SkPath::kCW_Direction); |
| 1031 | path.addRect(24, 20, 36, 30, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1032 | testSimplifyx(path); |
| 1033 | } |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 1034 | |
| 1035 | static void testLine51() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1036 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1037 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 1038 | path.addRect(0, 12, 12, 12, SkPath::kCW_Direction); |
| 1039 | path.addRect(4, 12, 13, 13, SkPath::kCCW_Direction); |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 1040 | testSimplifyx(path); |
| 1041 | } |
| 1042 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1043 | static void testLine51x() { |
| 1044 | SkPath path; |
| 1045 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1046 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 1047 | path.addRect(0, 12, 12, 12, SkPath::kCW_Direction); |
| 1048 | path.addRect(4, 12, 13, 13, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1049 | testSimplifyx(path); |
| 1050 | } |
| 1051 | |
caryclark@google.com | e21cb18 | 2012-07-23 21:26:31 +0000 | [diff] [blame] | 1052 | static void testLine52() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1053 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1054 | path.addRect(0, 30, 20, 20, SkPath::kCW_Direction); |
| 1055 | path.addRect(6, 20, 18, 30, SkPath::kCW_Direction); |
| 1056 | path.addRect(32, 0, 36, 41, SkPath::kCW_Direction); |
caryclark@google.com | e21cb18 | 2012-07-23 21:26:31 +0000 | [diff] [blame] | 1057 | testSimplifyx(path); |
| 1058 | } |
| 1059 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1060 | static void testLine52x() { |
| 1061 | SkPath path; |
| 1062 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1063 | path.addRect(0, 30, 20, 20, SkPath::kCW_Direction); |
| 1064 | path.addRect(6, 20, 18, 30, SkPath::kCW_Direction); |
| 1065 | path.addRect(32, 0, 36, 41, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1066 | testSimplifyx(path); |
| 1067 | } |
| 1068 | |
caryclark@google.com | e21cb18 | 2012-07-23 21:26:31 +0000 | [diff] [blame] | 1069 | static void testLine53() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1070 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1071 | path.addRect(10, 30, 30, 30, SkPath::kCW_Direction); |
| 1072 | path.addRect(12, 20, 24, 30, SkPath::kCW_Direction); |
| 1073 | path.addRect(12, 32, 21, 36, SkPath::kCCW_Direction); |
caryclark@google.com | e21cb18 | 2012-07-23 21:26:31 +0000 | [diff] [blame] | 1074 | testSimplifyx(path); |
| 1075 | } |
| 1076 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1077 | static void testLine53x() { |
| 1078 | SkPath path; |
| 1079 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1080 | path.addRect(10, 30, 30, 30, SkPath::kCW_Direction); |
| 1081 | path.addRect(12, 20, 24, 30, SkPath::kCW_Direction); |
| 1082 | path.addRect(12, 32, 21, 36, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1083 | testSimplifyx(path); |
| 1084 | } |
| 1085 | |
caryclark@google.com | e21cb18 | 2012-07-23 21:26:31 +0000 | [diff] [blame] | 1086 | static void testLine54() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1087 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1088 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 1089 | path.addRect(6, 0, 18, 18, SkPath::kCW_Direction); |
| 1090 | path.addRect(8, 4, 17, 17, SkPath::kCCW_Direction); |
caryclark@google.com | e21cb18 | 2012-07-23 21:26:31 +0000 | [diff] [blame] | 1091 | testSimplifyx(path); |
| 1092 | } |
| 1093 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1094 | static void testLine54x() { |
| 1095 | SkPath path; |
| 1096 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1097 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 1098 | path.addRect(6, 0, 18, 18, SkPath::kCW_Direction); |
| 1099 | path.addRect(8, 4, 17, 17, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1100 | testSimplifyx(path); |
| 1101 | } |
| 1102 | |
caryclark@google.com | e21cb18 | 2012-07-23 21:26:31 +0000 | [diff] [blame] | 1103 | static void testLine55() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1104 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1105 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 1106 | path.addRect(6, 6, 18, 18, SkPath::kCW_Direction); |
| 1107 | path.addRect(4, 4, 13, 13, SkPath::kCCW_Direction); |
caryclark@google.com | e21cb18 | 2012-07-23 21:26:31 +0000 | [diff] [blame] | 1108 | testSimplifyx(path); |
| 1109 | } |
| 1110 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1111 | static void testLine55x() { |
| 1112 | SkPath path; |
| 1113 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1114 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 1115 | path.addRect(6, 6, 18, 18, SkPath::kCW_Direction); |
| 1116 | path.addRect(4, 4, 13, 13, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1117 | testSimplifyx(path); |
| 1118 | } |
| 1119 | |
caryclark@google.com | 1806344 | 2012-07-25 12:05:18 +0000 | [diff] [blame] | 1120 | static void testLine56() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1121 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1122 | path.addRect(0, 20, 20, 20, SkPath::kCW_Direction); |
| 1123 | path.addRect(18, 20, 30, 30, SkPath::kCW_Direction); |
| 1124 | path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction); |
caryclark@google.com | 1806344 | 2012-07-25 12:05:18 +0000 | [diff] [blame] | 1125 | testSimplifyx(path); |
| 1126 | } |
| 1127 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1128 | static void testLine56x() { |
| 1129 | SkPath path; |
| 1130 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1131 | path.addRect(0, 20, 20, 20, SkPath::kCW_Direction); |
| 1132 | path.addRect(18, 20, 30, 30, SkPath::kCW_Direction); |
| 1133 | path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1134 | testSimplifyx(path); |
| 1135 | } |
| 1136 | |
caryclark@google.com | 1806344 | 2012-07-25 12:05:18 +0000 | [diff] [blame] | 1137 | static void testLine57() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1138 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1139 | path.addRect(20, 0, 40, 40, SkPath::kCW_Direction); |
| 1140 | path.addRect(20, 0, 30, 40, SkPath::kCW_Direction); |
| 1141 | path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction); |
caryclark@google.com | 1806344 | 2012-07-25 12:05:18 +0000 | [diff] [blame] | 1142 | testSimplifyx(path); |
| 1143 | } |
| 1144 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1145 | static void testLine57x() { |
| 1146 | SkPath path; |
| 1147 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1148 | path.addRect(20, 0, 40, 40, SkPath::kCW_Direction); |
| 1149 | path.addRect(20, 0, 30, 40, SkPath::kCW_Direction); |
| 1150 | path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1151 | testSimplifyx(path); |
| 1152 | } |
| 1153 | |
caryclark@google.com | cc90505 | 2012-07-25 20:59:42 +0000 | [diff] [blame] | 1154 | static void testLine58() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1155 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1156 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 1157 | path.addRect(0, 0, 12, 12, SkPath::kCCW_Direction); |
| 1158 | path.addRect(0, 12, 9, 9, SkPath::kCCW_Direction); |
caryclark@google.com | cc90505 | 2012-07-25 20:59:42 +0000 | [diff] [blame] | 1159 | testSimplifyx(path); |
| 1160 | } |
| 1161 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1162 | static void testLine58x() { |
| 1163 | SkPath path; |
| 1164 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1165 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 1166 | path.addRect(0, 0, 12, 12, SkPath::kCCW_Direction); |
| 1167 | path.addRect(0, 12, 9, 9, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1168 | testSimplifyx(path); |
| 1169 | } |
| 1170 | |
caryclark@google.com | cc90505 | 2012-07-25 20:59:42 +0000 | [diff] [blame] | 1171 | static void testLine59() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1172 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1173 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 1174 | path.addRect(6, 6, 18, 18, SkPath::kCCW_Direction); |
| 1175 | path.addRect(4, 4, 13, 13, SkPath::kCCW_Direction); |
caryclark@google.com | cc90505 | 2012-07-25 20:59:42 +0000 | [diff] [blame] | 1176 | testSimplifyx(path); |
| 1177 | } |
| 1178 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1179 | static void testLine59x() { |
| 1180 | SkPath path; |
| 1181 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1182 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 1183 | path.addRect(6, 6, 18, 18, SkPath::kCCW_Direction); |
| 1184 | path.addRect(4, 4, 13, 13, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1185 | testSimplifyx(path); |
| 1186 | } |
| 1187 | |
caryclark@google.com | 27c449a | 2012-07-27 18:26:38 +0000 | [diff] [blame] | 1188 | static void testLine60() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1189 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1190 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 1191 | path.addRect(6, 12, 18, 18, SkPath::kCCW_Direction); |
| 1192 | path.addRect(4, 12, 13, 13, SkPath::kCCW_Direction); |
caryclark@google.com | 27c449a | 2012-07-27 18:26:38 +0000 | [diff] [blame] | 1193 | testSimplifyx(path); |
| 1194 | } |
| 1195 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1196 | static void testLine60x() { |
| 1197 | SkPath path; |
| 1198 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1199 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 1200 | path.addRect(6, 12, 18, 18, SkPath::kCCW_Direction); |
| 1201 | path.addRect(4, 12, 13, 13, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1202 | testSimplifyx(path); |
| 1203 | } |
| 1204 | |
caryclark@google.com | 27c449a | 2012-07-27 18:26:38 +0000 | [diff] [blame] | 1205 | static void testLine61() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1206 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1207 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 1208 | path.addRect(12, 0, 24, 24, SkPath::kCCW_Direction); |
| 1209 | path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction); |
caryclark@google.com | 27c449a | 2012-07-27 18:26:38 +0000 | [diff] [blame] | 1210 | testSimplifyx(path); |
| 1211 | } |
| 1212 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1213 | static void testLine61x() { |
| 1214 | SkPath path; |
| 1215 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1216 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 1217 | path.addRect(12, 0, 24, 24, SkPath::kCCW_Direction); |
| 1218 | path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1219 | testSimplifyx(path); |
| 1220 | } |
| 1221 | |
caryclark@google.com | 27c449a | 2012-07-27 18:26:38 +0000 | [diff] [blame] | 1222 | static void testLine62() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1223 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1224 | path.addRect(0, 0, 60, 60, SkPath::kCW_Direction); |
| 1225 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 1226 | path.addRect(0, 12, 12, 12, SkPath::kCW_Direction); |
| 1227 | path.addRect(4, 12, 13, 13, SkPath::kCCW_Direction); |
caryclark@google.com | 27c449a | 2012-07-27 18:26:38 +0000 | [diff] [blame] | 1228 | testSimplifyx(path); |
| 1229 | } |
| 1230 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1231 | static void testLine62x() { |
| 1232 | SkPath path; |
| 1233 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1234 | path.addRect(0, 0, 60, 60, SkPath::kCW_Direction); |
| 1235 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 1236 | path.addRect(0, 12, 12, 12, SkPath::kCW_Direction); |
| 1237 | path.addRect(4, 12, 13, 13, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1238 | testSimplifyx(path); |
| 1239 | } |
| 1240 | |
caryclark@google.com | 27c449a | 2012-07-27 18:26:38 +0000 | [diff] [blame] | 1241 | static void testLine63() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1242 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1243 | path.addRect(0, 0, 60, 60, SkPath::kCW_Direction); |
| 1244 | path.addRect(0, 10, 20, 20, SkPath::kCW_Direction); |
| 1245 | path.addRect(0, 6, 12, 12, SkPath::kCCW_Direction); |
| 1246 | path.addRect(0, 32, 9, 36, SkPath::kCCW_Direction); |
caryclark@google.com | 27c449a | 2012-07-27 18:26:38 +0000 | [diff] [blame] | 1247 | testSimplifyx(path); |
| 1248 | } |
| 1249 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1250 | static void testLine63x() { |
| 1251 | SkPath path; |
| 1252 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1253 | path.addRect(0, 0, 60, 60, SkPath::kCW_Direction); |
| 1254 | path.addRect(0, 10, 20, 20, SkPath::kCW_Direction); |
| 1255 | path.addRect(0, 6, 12, 12, SkPath::kCCW_Direction); |
| 1256 | path.addRect(0, 32, 9, 36, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1257 | testSimplifyx(path); |
| 1258 | } |
| 1259 | |
caryclark@google.com | 27c449a | 2012-07-27 18:26:38 +0000 | [diff] [blame] | 1260 | static void testLine64() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1261 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1262 | path.addRect(0, 0, 60, 60, SkPath::kCW_Direction); |
| 1263 | path.addRect(10, 40, 30, 30, SkPath::kCW_Direction); |
| 1264 | path.addRect(18, 6, 30, 30, SkPath::kCW_Direction); |
caryclark@google.com | 27c449a | 2012-07-27 18:26:38 +0000 | [diff] [blame] | 1265 | testSimplifyx(path); |
| 1266 | } |
| 1267 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1268 | static void testLine64x() { |
| 1269 | SkPath path; |
| 1270 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1271 | path.addRect(0, 0, 60, 60, SkPath::kCW_Direction); |
| 1272 | path.addRect(10, 40, 30, 30, SkPath::kCW_Direction); |
| 1273 | path.addRect(18, 6, 30, 30, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1274 | testSimplifyx(path); |
| 1275 | } |
| 1276 | |
caryclark@google.com | 27c449a | 2012-07-27 18:26:38 +0000 | [diff] [blame] | 1277 | static void testLine65() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1278 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1279 | path.addRect(0, 0, 60, 60, SkPath::kCW_Direction); |
| 1280 | path.addRect(10, 0, 30, 30, SkPath::kCW_Direction); |
| 1281 | path.addRect(24, 0, 36, 36, SkPath::kCW_Direction); |
| 1282 | path.addRect(32, 6, 36, 41, SkPath::kCCW_Direction); |
caryclark@google.com | 27c449a | 2012-07-27 18:26:38 +0000 | [diff] [blame] | 1283 | testSimplifyx(path); |
| 1284 | } |
| 1285 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1286 | static void testLine65x() { |
| 1287 | SkPath path; |
| 1288 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1289 | path.addRect(0, 0, 60, 60, SkPath::kCW_Direction); |
| 1290 | path.addRect(10, 0, 30, 30, SkPath::kCW_Direction); |
| 1291 | path.addRect(24, 0, 36, 36, SkPath::kCW_Direction); |
| 1292 | path.addRect(32, 6, 36, 41, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1293 | testSimplifyx(path); |
| 1294 | } |
| 1295 | |
caryclark@google.com | 27c449a | 2012-07-27 18:26:38 +0000 | [diff] [blame] | 1296 | static void testLine66() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1297 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1298 | path.addRect(0, 0, 60, 60, SkPath::kCW_Direction); |
| 1299 | path.addRect(0, 30, 20, 20, SkPath::kCW_Direction); |
| 1300 | path.addRect(12, 20, 24, 30, SkPath::kCW_Direction); |
caryclark@google.com | 27c449a | 2012-07-27 18:26:38 +0000 | [diff] [blame] | 1301 | testSimplifyx(path); |
| 1302 | } |
| 1303 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1304 | static void testLine66x() { |
| 1305 | SkPath path; |
| 1306 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1307 | path.addRect(0, 0, 60, 60, SkPath::kCW_Direction); |
| 1308 | path.addRect(0, 30, 20, 20, SkPath::kCW_Direction); |
| 1309 | path.addRect(12, 20, 24, 30, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1310 | testSimplifyx(path); |
| 1311 | } |
| 1312 | |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1313 | static void testLine67() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1314 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1315 | path.addRect(0, 0, 60, 60, SkPath::kCW_Direction); |
| 1316 | path.addRect(10, 40, 30, 30, SkPath::kCW_Direction); |
| 1317 | path.addRect(24, 20, 36, 30, SkPath::kCW_Direction); |
| 1318 | path.addRect(32, 0, 36, 41, SkPath::kCW_Direction); |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1319 | testSimplifyx(path); |
| 1320 | } |
| 1321 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1322 | static void testLine67x() { |
| 1323 | SkPath path; |
| 1324 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1325 | path.addRect(0, 0, 60, 60, SkPath::kCW_Direction); |
| 1326 | path.addRect(10, 40, 30, 30, SkPath::kCW_Direction); |
| 1327 | path.addRect(24, 20, 36, 30, SkPath::kCW_Direction); |
| 1328 | path.addRect(32, 0, 36, 41, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1329 | testSimplifyx(path); |
| 1330 | } |
| 1331 | |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1332 | static void testLine68a() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1333 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1334 | path.addRect(0, 0, 8, 8, SkPath::kCW_Direction); |
| 1335 | path.addRect(2, 2, 6, 6, SkPath::kCW_Direction); |
| 1336 | path.addRect(1, 2, 4, 2, SkPath::kCW_Direction); |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1337 | testSimplifyx(path); |
| 1338 | } |
| 1339 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1340 | static void testLine68ax() { |
| 1341 | SkPath path; |
| 1342 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1343 | path.addRect(0, 0, 8, 8, SkPath::kCW_Direction); |
| 1344 | path.addRect(2, 2, 6, 6, SkPath::kCW_Direction); |
| 1345 | path.addRect(1, 2, 4, 2, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1346 | testSimplifyx(path); |
| 1347 | } |
| 1348 | |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1349 | static void testLine68b() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1350 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1351 | path.addRect(0, 0, 8, 8, SkPath::kCW_Direction); |
| 1352 | path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction); |
| 1353 | path.addRect(1, 2, 2, 2, SkPath::kCW_Direction); |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1354 | testSimplifyx(path); |
| 1355 | } |
| 1356 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1357 | static void testLine68bx() { |
| 1358 | SkPath path; |
| 1359 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1360 | path.addRect(0, 0, 8, 8, SkPath::kCW_Direction); |
| 1361 | path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction); |
| 1362 | path.addRect(1, 2, 2, 2, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1363 | testSimplifyx(path); |
| 1364 | } |
| 1365 | |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1366 | static void testLine68c() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1367 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1368 | path.addRect(0, 0, 8, 8, SkPath::kCCW_Direction); |
| 1369 | path.addRect(2, 2, 6, 6, SkPath::kCW_Direction); |
| 1370 | path.addRect(1, 2, 4, 2, SkPath::kCW_Direction); |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1371 | testSimplifyx(path); |
| 1372 | } |
| 1373 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1374 | static void testLine68cx() { |
| 1375 | SkPath path; |
| 1376 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1377 | path.addRect(0, 0, 8, 8, SkPath::kCCW_Direction); |
| 1378 | path.addRect(2, 2, 6, 6, SkPath::kCW_Direction); |
| 1379 | path.addRect(1, 2, 4, 2, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1380 | testSimplifyx(path); |
| 1381 | } |
| 1382 | |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1383 | static void testLine68d() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1384 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1385 | path.addRect(0, 0, 8, 8, SkPath::kCCW_Direction); |
| 1386 | path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction); |
| 1387 | path.addRect(1, 2, 4, 2, SkPath::kCW_Direction); |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1388 | testSimplifyx(path); |
| 1389 | } |
| 1390 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1391 | static void testLine68dx() { |
| 1392 | SkPath path; |
| 1393 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1394 | path.addRect(0, 0, 8, 8, SkPath::kCCW_Direction); |
| 1395 | path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction); |
| 1396 | path.addRect(1, 2, 4, 2, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1397 | testSimplifyx(path); |
| 1398 | } |
| 1399 | |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1400 | static void testLine68e() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1401 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1402 | path.addRect(0, 0, 8, 8, SkPath::kCW_Direction); |
| 1403 | path.addRect(0, 0, 8, 8, SkPath::kCW_Direction); |
| 1404 | path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction); |
| 1405 | path.addRect(1, 2, 2, 2, SkPath::kCW_Direction); |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1406 | testSimplifyx(path); |
| 1407 | } |
| 1408 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1409 | static void testLine68ex() { |
| 1410 | SkPath path; |
| 1411 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1412 | path.addRect(0, 0, 8, 8, SkPath::kCW_Direction); |
| 1413 | path.addRect(0, 0, 8, 8, SkPath::kCW_Direction); |
| 1414 | path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction); |
| 1415 | path.addRect(1, 2, 2, 2, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1416 | testSimplifyx(path); |
| 1417 | } |
| 1418 | |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1419 | static void testLine68f() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1420 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1421 | path.addRect(0, 0, 8, 8, SkPath::kCW_Direction); |
| 1422 | path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction); |
| 1423 | path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction); |
| 1424 | path.addRect(1, 2, 2, 2, SkPath::kCW_Direction); |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1425 | testSimplifyx(path); |
| 1426 | } |
| 1427 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1428 | static void testLine68fx() { |
| 1429 | SkPath path; |
| 1430 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1431 | path.addRect(0, 0, 8, 8, SkPath::kCW_Direction); |
| 1432 | path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction); |
| 1433 | path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction); |
| 1434 | path.addRect(1, 2, 2, 2, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1435 | testSimplifyx(path); |
| 1436 | } |
| 1437 | |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1438 | static void testLine68g() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1439 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1440 | path.addRect(0, 0, 8, 8, SkPath::kCW_Direction); |
| 1441 | path.addRect(0, 0, 8, 8, SkPath::kCW_Direction); |
| 1442 | path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction); |
| 1443 | path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction); |
| 1444 | path.addRect(1, 2, 2, 2, SkPath::kCW_Direction); |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1445 | testSimplifyx(path); |
| 1446 | } |
| 1447 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1448 | static void testLine68gx() { |
| 1449 | SkPath path; |
| 1450 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1451 | path.addRect(0, 0, 8, 8, SkPath::kCW_Direction); |
| 1452 | path.addRect(0, 0, 8, 8, SkPath::kCW_Direction); |
| 1453 | path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction); |
| 1454 | path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction); |
| 1455 | path.addRect(1, 2, 2, 2, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1456 | testSimplifyx(path); |
| 1457 | } |
| 1458 | |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1459 | static void testLine68h() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1460 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1461 | path.addRect(0, 0, 8, 8, SkPath::kCW_Direction); |
| 1462 | path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction); |
| 1463 | path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction); |
| 1464 | path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction); |
| 1465 | path.addRect(1, 2, 2, 2, SkPath::kCW_Direction); |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1466 | testSimplifyx(path); |
| 1467 | } |
| 1468 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1469 | static void testLine68hx() { |
| 1470 | SkPath path; |
| 1471 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1472 | path.addRect(0, 0, 8, 8, SkPath::kCW_Direction); |
| 1473 | path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction); |
| 1474 | path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction); |
| 1475 | path.addRect(2, 2, 6, 6, SkPath::kCCW_Direction); |
| 1476 | path.addRect(1, 2, 2, 2, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1477 | testSimplifyx(path); |
| 1478 | } |
| 1479 | |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1480 | static void testLine69() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1481 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1482 | path.addRect(0, 20, 20, 20, SkPath::kCW_Direction); |
| 1483 | path.addRect(0, 20, 12, 30, SkPath::kCW_Direction); |
| 1484 | path.addRect(12, 32, 21, 36, SkPath::kCW_Direction); |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1485 | testSimplifyx(path); |
| 1486 | } |
| 1487 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1488 | static void testLine69x() { |
| 1489 | SkPath path; |
| 1490 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1491 | path.addRect(0, 20, 20, 20, SkPath::kCW_Direction); |
| 1492 | path.addRect(0, 20, 12, 30, SkPath::kCW_Direction); |
| 1493 | path.addRect(12, 32, 21, 36, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1494 | testSimplifyx(path); |
| 1495 | } |
| 1496 | |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1497 | static void testLine70() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1498 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1499 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 1500 | path.addRect(0, 24, 12, 12, SkPath::kCW_Direction); |
| 1501 | path.addRect(12, 32, 21, 36, SkPath::kCCW_Direction); |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1502 | testSimplifyx(path); |
| 1503 | } |
| 1504 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1505 | static void testLine70x() { |
| 1506 | SkPath path; |
| 1507 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1508 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 1509 | path.addRect(0, 24, 12, 12, SkPath::kCW_Direction); |
| 1510 | path.addRect(12, 32, 21, 36, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1511 | testSimplifyx(path); |
| 1512 | } |
| 1513 | |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1514 | static void testLine71() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1515 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1516 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 1517 | path.addRect(12, 0, 24, 24, SkPath::kCW_Direction); |
| 1518 | path.addRect(12, 32, 21, 36, SkPath::kCW_Direction); |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 1519 | testSimplifyx(path); |
| 1520 | } |
| 1521 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1522 | static void testLine71x() { |
| 1523 | SkPath path; |
| 1524 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1525 | path.addRect(0, 0, 20, 20, SkPath::kCW_Direction); |
| 1526 | path.addRect(12, 0, 24, 24, SkPath::kCW_Direction); |
| 1527 | path.addRect(12, 32, 21, 36, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1528 | testSimplifyx(path); |
| 1529 | } |
| 1530 | |
caryclark@google.com | 200c211 | 2012-08-03 15:05:04 +0000 | [diff] [blame] | 1531 | static void testLine72() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1532 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1533 | path.addRect(0, 0, 60, 60, SkPath::kCW_Direction); |
| 1534 | path.addRect(10, 40, 30, 30, SkPath::kCW_Direction); |
| 1535 | path.addRect(6, 20, 18, 30, SkPath::kCW_Direction); |
caryclark@google.com | 200c211 | 2012-08-03 15:05:04 +0000 | [diff] [blame] | 1536 | testSimplifyx(path); |
| 1537 | } |
| 1538 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1539 | static void testLine72x() { |
| 1540 | SkPath path; |
| 1541 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1542 | path.addRect(0, 0, 60, 60, SkPath::kCW_Direction); |
| 1543 | path.addRect(10, 40, 30, 30, SkPath::kCW_Direction); |
| 1544 | path.addRect(6, 20, 18, 30, SkPath::kCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1545 | testSimplifyx(path); |
| 1546 | } |
| 1547 | |
caryclark@google.com | 200c211 | 2012-08-03 15:05:04 +0000 | [diff] [blame] | 1548 | static void testLine73() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1549 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1550 | path.addRect(0, 0, 60, 60, SkPath::kCW_Direction); |
| 1551 | path.addRect(0, 40, 20, 20, SkPath::kCW_Direction); |
| 1552 | path.addRect(0, 20, 12, 30, SkPath::kCW_Direction); |
| 1553 | path.addRect(0, 0, 9, 9, SkPath::kCCW_Direction); |
caryclark@google.com | 200c211 | 2012-08-03 15:05:04 +0000 | [diff] [blame] | 1554 | testSimplifyx(path); |
| 1555 | } |
| 1556 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1557 | static void testLine73x() { |
| 1558 | SkPath path; |
| 1559 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1560 | path.addRect(0, 0, 60, 60, SkPath::kCW_Direction); |
| 1561 | path.addRect(0, 40, 20, 20, SkPath::kCW_Direction); |
| 1562 | path.addRect(0, 20, 12, 30, SkPath::kCW_Direction); |
| 1563 | path.addRect(0, 0, 9, 9, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1564 | testSimplifyx(path); |
| 1565 | } |
| 1566 | |
caryclark@google.com | 0c803d0 | 2012-08-06 11:15:47 +0000 | [diff] [blame] | 1567 | static void testLine74() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1568 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1569 | path.addRect(20, 30, 40, 40, SkPath::kCW_Direction); |
| 1570 | path.addRect(24, 20, 36, 30, SkPath::kCCW_Direction); |
| 1571 | path.addRect(32, 24, 36, 41, SkPath::kCCW_Direction); |
caryclark@google.com | 0c803d0 | 2012-08-06 11:15:47 +0000 | [diff] [blame] | 1572 | testSimplifyx(path); |
| 1573 | } |
| 1574 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1575 | static void testLine74x() { |
| 1576 | SkPath path; |
| 1577 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1578 | path.addRect(20, 30, 40, 40, SkPath::kCW_Direction); |
| 1579 | path.addRect(24, 20, 36, 30, SkPath::kCCW_Direction); |
| 1580 | path.addRect(32, 24, 36, 41, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1581 | testSimplifyx(path); |
| 1582 | } |
| 1583 | |
caryclark@google.com | 2ddff93 | 2012-08-07 21:25:27 +0000 | [diff] [blame] | 1584 | static void testLine75() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1585 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1586 | path.addRect(0, 0, 60, 60, SkPath::kCW_Direction); |
| 1587 | path.addRect(10, 0, 30, 30, SkPath::kCCW_Direction); |
| 1588 | path.addRect(18, 0, 30, 30, SkPath::kCCW_Direction); |
| 1589 | path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction); |
caryclark@google.com | 2ddff93 | 2012-08-07 21:25:27 +0000 | [diff] [blame] | 1590 | testSimplifyx(path); |
| 1591 | } |
| 1592 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1593 | static void testLine75x() { |
| 1594 | SkPath path; |
| 1595 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1596 | path.addRect(0, 0, 60, 60, SkPath::kCW_Direction); |
| 1597 | path.addRect(10, 0, 30, 30, SkPath::kCCW_Direction); |
| 1598 | path.addRect(18, 0, 30, 30, SkPath::kCCW_Direction); |
| 1599 | path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1600 | testSimplifyx(path); |
| 1601 | } |
| 1602 | |
caryclark@google.com | 2ddff93 | 2012-08-07 21:25:27 +0000 | [diff] [blame] | 1603 | static void testLine76() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1604 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1605 | path.addRect(36, 0, 66, 60, SkPath::kCW_Direction); |
| 1606 | path.addRect(10, 20, 40, 30, SkPath::kCW_Direction); |
| 1607 | path.addRect(24, 20, 36, 30, SkPath::kCCW_Direction); |
| 1608 | path.addRect(32, 6, 36, 41, SkPath::kCCW_Direction); |
caryclark@google.com | 2ddff93 | 2012-08-07 21:25:27 +0000 | [diff] [blame] | 1609 | testSimplifyx(path); |
| 1610 | } |
| 1611 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1612 | static void testLine76x() { |
| 1613 | SkPath path; |
| 1614 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1615 | path.addRect(36, 0, 66, 60, SkPath::kCW_Direction); |
| 1616 | path.addRect(10, 20, 40, 30, SkPath::kCW_Direction); |
| 1617 | path.addRect(24, 20, 36, 30, SkPath::kCCW_Direction); |
| 1618 | path.addRect(32, 6, 36, 41, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1619 | testSimplifyx(path); |
| 1620 | } |
| 1621 | |
caryclark@google.com | 2ddff93 | 2012-08-07 21:25:27 +0000 | [diff] [blame] | 1622 | static void testLine77() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1623 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1624 | path.addRect(20, 0, 40, 40, SkPath::kCW_Direction); |
| 1625 | path.addRect(24, 6, 36, 36, SkPath::kCCW_Direction); |
| 1626 | path.addRect(24, 32, 33, 36, SkPath::kCCW_Direction); |
caryclark@google.com | 2ddff93 | 2012-08-07 21:25:27 +0000 | [diff] [blame] | 1627 | testSimplifyx(path); |
| 1628 | } |
| 1629 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1630 | static void testLine77x() { |
| 1631 | SkPath path; |
| 1632 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1633 | path.addRect(20, 0, 40, 40, SkPath::kCW_Direction); |
| 1634 | path.addRect(24, 6, 36, 36, SkPath::kCCW_Direction); |
| 1635 | path.addRect(24, 32, 33, 36, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1636 | testSimplifyx(path); |
| 1637 | } |
| 1638 | |
caryclark@google.com | 2ddff93 | 2012-08-07 21:25:27 +0000 | [diff] [blame] | 1639 | static void testLine78() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1640 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1641 | path.addRect(0, 0, 30, 60, SkPath::kCW_Direction); |
| 1642 | path.addRect(10, 20, 30, 30, SkPath::kCCW_Direction); |
| 1643 | path.addRect(18, 20, 30, 30, SkPath::kCCW_Direction); |
| 1644 | path.addRect(32, 0, 36, 41, SkPath::kCCW_Direction); |
caryclark@google.com | 2ddff93 | 2012-08-07 21:25:27 +0000 | [diff] [blame] | 1645 | testSimplifyx(path); |
| 1646 | } |
| 1647 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1648 | static void testLine78x() { |
| 1649 | SkPath path; |
| 1650 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1651 | path.addRect(0, 0, 30, 60, SkPath::kCW_Direction); |
| 1652 | path.addRect(10, 20, 30, 30, SkPath::kCCW_Direction); |
| 1653 | path.addRect(18, 20, 30, 30, SkPath::kCCW_Direction); |
| 1654 | path.addRect(32, 0, 36, 41, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1655 | testSimplifyx(path); |
| 1656 | } |
| 1657 | |
caryclark@google.com | 2ddff93 | 2012-08-07 21:25:27 +0000 | [diff] [blame] | 1658 | static void testLine79() { |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1659 | SkPath path; |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1660 | path.addRect(0, 36, 60, 30, SkPath::kCW_Direction); |
| 1661 | path.addRect(10, 30, 40, 30, SkPath::kCW_Direction); |
| 1662 | path.addRect(0, 20, 12, 30, SkPath::kCCW_Direction); |
| 1663 | path.addRect(0, 32, 9, 36, SkPath::kCCW_Direction); |
caryclark@google.com | 2ddff93 | 2012-08-07 21:25:27 +0000 | [diff] [blame] | 1664 | testSimplifyx(path); |
| 1665 | } |
| 1666 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1667 | static void testLine79x() { |
| 1668 | SkPath path; |
| 1669 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 1670 | path.addRect(0, 36, 60, 30, SkPath::kCW_Direction); |
| 1671 | path.addRect(10, 30, 40, 30, SkPath::kCW_Direction); |
| 1672 | path.addRect(0, 20, 12, 30, SkPath::kCCW_Direction); |
| 1673 | path.addRect(0, 32, 9, 36, SkPath::kCCW_Direction); |
| 1674 | testSimplifyx(path); |
| 1675 | } |
| 1676 | |
| 1677 | static void testLine81() { |
| 1678 | SkPath path; |
| 1679 | path.addRect(-1, -1, 3, 3, SkPath::kCW_Direction); |
| 1680 | path.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 1681 | path.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 1682 | path.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 1683 | path.addRect(1, 1, 2, 2, SkPath::kCCW_Direction); |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1684 | testSimplifyx(path); |
| 1685 | } |
| 1686 | |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1687 | static void testDegenerate1() { |
| 1688 | SkPath path; |
| 1689 | path.moveTo(0, 0); |
| 1690 | path.lineTo(0, 0); |
| 1691 | path.lineTo(2, 0); |
| 1692 | path.close(); |
| 1693 | path.moveTo(0, 0); |
| 1694 | path.lineTo(1, 0); |
| 1695 | path.lineTo(2, 0); |
| 1696 | path.close(); |
| 1697 | testSimplifyx(path); |
| 1698 | } |
| 1699 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1700 | static void testDegenerate1x() { |
| 1701 | SkPath path; |
| 1702 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 1703 | path.moveTo(0, 0); |
| 1704 | path.lineTo(0, 0); |
| 1705 | path.lineTo(2, 0); |
| 1706 | path.close(); |
| 1707 | path.moveTo(0, 0); |
| 1708 | path.lineTo(1, 0); |
| 1709 | path.lineTo(2, 0); |
| 1710 | path.close(); |
| 1711 | testSimplifyx(path); |
| 1712 | } |
| 1713 | |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1714 | static void testDegenerate2() { |
| 1715 | SkPath path; |
| 1716 | path.moveTo(0, 0); |
| 1717 | path.lineTo(0, 0); |
| 1718 | path.lineTo(0, 0); |
| 1719 | path.close(); |
| 1720 | path.moveTo(0, 0); |
| 1721 | path.lineTo(1, 0); |
| 1722 | path.lineTo(0, 1); |
| 1723 | path.close(); |
| 1724 | testSimplifyx(path); |
| 1725 | } |
| 1726 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1727 | static void testDegenerate2x() { |
| 1728 | SkPath path; |
| 1729 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 1730 | path.moveTo(0, 0); |
| 1731 | path.lineTo(0, 0); |
| 1732 | path.lineTo(0, 0); |
| 1733 | path.close(); |
| 1734 | path.moveTo(0, 0); |
| 1735 | path.lineTo(1, 0); |
| 1736 | path.lineTo(0, 1); |
| 1737 | path.close(); |
| 1738 | testSimplifyx(path); |
| 1739 | } |
| 1740 | |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1741 | static void testDegenerate3() { |
| 1742 | SkPath path; |
| 1743 | path.moveTo(0, 0); |
| 1744 | path.lineTo(2, 0); |
| 1745 | path.lineTo(1, 0); |
| 1746 | path.close(); |
| 1747 | path.moveTo(0, 0); |
| 1748 | path.lineTo(0, 0); |
| 1749 | path.lineTo(3, 0); |
| 1750 | path.close(); |
| 1751 | testSimplifyx(path); |
| 1752 | } |
| 1753 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1754 | static void testDegenerate3x() { |
| 1755 | SkPath path; |
| 1756 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 1757 | path.moveTo(0, 0); |
| 1758 | path.lineTo(2, 0); |
| 1759 | path.lineTo(1, 0); |
| 1760 | path.close(); |
| 1761 | path.moveTo(0, 0); |
| 1762 | path.lineTo(0, 0); |
| 1763 | path.lineTo(3, 0); |
| 1764 | path.close(); |
| 1765 | testSimplifyx(path); |
| 1766 | } |
| 1767 | |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1768 | static void testDegenerate4() { |
| 1769 | SkPath path; |
| 1770 | path.moveTo(0, 0); |
| 1771 | path.lineTo(1, 0); |
| 1772 | path.lineTo(1, 3); |
| 1773 | path.close(); |
| 1774 | path.moveTo(1, 0); |
| 1775 | path.lineTo(1, 1); |
| 1776 | path.lineTo(1, 2); |
| 1777 | path.close(); |
| 1778 | testSimplifyx(path); |
| 1779 | } |
| 1780 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1781 | static void testDegenerate4x() { |
| 1782 | SkPath path; |
| 1783 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 1784 | path.moveTo(0, 0); |
| 1785 | path.lineTo(1, 0); |
| 1786 | path.lineTo(1, 3); |
| 1787 | path.close(); |
| 1788 | path.moveTo(1, 0); |
| 1789 | path.lineTo(1, 1); |
| 1790 | path.lineTo(1, 2); |
| 1791 | path.close(); |
| 1792 | testSimplifyx(path); |
| 1793 | } |
| 1794 | |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1795 | static void testNondegenerate1() { |
| 1796 | SkPath path; |
| 1797 | path.moveTo(0, 0); |
| 1798 | path.lineTo(3, 0); |
| 1799 | path.lineTo(1, 3); |
| 1800 | path.close(); |
| 1801 | path.moveTo(1, 1); |
| 1802 | path.lineTo(2, 1); |
| 1803 | path.lineTo(1, 2); |
| 1804 | path.close(); |
| 1805 | testSimplifyx(path); |
| 1806 | } |
| 1807 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1808 | static void testNondegenerate1x() { |
| 1809 | SkPath path; |
| 1810 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 1811 | path.moveTo(0, 0); |
| 1812 | path.lineTo(3, 0); |
| 1813 | path.lineTo(1, 3); |
| 1814 | path.close(); |
| 1815 | path.moveTo(1, 1); |
| 1816 | path.lineTo(2, 1); |
| 1817 | path.lineTo(1, 2); |
| 1818 | path.close(); |
| 1819 | testSimplifyx(path); |
| 1820 | } |
| 1821 | |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1822 | static void testNondegenerate2() { |
| 1823 | SkPath path; |
| 1824 | path.moveTo(1, 0); |
| 1825 | path.lineTo(0, 1); |
| 1826 | path.lineTo(1, 1); |
| 1827 | path.close(); |
| 1828 | path.moveTo(0, 2); |
| 1829 | path.lineTo(0, 3); |
| 1830 | path.lineTo(1, 2); |
| 1831 | path.close(); |
| 1832 | testSimplifyx(path); |
| 1833 | } |
| 1834 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1835 | static void testNondegenerate2x() { |
| 1836 | SkPath path; |
| 1837 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 1838 | path.moveTo(1, 0); |
| 1839 | path.lineTo(0, 1); |
| 1840 | path.lineTo(1, 1); |
| 1841 | path.close(); |
| 1842 | path.moveTo(0, 2); |
| 1843 | path.lineTo(0, 3); |
| 1844 | path.lineTo(1, 2); |
| 1845 | path.close(); |
| 1846 | testSimplifyx(path); |
| 1847 | } |
| 1848 | |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1849 | static void testNondegenerate3() { |
| 1850 | SkPath path; |
| 1851 | path.moveTo(0, 0); |
| 1852 | path.lineTo(1, 0); |
| 1853 | path.lineTo(2, 1); |
| 1854 | path.close(); |
| 1855 | path.moveTo(0, 1); |
| 1856 | path.lineTo(1, 1); |
| 1857 | path.lineTo(0, 2); |
| 1858 | path.close(); |
| 1859 | testSimplifyx(path); |
| 1860 | } |
| 1861 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1862 | static void testNondegenerate3x() { |
| 1863 | SkPath path; |
| 1864 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 1865 | path.moveTo(0, 0); |
| 1866 | path.lineTo(1, 0); |
| 1867 | path.lineTo(2, 1); |
| 1868 | path.close(); |
| 1869 | path.moveTo(0, 1); |
| 1870 | path.lineTo(1, 1); |
| 1871 | path.lineTo(0, 2); |
| 1872 | path.close(); |
| 1873 | testSimplifyx(path); |
| 1874 | } |
| 1875 | |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1876 | static void testNondegenerate4() { |
| 1877 | SkPath path; |
| 1878 | path.moveTo(1, 0); |
| 1879 | path.lineTo(0, 1); |
| 1880 | path.lineTo(1, 2); |
| 1881 | path.close(); |
| 1882 | path.moveTo(0, 2); |
| 1883 | path.lineTo(0, 3); |
| 1884 | path.lineTo(1, 3); |
| 1885 | path.close(); |
| 1886 | testSimplifyx(path); |
| 1887 | } |
| 1888 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1889 | static void testNondegenerate4x() { |
| 1890 | SkPath path; |
| 1891 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 1892 | path.moveTo(1, 0); |
| 1893 | path.lineTo(0, 1); |
| 1894 | path.lineTo(1, 2); |
| 1895 | path.close(); |
| 1896 | path.moveTo(0, 2); |
| 1897 | path.lineTo(0, 3); |
| 1898 | path.lineTo(1, 3); |
| 1899 | path.close(); |
| 1900 | testSimplifyx(path); |
| 1901 | } |
| 1902 | |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1903 | static void testQuadralateral5() { |
| 1904 | SkPath path; |
| 1905 | path.moveTo(0, 0); |
| 1906 | path.lineTo(0, 0); |
| 1907 | path.lineTo(1, 0); |
| 1908 | path.lineTo(1, 1); |
| 1909 | path.close(); |
| 1910 | path.moveTo(0, 0); |
| 1911 | path.lineTo(2, 2); |
| 1912 | path.lineTo(3, 2); |
| 1913 | path.lineTo(3, 3); |
| 1914 | path.close(); |
| 1915 | testSimplifyx(path); |
| 1916 | } |
| 1917 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1918 | static void testQuadralateral5x() { |
| 1919 | SkPath path; |
| 1920 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 1921 | path.moveTo(0, 0); |
| 1922 | path.lineTo(0, 0); |
| 1923 | path.lineTo(1, 0); |
| 1924 | path.lineTo(1, 1); |
| 1925 | path.close(); |
| 1926 | path.moveTo(0, 0); |
| 1927 | path.lineTo(2, 2); |
| 1928 | path.lineTo(3, 2); |
| 1929 | path.lineTo(3, 3); |
| 1930 | path.close(); |
| 1931 | testSimplifyx(path); |
| 1932 | } |
| 1933 | |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 1934 | static void testQuadralateral6() { |
| 1935 | SkPath path; |
| 1936 | path.moveTo(0, 0); |
| 1937 | path.lineTo(0, 0); |
| 1938 | path.lineTo(1, 0); |
| 1939 | path.lineTo(1, 1); |
| 1940 | path.close(); |
| 1941 | path.moveTo(1, 0); |
| 1942 | path.lineTo(2, 0); |
| 1943 | path.lineTo(0, 2); |
| 1944 | path.lineTo(2, 2); |
| 1945 | path.close(); |
| 1946 | testSimplifyx(path); |
| 1947 | } |
| 1948 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1949 | static void testQuadralateral6x() { |
| 1950 | SkPath path; |
| 1951 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 1952 | path.moveTo(0, 0); |
| 1953 | path.lineTo(0, 0); |
| 1954 | path.lineTo(1, 0); |
| 1955 | path.lineTo(1, 1); |
| 1956 | path.close(); |
| 1957 | path.moveTo(1, 0); |
| 1958 | path.lineTo(2, 0); |
| 1959 | path.lineTo(0, 2); |
| 1960 | path.lineTo(2, 2); |
| 1961 | path.close(); |
| 1962 | testSimplifyx(path); |
| 1963 | } |
| 1964 | |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 1965 | static void testFauxQuadralateral6() { |
| 1966 | SkPath path; |
| 1967 | path.moveTo(0, 0); |
| 1968 | path.lineTo(1, 0); |
| 1969 | path.lineTo(1, 1); |
| 1970 | path.close(); |
| 1971 | path.moveTo(1, 0); |
| 1972 | path.lineTo(2, 0); |
| 1973 | path.lineTo(1 + 1.0f/3, 2.0f/3); |
| 1974 | path.close(); |
| 1975 | path.moveTo(1 + 1.0f/3, 2.0f/3); |
| 1976 | path.lineTo(0, 2); |
| 1977 | path.lineTo(2, 2); |
| 1978 | path.close(); |
| 1979 | testSimplifyx(path); |
| 1980 | } |
| 1981 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 1982 | static void testFauxQuadralateral6x() { |
| 1983 | SkPath path; |
| 1984 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 1985 | path.moveTo(0, 0); |
| 1986 | path.lineTo(1, 0); |
| 1987 | path.lineTo(1, 1); |
| 1988 | path.close(); |
| 1989 | path.moveTo(1, 0); |
| 1990 | path.lineTo(2, 0); |
| 1991 | path.lineTo(1 + 1.0f/3, 2.0f/3); |
| 1992 | path.close(); |
| 1993 | path.moveTo(1 + 1.0f/3, 2.0f/3); |
| 1994 | path.lineTo(0, 2); |
| 1995 | path.lineTo(2, 2); |
| 1996 | path.close(); |
| 1997 | testSimplifyx(path); |
| 1998 | } |
| 1999 | |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 2000 | static void testFauxQuadralateral6a() { |
| 2001 | SkPath path; |
| 2002 | path.moveTo(0, 0); |
| 2003 | path.lineTo(3, 0); |
| 2004 | path.lineTo(3, 3); |
| 2005 | path.close(); |
| 2006 | path.moveTo(3, 0); |
| 2007 | path.lineTo(6, 0); |
| 2008 | path.lineTo(4, 2); |
| 2009 | path.close(); |
| 2010 | path.moveTo(4, 2); |
| 2011 | path.lineTo(0, 6); |
| 2012 | path.lineTo(6, 6); |
| 2013 | path.close(); |
| 2014 | testSimplifyx(path); |
| 2015 | } |
| 2016 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 2017 | static void testFauxQuadralateral6ax() { |
| 2018 | SkPath path; |
| 2019 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 2020 | path.moveTo(0, 0); |
| 2021 | path.lineTo(3, 0); |
| 2022 | path.lineTo(3, 3); |
| 2023 | path.close(); |
| 2024 | path.moveTo(3, 0); |
| 2025 | path.lineTo(6, 0); |
| 2026 | path.lineTo(4, 2); |
| 2027 | path.close(); |
| 2028 | path.moveTo(4, 2); |
| 2029 | path.lineTo(0, 6); |
| 2030 | path.lineTo(6, 6); |
| 2031 | path.close(); |
| 2032 | testSimplifyx(path); |
| 2033 | } |
| 2034 | |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 2035 | static void testFauxQuadralateral6b() { |
| 2036 | SkPath path; |
| 2037 | path.moveTo(0, 0); |
| 2038 | path.lineTo(3, 0); |
| 2039 | path.lineTo(3, 3); |
| 2040 | path.close(); |
| 2041 | path.moveTo(3, 0); |
| 2042 | path.lineTo(6, 0); |
| 2043 | path.lineTo(4, 2); |
| 2044 | path.close(); |
| 2045 | path.moveTo(4, 2); |
| 2046 | path.lineTo(6, 6); |
| 2047 | path.lineTo(0, 6); |
| 2048 | path.close(); |
| 2049 | testSimplifyx(path); |
| 2050 | } |
| 2051 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 2052 | static void testFauxQuadralateral6bx() { |
| 2053 | SkPath path; |
| 2054 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 2055 | path.moveTo(0, 0); |
| 2056 | path.lineTo(3, 0); |
| 2057 | path.lineTo(3, 3); |
| 2058 | path.close(); |
| 2059 | path.moveTo(3, 0); |
| 2060 | path.lineTo(6, 0); |
| 2061 | path.lineTo(4, 2); |
| 2062 | path.close(); |
| 2063 | path.moveTo(4, 2); |
| 2064 | path.lineTo(6, 6); |
| 2065 | path.lineTo(0, 6); |
| 2066 | path.close(); |
| 2067 | testSimplifyx(path); |
| 2068 | } |
| 2069 | |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 2070 | static void testFauxQuadralateral6c() { |
| 2071 | SkPath path; |
| 2072 | path.moveTo(0, 0); |
| 2073 | path.lineTo(3, 3); |
| 2074 | path.lineTo(3, 0); |
| 2075 | path.close(); |
| 2076 | path.moveTo(3, 0); |
| 2077 | path.lineTo(6, 0); |
| 2078 | path.lineTo(4, 2); |
| 2079 | path.close(); |
| 2080 | path.moveTo(4, 2); |
| 2081 | path.lineTo(0, 6); |
| 2082 | path.lineTo(6, 6); |
| 2083 | path.close(); |
| 2084 | testSimplifyx(path); |
| 2085 | } |
| 2086 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 2087 | static void testFauxQuadralateral6cx() { |
| 2088 | SkPath path; |
| 2089 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 2090 | path.moveTo(0, 0); |
| 2091 | path.lineTo(3, 3); |
| 2092 | path.lineTo(3, 0); |
| 2093 | path.close(); |
| 2094 | path.moveTo(3, 0); |
| 2095 | path.lineTo(6, 0); |
| 2096 | path.lineTo(4, 2); |
| 2097 | path.close(); |
| 2098 | path.moveTo(4, 2); |
| 2099 | path.lineTo(0, 6); |
| 2100 | path.lineTo(6, 6); |
| 2101 | path.close(); |
| 2102 | testSimplifyx(path); |
| 2103 | } |
| 2104 | |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 2105 | static void testFauxQuadralateral6d() { |
| 2106 | SkPath path; |
| 2107 | path.moveTo(0, 0); |
| 2108 | path.lineTo(3, 3); |
| 2109 | path.lineTo(3, 0); |
| 2110 | path.close(); |
| 2111 | path.moveTo(3, 0); |
| 2112 | path.lineTo(6, 0); |
| 2113 | path.lineTo(4, 2); |
| 2114 | path.close(); |
| 2115 | path.moveTo(4, 2); |
| 2116 | path.lineTo(6, 6); |
| 2117 | path.lineTo(0, 6); |
| 2118 | path.close(); |
| 2119 | testSimplifyx(path); |
| 2120 | } |
| 2121 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 2122 | static void testFauxQuadralateral6dx() { |
| 2123 | SkPath path; |
| 2124 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 2125 | path.moveTo(0, 0); |
| 2126 | path.lineTo(3, 3); |
| 2127 | path.lineTo(3, 0); |
| 2128 | path.close(); |
| 2129 | path.moveTo(3, 0); |
| 2130 | path.lineTo(6, 0); |
| 2131 | path.lineTo(4, 2); |
| 2132 | path.close(); |
| 2133 | path.moveTo(4, 2); |
| 2134 | path.lineTo(6, 6); |
| 2135 | path.lineTo(0, 6); |
| 2136 | path.close(); |
| 2137 | testSimplifyx(path); |
| 2138 | } |
| 2139 | |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 2140 | static void testQuadralateral6a() { |
| 2141 | SkPath path; |
| 2142 | path.moveTo(0, 0); |
| 2143 | path.lineTo(0, 0); |
| 2144 | path.lineTo(3, 0); |
| 2145 | path.lineTo(3, 3); |
| 2146 | path.close(); |
| 2147 | path.moveTo(3, 0); |
| 2148 | path.lineTo(6, 0); |
| 2149 | path.lineTo(0, 6); |
| 2150 | path.lineTo(6, 6); |
| 2151 | path.close(); |
| 2152 | testSimplifyx(path); |
| 2153 | } |
| 2154 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 2155 | static void testQuadralateral6ax() { |
| 2156 | SkPath path; |
| 2157 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 2158 | path.moveTo(0, 0); |
| 2159 | path.lineTo(0, 0); |
| 2160 | path.lineTo(3, 0); |
| 2161 | path.lineTo(3, 3); |
| 2162 | path.close(); |
| 2163 | path.moveTo(3, 0); |
| 2164 | path.lineTo(6, 0); |
| 2165 | path.lineTo(0, 6); |
| 2166 | path.lineTo(6, 6); |
| 2167 | path.close(); |
| 2168 | testSimplifyx(path); |
| 2169 | } |
| 2170 | |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 2171 | static void testQuadralateral7() { |
| 2172 | SkPath path; |
| 2173 | path.moveTo(0, 0); |
| 2174 | path.lineTo(0, 0); |
| 2175 | path.lineTo(1, 0); |
| 2176 | path.lineTo(2, 1); |
| 2177 | path.close(); |
| 2178 | path.moveTo(1, 0); |
| 2179 | path.lineTo(1, 1); |
| 2180 | path.lineTo(2, 2); |
| 2181 | path.lineTo(1, 3); |
| 2182 | path.close(); |
| 2183 | testSimplifyx(path); |
| 2184 | } |
| 2185 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 2186 | static void testQuadralateral7x() { |
| 2187 | SkPath path; |
| 2188 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 2189 | path.moveTo(0, 0); |
| 2190 | path.lineTo(0, 0); |
| 2191 | path.lineTo(1, 0); |
| 2192 | path.lineTo(2, 1); |
| 2193 | path.close(); |
| 2194 | path.moveTo(1, 0); |
| 2195 | path.lineTo(1, 1); |
| 2196 | path.lineTo(2, 2); |
| 2197 | path.lineTo(1, 3); |
| 2198 | path.close(); |
| 2199 | testSimplifyx(path); |
| 2200 | } |
| 2201 | |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 2202 | static void testQuadralateral8() { |
| 2203 | SkPath path; |
| 2204 | path.moveTo(0, 0); |
| 2205 | path.lineTo(3, 1); |
| 2206 | path.lineTo(1, 3); |
| 2207 | path.lineTo(3, 3); |
| 2208 | path.close(); |
| 2209 | path.moveTo(2, 1); |
| 2210 | path.lineTo(0, 2); |
| 2211 | path.lineTo(3, 2); |
| 2212 | path.lineTo(2, 3); |
| 2213 | path.close(); |
| 2214 | testSimplifyx(path); |
| 2215 | } |
| 2216 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 2217 | static void testQuadralateral8x() { |
| 2218 | SkPath path; |
| 2219 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 2220 | path.moveTo(0, 0); |
| 2221 | path.lineTo(3, 1); |
| 2222 | path.lineTo(1, 3); |
| 2223 | path.lineTo(3, 3); |
| 2224 | path.close(); |
| 2225 | path.moveTo(2, 1); |
| 2226 | path.lineTo(0, 2); |
| 2227 | path.lineTo(3, 2); |
| 2228 | path.lineTo(2, 3); |
| 2229 | path.close(); |
| 2230 | testSimplifyx(path); |
| 2231 | } |
| 2232 | |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 2233 | static void testQuadralateral9() { |
| 2234 | SkPath path; |
| 2235 | path.moveTo(0, 0); |
| 2236 | path.lineTo(1, 0); |
| 2237 | path.lineTo(1, 2); |
| 2238 | path.lineTo(2, 2); |
| 2239 | path.close(); |
| 2240 | path.moveTo(1, 1); |
| 2241 | path.lineTo(2, 1); |
| 2242 | path.lineTo(1, 3); |
| 2243 | path.lineTo(2, 3); |
| 2244 | path.close(); |
| 2245 | testSimplifyx(path); |
| 2246 | } |
| 2247 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 2248 | static void testQuadralateral9x() { |
| 2249 | SkPath path; |
| 2250 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 2251 | path.moveTo(0, 0); |
| 2252 | path.lineTo(1, 0); |
| 2253 | path.lineTo(1, 2); |
| 2254 | path.lineTo(2, 2); |
| 2255 | path.close(); |
| 2256 | path.moveTo(1, 1); |
| 2257 | path.lineTo(2, 1); |
| 2258 | path.lineTo(1, 3); |
| 2259 | path.lineTo(2, 3); |
| 2260 | path.close(); |
| 2261 | testSimplifyx(path); |
| 2262 | } |
| 2263 | |
caryclark@google.com | e7bd5f4 | 2012-12-13 19:47:53 +0000 | [diff] [blame] | 2264 | static void testLine1a() { |
| 2265 | SkPath path; |
| 2266 | path.setFillType(SkPath::kWinding_FillType); |
| 2267 | path.addRect(0, 0, 12, 12, SkPath::kCW_Direction); |
| 2268 | path.addRect(4, 0, 13, 13, SkPath::kCCW_Direction); |
| 2269 | testSimplifyx(path); |
| 2270 | } |
| 2271 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 2272 | static void testLine1ax() { |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 2273 | SkPath path; |
| 2274 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 2275 | path.addRect(0, 0, 12, 12, SkPath::kCW_Direction); |
caryclark@google.com | e7bd5f4 | 2012-12-13 19:47:53 +0000 | [diff] [blame] | 2276 | path.addRect(4, 0, 13, 13, SkPath::kCCW_Direction); |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 2277 | testSimplifyx(path); |
| 2278 | } |
| 2279 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 2280 | static void testLine2ax() { |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 2281 | SkPath path; |
| 2282 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 2283 | path.addRect(0, 20, 20, 20, SkPath::kCW_Direction); |
| 2284 | path.addRect(0, 20, 12, 30, SkPath::kCW_Direction); |
| 2285 | path.addRect(12, 0, 21, 21, SkPath::kCCW_Direction); |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 2286 | testSimplifyx(path); |
| 2287 | } |
| 2288 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 2289 | static void testLine3aax() { |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 2290 | SkPath path; |
| 2291 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 2292 | path.addRect(10, 30, 30, 30, SkPath::kCW_Direction); |
| 2293 | path.addRect(18, 20, 30, 30, SkPath::kCCW_Direction); |
| 2294 | path.addRect(0, 32, 9, 36, SkPath::kCCW_Direction); |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 2295 | testSimplifyx(path); |
| 2296 | } |
| 2297 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 2298 | static void testLine4ax() { |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 2299 | SkPath path; |
| 2300 | path.setFillType(SkPath::kEvenOdd_FillType); |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 2301 | path.addRect(10, 30, 30, 30, SkPath::kCW_Direction); |
| 2302 | path.addRect(24, 20, 36, 30, SkPath::kCCW_Direction); |
| 2303 | path.addRect(0, 32, 9, 36, SkPath::kCCW_Direction); |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 2304 | testSimplifyx(path); |
| 2305 | } |
| 2306 | |
| 2307 | static void testQuadratic1() { |
| 2308 | SkPath path; |
| 2309 | path.moveTo(0, 0); |
| 2310 | path.quadTo(0, 0, 0, 0); |
| 2311 | path.lineTo(1, 0); |
| 2312 | path.close(); |
| 2313 | path.moveTo(0, 0); |
| 2314 | path.lineTo(0, 0); |
| 2315 | path.quadTo(0, 0, 0, 0); |
| 2316 | path.close(); |
| 2317 | testSimplifyx(path); |
| 2318 | } |
| 2319 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 2320 | static void testQuadratic1x() { |
| 2321 | SkPath path; |
| 2322 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 2323 | path.moveTo(0, 0); |
| 2324 | path.quadTo(0, 0, 0, 0); |
| 2325 | path.lineTo(1, 0); |
| 2326 | path.close(); |
| 2327 | path.moveTo(0, 0); |
| 2328 | path.lineTo(0, 0); |
| 2329 | path.quadTo(0, 0, 0, 0); |
| 2330 | path.close(); |
| 2331 | testSimplifyx(path); |
| 2332 | } |
| 2333 | |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 2334 | static void testQuadratic2() { |
| 2335 | SkPath path; |
| 2336 | path.moveTo(0, 0); |
| 2337 | path.quadTo(0, 0, 0, 0); |
| 2338 | path.lineTo(3, 0); |
| 2339 | path.close(); |
| 2340 | path.moveTo(0, 0); |
| 2341 | path.lineTo(0, 0); |
| 2342 | path.quadTo(1, 0, 0, 1); |
| 2343 | path.close(); |
| 2344 | testSimplifyx(path); |
| 2345 | } |
| 2346 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 2347 | static void testQuadratic2x() { |
| 2348 | SkPath path; |
| 2349 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 2350 | path.moveTo(0, 0); |
| 2351 | path.quadTo(0, 0, 0, 0); |
| 2352 | path.lineTo(3, 0); |
| 2353 | path.close(); |
| 2354 | path.moveTo(0, 0); |
| 2355 | path.lineTo(0, 0); |
| 2356 | path.quadTo(1, 0, 0, 1); |
| 2357 | path.close(); |
| 2358 | testSimplifyx(path); |
| 2359 | } |
| 2360 | |
caryclark@google.com | 03f9706 | 2012-08-21 13:13:52 +0000 | [diff] [blame] | 2361 | static void testQuadratic3() { |
| 2362 | SkPath path; |
| 2363 | path.moveTo(0, 0); |
| 2364 | path.quadTo(0, 0, 1, 0); |
| 2365 | path.lineTo(0, 2); |
| 2366 | path.close(); |
| 2367 | path.moveTo(0, 0); |
| 2368 | path.lineTo(0, 0); |
| 2369 | path.quadTo(1, 0, 0, 1); |
| 2370 | path.close(); |
| 2371 | testSimplifyx(path); |
| 2372 | } |
| 2373 | |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 2374 | static void testQuadratic3x() { |
| 2375 | SkPath path; |
| 2376 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 2377 | path.moveTo(0, 0); |
| 2378 | path.quadTo(0, 0, 1, 0); |
| 2379 | path.lineTo(0, 2); |
| 2380 | path.close(); |
| 2381 | path.moveTo(0, 0); |
| 2382 | path.lineTo(0, 0); |
| 2383 | path.quadTo(1, 0, 0, 1); |
| 2384 | path.close(); |
| 2385 | testSimplifyx(path); |
| 2386 | } |
| 2387 | |
| 2388 | static void testQuadratic4() { |
| 2389 | SkPath path; |
| 2390 | path.moveTo(0, 0); |
| 2391 | path.quadTo(0, 0, 1, 0); |
| 2392 | path.lineTo(0, 2); |
| 2393 | path.close(); |
| 2394 | path.moveTo(0, 0); |
| 2395 | path.lineTo(0, 0); |
| 2396 | path.quadTo(1, 0, 0, 2); |
| 2397 | path.close(); |
| 2398 | testSimplifyx(path); |
| 2399 | } |
| 2400 | |
| 2401 | static void testQuadratic4x() { |
| 2402 | SkPath path; |
| 2403 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 2404 | path.moveTo(0, 0); |
| 2405 | path.quadTo(0, 0, 1, 0); |
| 2406 | path.lineTo(0, 2); |
| 2407 | path.close(); |
| 2408 | path.moveTo(0, 0); |
| 2409 | path.lineTo(0, 0); |
| 2410 | path.quadTo(1, 0, 0, 2); |
| 2411 | path.close(); |
| 2412 | testSimplifyx(path); |
| 2413 | } |
| 2414 | |
| 2415 | static void testQuadratic5() { |
| 2416 | SkPath path; |
| 2417 | path.moveTo(0, 0); |
| 2418 | path.quadTo(0, 0, 0, 0); |
| 2419 | path.lineTo(0, 1); |
| 2420 | path.close(); |
| 2421 | path.moveTo(0, 0); |
| 2422 | path.lineTo(1, 0); |
| 2423 | path.quadTo(0, 1, 0, 2); |
| 2424 | path.close(); |
| 2425 | testSimplifyx(path); |
| 2426 | } |
| 2427 | |
| 2428 | static void testQuadratic6() { |
| 2429 | SkPath path; |
| 2430 | path.moveTo(0, 0); |
| 2431 | path.quadTo(0, 0, 1, 0); |
| 2432 | path.lineTo(2, 1); |
| 2433 | path.close(); |
| 2434 | path.moveTo(0, 0); |
| 2435 | path.lineTo(0, 0); |
| 2436 | path.quadTo(2, 0, 0, 1); |
| 2437 | path.close(); |
| 2438 | testSimplifyx(path); |
| 2439 | } |
| 2440 | |
| 2441 | static void testQuadratic7() { |
| 2442 | SkPath path; |
| 2443 | path.moveTo(0, 0); |
| 2444 | path.quadTo(0, 0, 1, 0); |
| 2445 | path.lineTo(3, 1); |
| 2446 | path.close(); |
| 2447 | path.moveTo(0, 0); |
| 2448 | path.lineTo(0, 0); |
| 2449 | path.quadTo(3, 0, 1, 2); |
| 2450 | path.close(); |
| 2451 | testSimplifyx(path); |
| 2452 | } |
| 2453 | |
| 2454 | static void testQuadratic8() { |
| 2455 | SkPath path; |
| 2456 | path.moveTo(0, 0); |
| 2457 | path.quadTo(0, 0, 1, 0); |
| 2458 | path.lineTo(0, 2); |
| 2459 | path.close(); |
| 2460 | path.moveTo(0, 0); |
| 2461 | path.lineTo(1, 0); |
| 2462 | path.quadTo(0, 1, 1, 2); |
| 2463 | path.close(); |
| 2464 | testSimplifyx(path); |
| 2465 | } |
| 2466 | |
| 2467 | static void testQuadratic9() { |
| 2468 | SkPath path; |
| 2469 | path.moveTo(0, 0); |
| 2470 | path.quadTo(0, 0, 1, 0); |
| 2471 | path.lineTo(3, 1); |
| 2472 | path.close(); |
| 2473 | path.moveTo(0, 0); |
| 2474 | path.lineTo(1, 0); |
| 2475 | path.quadTo(1, 2, 3, 2); |
| 2476 | path.close(); |
| 2477 | testSimplifyx(path); |
| 2478 | } |
| 2479 | |
| 2480 | static void testQuadratic14() { |
| 2481 | SkPath path; |
| 2482 | path.moveTo(0, 0); |
| 2483 | path.quadTo(0, 0, 1, 0); |
| 2484 | path.lineTo(3, 2); |
| 2485 | path.close(); |
| 2486 | path.moveTo(0, 0); |
| 2487 | path.lineTo(1, 0); |
| 2488 | path.quadTo(3, 2, 3, 3); |
| 2489 | path.close(); |
| 2490 | testSimplifyx(path); |
| 2491 | } |
| 2492 | |
caryclark@google.com | 3350c3c | 2012-08-24 15:24:36 +0000 | [diff] [blame] | 2493 | static void testQuadratic15() { |
| 2494 | SkPath path; |
| 2495 | path.moveTo(0, 0); |
| 2496 | path.quadTo(0, 0, 1, 0); |
| 2497 | path.lineTo(1, 3); |
| 2498 | path.close(); |
| 2499 | path.moveTo(1, 0); |
| 2500 | path.lineTo(0, 1); |
| 2501 | path.quadTo(1, 1, 0, 3); |
| 2502 | path.close(); |
| 2503 | testSimplifyx(path); |
| 2504 | } |
| 2505 | |
| 2506 | static void testQuadratic17x() { |
| 2507 | SkPath path; |
| 2508 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 2509 | path.moveTo(0, 0); |
| 2510 | path.quadTo(0, 0, 3, 1); |
| 2511 | path.lineTo(0, 2); |
| 2512 | path.close(); |
| 2513 | path.moveTo(0, 0); |
| 2514 | path.lineTo(1, 0); |
| 2515 | path.quadTo(3, 1, 0, 2); |
| 2516 | path.close(); |
| 2517 | testSimplifyx(path); |
| 2518 | } |
| 2519 | |
| 2520 | static void testQuadratic18() { |
| 2521 | SkPath path; |
| 2522 | path.moveTo(0, 0); |
| 2523 | path.quadTo(1, 0, 0, 1); |
| 2524 | path.lineTo(0, 1); |
| 2525 | path.close(); |
| 2526 | path.moveTo(0, 0); |
| 2527 | path.lineTo(0, 0); |
| 2528 | path.quadTo(1, 0, 1, 1); |
| 2529 | path.close(); |
| 2530 | testSimplifyx(path); |
| 2531 | } |
| 2532 | |
caryclark@google.com | a7e483d | 2012-08-28 20:44:43 +0000 | [diff] [blame] | 2533 | static void testQuadratic19() { |
| 2534 | SkPath path; |
| 2535 | path.moveTo(0, 0); |
| 2536 | path.quadTo(1, 0, 0, 1); |
| 2537 | path.lineTo(0, 1); |
| 2538 | path.close(); |
| 2539 | path.moveTo(0, 0); |
| 2540 | path.lineTo(0, 0); |
| 2541 | path.quadTo(2, 0, 0, 1); |
| 2542 | path.close(); |
| 2543 | testSimplifyx(path); |
| 2544 | } |
| 2545 | |
caryclark@google.com | 32546db | 2012-08-31 20:55:07 +0000 | [diff] [blame] | 2546 | static void testQuadratic20() { |
| 2547 | SkPath path; |
| 2548 | path.moveTo(0, 0); |
| 2549 | path.quadTo(1, 0, 0, 1); |
| 2550 | path.lineTo(0, 1); |
| 2551 | path.close(); |
| 2552 | path.moveTo(0, 0); |
| 2553 | path.lineTo(0, 0); |
| 2554 | path.quadTo(1, 0, 0, 1); |
| 2555 | path.close(); |
| 2556 | testSimplifyx(path); |
| 2557 | } |
| 2558 | |
caryclark@google.com | 235f56a | 2012-09-14 14:19:30 +0000 | [diff] [blame] | 2559 | static void testQuadratic21() { |
| 2560 | SkPath path; |
| 2561 | path.moveTo(0, 0); |
| 2562 | path.quadTo(1, 0, 0, 1); |
| 2563 | path.lineTo(0, 1); |
| 2564 | path.close(); |
| 2565 | path.moveTo(0, 0); |
| 2566 | path.lineTo(0, 0); |
| 2567 | path.quadTo(1, 0, 0, 2); |
| 2568 | path.close(); |
| 2569 | testSimplifyx(path); |
| 2570 | } |
| 2571 | |
caryclark@google.com | 235f56a | 2012-09-14 14:19:30 +0000 | [diff] [blame] | 2572 | static void testQuadratic22() { |
| 2573 | SkPath path; |
| 2574 | path.moveTo(0, 0); |
| 2575 | path.quadTo(1, 0, 0, 1); |
| 2576 | path.lineTo(0, 1); |
| 2577 | path.close(); |
| 2578 | path.moveTo(0, 0); |
| 2579 | path.lineTo(0, 0); |
| 2580 | path.quadTo(0, 1, 2, 1); |
| 2581 | path.close(); |
| 2582 | testSimplifyx(path); |
| 2583 | } |
| 2584 | |
| 2585 | static void testQuadratic23() { |
| 2586 | SkPath path; |
| 2587 | path.moveTo(0, 0); |
| 2588 | path.quadTo(1, 0, 0, 1); |
| 2589 | path.lineTo(0, 1); |
| 2590 | path.close(); |
| 2591 | path.moveTo(0, 0); |
| 2592 | path.lineTo(0, 0); |
| 2593 | path.quadTo(0, 2, 1, 2); |
| 2594 | path.close(); |
| 2595 | testSimplifyx(path); |
| 2596 | } |
| 2597 | |
| 2598 | static void testQuadratic24() { |
| 2599 | SkPath path; |
| 2600 | path.moveTo(0, 0); |
| 2601 | path.quadTo(1, 0, 0, 1); |
| 2602 | path.lineTo(0, 1); |
| 2603 | path.close(); |
| 2604 | path.moveTo(0, 0); |
| 2605 | path.lineTo(1, 0); |
| 2606 | path.quadTo(2, 0, 0, 1); |
| 2607 | path.close(); |
| 2608 | testSimplifyx(path); |
| 2609 | } |
| 2610 | |
| 2611 | static void testQuadratic25() { |
| 2612 | SkPath path; |
| 2613 | path.moveTo(0, 0); |
| 2614 | path.quadTo(1, 0, 1, 1); |
| 2615 | path.lineTo(1, 1); |
| 2616 | path.close(); |
| 2617 | path.moveTo(0, 0); |
| 2618 | path.lineTo(0, 0); |
| 2619 | path.quadTo(2, 1, 0, 2); |
| 2620 | path.close(); |
| 2621 | testSimplifyx(path); |
| 2622 | } |
| 2623 | |
| 2624 | static void testQuadratic26() { |
| 2625 | SkPath path; |
| 2626 | path.moveTo(0, 0); |
| 2627 | path.quadTo(1, 0, 1, 1); |
| 2628 | path.lineTo(0, 2); |
| 2629 | path.close(); |
| 2630 | path.moveTo(0, 0); |
| 2631 | path.lineTo(0, 0); |
| 2632 | path.quadTo(1, 0, 0, 1); |
| 2633 | path.close(); |
| 2634 | testSimplifyx(path); |
| 2635 | } |
| 2636 | |
| 2637 | static void testQuadratic27() { |
| 2638 | SkPath path; |
| 2639 | path.moveTo(0, 0); |
| 2640 | path.quadTo(1, 0, 1, 1); |
| 2641 | path.lineTo(2, 1); |
| 2642 | path.close(); |
| 2643 | path.moveTo(0, 0); |
| 2644 | path.lineTo(0, 0); |
| 2645 | path.quadTo(2, 1, 0, 2); |
| 2646 | path.close(); |
| 2647 | testSimplifyx(path); |
| 2648 | } |
| 2649 | |
| 2650 | static void testQuadratic28() { |
| 2651 | SkPath path; |
| 2652 | path.moveTo(0, 0); |
| 2653 | path.quadTo(1, 0, 0, 1); |
| 2654 | path.lineTo(0, 1); |
| 2655 | path.close(); |
| 2656 | path.moveTo(0, 0); |
| 2657 | path.lineTo(0, 2); |
| 2658 | path.quadTo(1, 2, 0, 3); |
| 2659 | path.close(); |
| 2660 | testSimplifyx(path); |
| 2661 | } |
| 2662 | |
caryclark@google.com | d168874 | 2012-09-18 20:08:37 +0000 | [diff] [blame] | 2663 | static void testQuadratic29() { |
| 2664 | SkPath path; |
| 2665 | path.moveTo(0, 0); |
| 2666 | path.quadTo(1, 0, 2, 1); |
| 2667 | path.lineTo(0, 2); |
| 2668 | path.close(); |
| 2669 | path.moveTo(0, 0); |
| 2670 | path.lineTo(0, 0); |
| 2671 | path.quadTo(1, 0, 0, 1); |
| 2672 | path.close(); |
| 2673 | testSimplifyx(path); |
| 2674 | } |
| 2675 | |
| 2676 | static void testQuadratic30() { |
| 2677 | SkPath path; |
| 2678 | path.moveTo(0, 0); |
| 2679 | path.quadTo(1, 0, 1, 2); |
| 2680 | path.lineTo(1, 2); |
| 2681 | path.close(); |
| 2682 | path.moveTo(0, 0); |
| 2683 | path.lineTo(1, 0); |
| 2684 | path.quadTo(0, 1, 1, 2); |
| 2685 | path.close(); |
| 2686 | testSimplifyx(path); |
| 2687 | } |
| 2688 | |
| 2689 | static void testQuadratic31() { |
| 2690 | SkPath path; |
| 2691 | path.moveTo(0, 0); |
| 2692 | path.quadTo(1, 0, 1, 2); |
| 2693 | path.lineTo(1, 2); |
| 2694 | path.close(); |
| 2695 | path.moveTo(0, 0); |
| 2696 | path.lineTo(1, 0); |
| 2697 | path.quadTo(0, 1, 1, 3); |
| 2698 | path.close(); |
| 2699 | testSimplifyx(path); |
| 2700 | } |
| 2701 | |
| 2702 | static void testQuadratic32() { |
| 2703 | SkPath path; |
| 2704 | path.moveTo(0, 0); |
| 2705 | path.quadTo(1, 0, 2, 3); |
| 2706 | path.lineTo(2, 3); |
| 2707 | path.close(); |
| 2708 | path.moveTo(0, 0); |
| 2709 | path.lineTo(0, 0); |
| 2710 | path.quadTo(3, 1, 0, 2); |
| 2711 | path.close(); |
| 2712 | testSimplifyx(path); |
| 2713 | } |
| 2714 | |
| 2715 | static void testQuadratic33() { |
| 2716 | SkPath path; |
| 2717 | path.moveTo(0, 0); |
| 2718 | path.quadTo(2, 0, 0, 1); |
| 2719 | path.lineTo(0, 1); |
| 2720 | path.close(); |
| 2721 | path.moveTo(0, 0); |
| 2722 | path.lineTo(1, 1); |
| 2723 | path.quadTo(2, 1, 2, 2); |
| 2724 | path.close(); |
| 2725 | testSimplifyx(path); |
| 2726 | } |
| 2727 | |
| 2728 | static void testQuadratic34() { |
| 2729 | SkPath path; |
| 2730 | path.moveTo(0, 0); |
| 2731 | path.quadTo(2, 0, 0, 1); |
| 2732 | path.lineTo(0, 1); |
| 2733 | path.close(); |
| 2734 | path.moveTo(1, 0); |
| 2735 | path.lineTo(1, 1); |
| 2736 | path.quadTo(2, 1, 1, 2); |
| 2737 | path.close(); |
| 2738 | testSimplifyx(path); |
| 2739 | } |
| 2740 | |
| 2741 | static void testQuadratic35() { |
| 2742 | SkPath path; |
| 2743 | path.moveTo(0, 0); |
| 2744 | path.quadTo(0, 1, 1, 1); |
| 2745 | path.lineTo(1, 3); |
| 2746 | path.close(); |
| 2747 | path.moveTo(2, 0); |
| 2748 | path.lineTo(3, 0); |
| 2749 | path.quadTo(0, 1, 1, 1); |
| 2750 | path.close(); |
| 2751 | testSimplifyx(path); |
| 2752 | } |
| 2753 | |
| 2754 | static void testQuadratic36() { |
| 2755 | SkPath path; |
| 2756 | path.moveTo(0, 0); |
| 2757 | path.quadTo(2, 1, 2, 3); |
| 2758 | path.lineTo(2, 3); |
| 2759 | path.close(); |
| 2760 | path.moveTo(3, 1); |
| 2761 | path.lineTo(1, 2); |
| 2762 | path.quadTo(3, 2, 1, 3); |
| 2763 | path.close(); |
| 2764 | testSimplifyx(path); |
| 2765 | } |
| 2766 | |
| 2767 | static void testQuadratic37() { |
| 2768 | SkPath path; |
| 2769 | path.moveTo(0, 0); |
| 2770 | path.quadTo(0, 2, 1, 2); |
| 2771 | path.lineTo(1, 2); |
| 2772 | path.close(); |
| 2773 | path.moveTo(0, 0); |
| 2774 | path.lineTo(3, 1); |
| 2775 | path.quadTo(0, 2, 1, 2); |
| 2776 | path.close(); |
| 2777 | testSimplifyx(path); |
| 2778 | } |
| 2779 | |
| 2780 | static void testQuadratic38() { |
| 2781 | SkPath path; |
| 2782 | path.moveTo(1, 0); |
| 2783 | path.quadTo(0, 1, 1, 1); |
| 2784 | path.lineTo(1, 1); |
| 2785 | path.close(); |
| 2786 | path.moveTo(1, 0); |
| 2787 | path.lineTo(1, 2); |
| 2788 | path.quadTo(2, 2, 1, 3); |
| 2789 | path.close(); |
| 2790 | testSimplifyx(path); |
| 2791 | } |
| 2792 | |
caryclark@google.com | fb51afb | 2012-10-19 15:54:16 +0000 | [diff] [blame] | 2793 | static void testQuadratic51() { |
| 2794 | SkPath path; |
| 2795 | path.moveTo(369.863983f, 145.645813f); |
| 2796 | path.quadTo(382.380371f, 121.254936f, 406.236359f, 121.254936f); |
| 2797 | path.lineTo(369.863983f, 145.645813f); |
| 2798 | path.close(); |
| 2799 | path.moveTo(369.970581f, 137.94342f); |
| 2800 | path.quadTo(383.98465f, 121.254936f, 406.235992f, 121.254936f); |
| 2801 | path.lineTo(369.970581f, 137.94342f); |
| 2802 | path.close(); |
| 2803 | testSimplifyx(path); |
| 2804 | } |
| 2805 | |
caryclark@google.com | f839c03 | 2012-10-26 21:03:50 +0000 | [diff] [blame] | 2806 | static void testQuadratic53() { |
| 2807 | SkPath path; |
| 2808 | path.moveTo(303.12088f, 141.299606f); |
| 2809 | path.lineTo(330.463562f, 217.659027f); |
| 2810 | path.lineTo(303.12088f, 141.299606f); |
| 2811 | path.close(); |
| 2812 | path.moveTo(371.919067f, 205.854996f); |
| 2813 | path.lineTo(326.236786f, 205.854996f); |
| 2814 | path.quadTo(329.104431f, 231.663818f, 351.512085f, 231.663818f); |
| 2815 | path.lineTo(371.919067f, 205.854996f); |
| 2816 | path.close(); |
| 2817 | testSimplifyx(path); |
| 2818 | } |
| 2819 | static void testQuadratic55() { |
| 2820 | SkPath path; |
| 2821 | path.moveTo(303.12088f, 141.299606f); |
| 2822 | path.lineTo(330.463562f, 217.659027f); |
| 2823 | path.lineTo(358.606506f, 141.299606f); |
| 2824 | path.lineTo(303.12088f, 141.299606f); |
| 2825 | path.close(); |
| 2826 | path.moveTo(326.236786f, 205.854996f); |
| 2827 | path.quadTo(329.104431f, 231.663818f, 351.512085f, 231.663818f); |
| 2828 | path.lineTo(326.236786f, 205.854996f); |
| 2829 | path.close(); |
| 2830 | testSimplifyx(path); |
| 2831 | } |
| 2832 | |
| 2833 | static void testQuadratic56() { |
| 2834 | SkPath path; |
| 2835 | path.moveTo(366.608826f, 151.196014f); |
| 2836 | path.quadTo(378.803101f, 136.674606f, 398.164948f, 136.674606f); |
| 2837 | path.lineTo(354.009216f, 208.816208f); |
| 2838 | path.lineTo(393.291473f, 102.232819f); |
| 2839 | path.lineTo(359.978058f, 136.581512f); |
| 2840 | path.quadTo(378.315979f, 136.581512f, 388.322723f, 149.613556f); |
| 2841 | path.lineTo(364.390686f, 157.898193f); |
| 2842 | path.quadTo(375.281769f, 136.674606f, 396.039917f, 136.674606f); |
| 2843 | path.lineTo(350, 120); |
| 2844 | path.lineTo(366.608826f, 151.196014f); |
| 2845 | path.close(); |
| 2846 | testSimplifyx(path); |
| 2847 | } |
| 2848 | |
| 2849 | static void testLine80() { |
| 2850 | SkPath path; |
| 2851 | path.moveTo(4, 0); |
| 2852 | path.lineTo(3, 7); |
| 2853 | path.lineTo(7, 5); |
| 2854 | path.lineTo(2, 2); |
| 2855 | path.close(); |
| 2856 | path.moveTo(0, 6); |
| 2857 | path.lineTo(6, 12); |
| 2858 | path.lineTo(8, 3); |
| 2859 | path.close(); |
| 2860 | testSimplifyx(path); |
| 2861 | } |
| 2862 | |
| 2863 | static void testQuadratic58() { |
| 2864 | SkPath path; |
| 2865 | path.moveTo(283.714233f, 240); |
| 2866 | path.lineTo(283.714233f, 141.299606f); |
| 2867 | path.lineTo(303.12088f, 141.299606f); |
| 2868 | path.lineTo(330.463562f, 217.659027f); |
| 2869 | path.lineTo(358.606506f, 141.299606f); |
| 2870 | path.lineTo(362.874634f, 159.705902f); |
| 2871 | path.lineTo(335.665344f, 233.397751f); |
| 2872 | path.lineTo(322.12738f, 233.397751f); |
| 2873 | path.lineTo(295.718353f, 159.505829f); |
| 2874 | path.lineTo(295.718353f, 240); |
| 2875 | path.lineTo(283.714233f, 240); |
| 2876 | path.close(); |
| 2877 | path.moveTo(322.935669f, 231.030273f); |
| 2878 | path.quadTo(312.832214f, 220.393295f, 312.832214f, 203.454178f); |
| 2879 | path.quadTo(312.832214f, 186.981888f, 321.73526f, 176.444946f); |
| 2880 | path.quadTo(330.638306f, 165.90802f, 344.509705f, 165.90802f); |
| 2881 | path.quadTo(357.647522f, 165.90802f, 364.81665f, 175.244537f); |
| 2882 | path.lineTo(371.919067f, 205.854996f); |
| 2883 | path.lineTo(326.236786f, 205.854996f); |
| 2884 | path.quadTo(329.104431f, 231.663818f, 351.512085f, 231.663818f); |
| 2885 | path.lineTo(322.935669f, 231.030273f); |
| 2886 | path.close(); |
| 2887 | path.moveTo(326.837006f, 195.984955f); |
| 2888 | path.lineTo(358.78125f, 195.984955f); |
| 2889 | path.quadTo(358.78125f, 175.778046f, 343.709442f, 175.778046f); |
| 2890 | path.quadTo(328.570923f, 175.778046f, 326.837006f, 195.984955f); |
| 2891 | path.close(); |
| 2892 | testSimplifyx(path); |
| 2893 | } |
| 2894 | |
caryclark@google.com | e7bd5f4 | 2012-12-13 19:47:53 +0000 | [diff] [blame] | 2895 | static void testQuadratic59x() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 2896 | SkPath path; |
caryclark@google.com | e7bd5f4 | 2012-12-13 19:47:53 +0000 | [diff] [blame] | 2897 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 2898 | path.moveTo(0, 0); |
| 2899 | path.quadTo(0, 0, 0, 0); |
| 2900 | path.lineTo(2, 2); |
| 2901 | path.close(); |
| 2902 | path.moveTo(0, 0); |
| 2903 | path.lineTo(2, 0); |
| 2904 | path.quadTo(3, 1, 1, 2); |
| 2905 | path.close(); |
| 2906 | testSimplifyx(path); |
| 2907 | } |
| 2908 | |
| 2909 | static void testQuadratic59() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 2910 | SkPath path; |
caryclark@google.com | e7bd5f4 | 2012-12-13 19:47:53 +0000 | [diff] [blame] | 2911 | path.setFillType(SkPath::kWinding_FillType); |
| 2912 | path.moveTo(0, 0); |
| 2913 | path.quadTo(0, 0, 0, 0); |
| 2914 | path.lineTo(2, 2); |
| 2915 | path.close(); |
| 2916 | path.moveTo(0, 0); |
| 2917 | path.lineTo(2, 0); |
| 2918 | path.quadTo(3, 1, 1, 2); |
| 2919 | path.close(); |
| 2920 | testSimplifyx(path); |
| 2921 | } |
| 2922 | |
| 2923 | static void testQuadratic63() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 2924 | SkPath path; |
caryclark@google.com | e7bd5f4 | 2012-12-13 19:47:53 +0000 | [diff] [blame] | 2925 | path.moveTo(0, 0); |
| 2926 | path.quadTo(0, 0, 0, 0); |
| 2927 | path.lineTo(3, 2); |
| 2928 | path.close(); |
| 2929 | path.moveTo(1, 0); |
| 2930 | path.lineTo(2, 1); |
| 2931 | path.quadTo(2, 1, 2, 2); |
| 2932 | path.close(); |
| 2933 | testSimplifyx(path); |
| 2934 | } |
| 2935 | |
| 2936 | static void testQuadratic64() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 2937 | SkPath path; |
caryclark@google.com | e7bd5f4 | 2012-12-13 19:47:53 +0000 | [diff] [blame] | 2938 | path.moveTo(0, 0); |
| 2939 | path.quadTo(0, 0, 0, 0); |
| 2940 | path.lineTo(2, 3); |
| 2941 | path.close(); |
| 2942 | path.moveTo(1, 2); |
| 2943 | path.lineTo(2, 2); |
| 2944 | path.quadTo(0, 3, 3, 3); |
| 2945 | path.close(); |
| 2946 | testSimplifyx(path); |
| 2947 | } |
| 2948 | |
| 2949 | static void testQuadratic65() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 2950 | SkPath path; |
caryclark@google.com | e7bd5f4 | 2012-12-13 19:47:53 +0000 | [diff] [blame] | 2951 | path.moveTo(0, 0); |
| 2952 | path.quadTo(0, 0, 0, 0); |
| 2953 | path.lineTo(3, 2); |
| 2954 | path.close(); |
| 2955 | path.moveTo(2, 1); |
| 2956 | path.lineTo(2, 2); |
| 2957 | path.quadTo(0, 3, 1, 3); |
| 2958 | path.close(); |
| 2959 | testSimplifyx(path); |
| 2960 | } |
| 2961 | |
| 2962 | static void testQuadratic67x() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 2963 | SkPath path; |
caryclark@google.com | e7bd5f4 | 2012-12-13 19:47:53 +0000 | [diff] [blame] | 2964 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 2965 | path.moveTo(0, 0); |
| 2966 | path.quadTo(0, 0, 2, 1); |
| 2967 | path.lineTo(2, 2); |
| 2968 | path.close(); |
| 2969 | path.moveTo(0, 0); |
| 2970 | path.lineTo(2, 0); |
| 2971 | path.quadTo(1, 1, 3, 2); |
| 2972 | path.close(); |
| 2973 | testSimplifyx(path); |
| 2974 | } |
| 2975 | |
| 2976 | static void testQuadratic68() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 2977 | SkPath path; |
caryclark@google.com | e7bd5f4 | 2012-12-13 19:47:53 +0000 | [diff] [blame] | 2978 | path.moveTo(0, 0); |
| 2979 | path.quadTo(1, 0, 0, 1); |
| 2980 | path.lineTo(1, 2); |
| 2981 | path.close(); |
| 2982 | path.moveTo(0, 0); |
| 2983 | path.lineTo(0, 0); |
| 2984 | path.quadTo(0, 1, 2, 1); |
| 2985 | path.close(); |
| 2986 | testSimplifyx(path); |
| 2987 | } |
| 2988 | |
| 2989 | static void testQuadratic69() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 2990 | SkPath path; |
caryclark@google.com | e7bd5f4 | 2012-12-13 19:47:53 +0000 | [diff] [blame] | 2991 | path.moveTo(0, 0); |
| 2992 | path.quadTo(0, 0, 0, 1); |
| 2993 | path.lineTo(3, 2); |
| 2994 | path.close(); |
| 2995 | path.moveTo(2, 0); |
| 2996 | path.lineTo(1, 1); |
| 2997 | path.quadTo(3, 2, 2, 3); |
| 2998 | path.close(); |
| 2999 | testSimplifyx(path); |
| 3000 | } |
| 3001 | |
| 3002 | static void testQuadratic70x() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3003 | SkPath path; |
caryclark@google.com | e7bd5f4 | 2012-12-13 19:47:53 +0000 | [diff] [blame] | 3004 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 3005 | path.moveTo(0, 0); |
| 3006 | path.quadTo(1, 0, 0, 1); |
| 3007 | path.lineTo(1, 2); |
| 3008 | path.close(); |
| 3009 | path.moveTo(0, 0); |
| 3010 | path.lineTo(0, 0); |
| 3011 | path.quadTo(0, 1, 2, 1); |
| 3012 | path.close(); |
| 3013 | testSimplifyx(path); |
| 3014 | } |
| 3015 | |
| 3016 | static void testQuadratic71() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3017 | SkPath path; |
caryclark@google.com | e7bd5f4 | 2012-12-13 19:47:53 +0000 | [diff] [blame] | 3018 | path.moveTo(0, 0); |
| 3019 | path.quadTo(1, 0, 1, 1); |
| 3020 | path.lineTo(3, 2); |
| 3021 | path.close(); |
| 3022 | path.moveTo(0, 0); |
| 3023 | path.lineTo(0, 0); |
| 3024 | path.quadTo(1, 1, 3, 1); |
| 3025 | path.close(); |
| 3026 | testSimplifyx(path); |
| 3027 | } |
| 3028 | |
| 3029 | static void testQuadratic72() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3030 | SkPath path; |
caryclark@google.com | e7bd5f4 | 2012-12-13 19:47:53 +0000 | [diff] [blame] | 3031 | path.moveTo(0, 0); |
| 3032 | path.quadTo(1, 0, 1, 2); |
| 3033 | path.lineTo(1, 2); |
| 3034 | path.close(); |
| 3035 | path.moveTo(0, 0); |
| 3036 | path.lineTo(1, 0); |
| 3037 | path.quadTo(0, 1, 3, 2); |
| 3038 | path.close(); |
| 3039 | testSimplifyx(path); |
| 3040 | } |
| 3041 | |
| 3042 | static void testQuadratic73() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3043 | SkPath path; |
caryclark@google.com | e7bd5f4 | 2012-12-13 19:47:53 +0000 | [diff] [blame] | 3044 | path.moveTo(0, 0); |
| 3045 | path.quadTo(1, 0, 0, 3); |
| 3046 | path.lineTo(0, 3); |
| 3047 | path.close(); |
| 3048 | path.moveTo(0, 0); |
| 3049 | path.lineTo(1, 0); |
| 3050 | path.quadTo(0, 1, 1, 1); |
| 3051 | path.close(); |
| 3052 | testSimplifyx(path); |
| 3053 | } |
| 3054 | |
| 3055 | static void testQuadratic74() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3056 | SkPath path; |
caryclark@google.com | e7bd5f4 | 2012-12-13 19:47:53 +0000 | [diff] [blame] | 3057 | path.moveTo(0, 0); |
| 3058 | path.quadTo(1, 0, 1, 3); |
| 3059 | path.lineTo(1, 3); |
| 3060 | path.close(); |
| 3061 | path.moveTo(0, 0); |
| 3062 | path.lineTo(0, 1); |
| 3063 | path.quadTo(3, 2, 2, 3); |
| 3064 | path.close(); |
| 3065 | testSimplifyx(path); |
| 3066 | } |
| 3067 | |
| 3068 | static void testQuadratic75() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3069 | SkPath path; |
caryclark@google.com | e7bd5f4 | 2012-12-13 19:47:53 +0000 | [diff] [blame] | 3070 | path.moveTo(0, 0); |
| 3071 | path.quadTo(1, 0, 1, 3); |
| 3072 | path.lineTo(2, 3); |
| 3073 | path.close(); |
| 3074 | path.moveTo(0, 0); |
| 3075 | path.lineTo(0, 1); |
| 3076 | path.quadTo(3, 2, 2, 3); |
| 3077 | path.close(); |
| 3078 | testSimplifyx(path); |
| 3079 | } |
| 3080 | |
caryclark@google.com | db0b3e0 | 2012-12-21 21:34:36 +0000 | [diff] [blame] | 3081 | static void testQuadratic76() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3082 | SkPath path; |
caryclark@google.com | db0b3e0 | 2012-12-21 21:34:36 +0000 | [diff] [blame] | 3083 | path.moveTo(0, 0); |
| 3084 | path.quadTo(0, 0, 0, 0); |
| 3085 | path.lineTo(2, 3); |
| 3086 | path.close(); |
| 3087 | path.moveTo(1, 0); |
| 3088 | path.lineTo(1, 2); |
| 3089 | path.quadTo(1, 2, 2, 2); |
| 3090 | path.close(); |
| 3091 | testSimplifyx(path); |
| 3092 | } |
| 3093 | |
| 3094 | static void testQuadratic77() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3095 | SkPath path; |
caryclark@google.com | db0b3e0 | 2012-12-21 21:34:36 +0000 | [diff] [blame] | 3096 | path.moveTo(0, 0); |
| 3097 | path.quadTo(1, 0, 1, 1); |
| 3098 | path.lineTo(3, 1); |
| 3099 | path.close(); |
| 3100 | path.moveTo(0, 0); |
| 3101 | path.lineTo(1, 0); |
| 3102 | path.quadTo(0, 1, 3, 2); |
| 3103 | path.close(); |
| 3104 | testSimplifyx(path); |
| 3105 | } |
| 3106 | |
| 3107 | static void testQuadratic78() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3108 | SkPath path; |
caryclark@google.com | db0b3e0 | 2012-12-21 21:34:36 +0000 | [diff] [blame] | 3109 | path.moveTo(0, 0); |
| 3110 | path.quadTo(1, 0, 1, 2); |
| 3111 | path.lineTo(3, 2); |
| 3112 | path.close(); |
| 3113 | path.moveTo(0, 0); |
| 3114 | path.lineTo(0, 0); |
| 3115 | path.quadTo(2, 1, 0, 2); |
| 3116 | path.close(); |
| 3117 | testSimplifyx(path); |
| 3118 | } |
| 3119 | |
| 3120 | static void testQuadratic79() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3121 | SkPath path; |
caryclark@google.com | db0b3e0 | 2012-12-21 21:34:36 +0000 | [diff] [blame] | 3122 | path.moveTo(0, 0); |
| 3123 | path.quadTo(1, 0, 1, 2); |
| 3124 | path.lineTo(3, 2); |
| 3125 | path.close(); |
| 3126 | path.moveTo(0, 0); |
| 3127 | path.lineTo(1, 0); |
| 3128 | path.quadTo(0, 1, 3, 2); |
| 3129 | path.close(); |
| 3130 | testSimplifyx(path); |
| 3131 | } |
| 3132 | |
| 3133 | static void testEight1() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3134 | SkPath path; |
caryclark@google.com | db0b3e0 | 2012-12-21 21:34:36 +0000 | [diff] [blame] | 3135 | path.moveTo(0, 0); |
| 3136 | path.lineTo(2, 2); |
| 3137 | path.lineTo(0, 2); |
| 3138 | path.lineTo(2, 0); |
| 3139 | path.close(); |
| 3140 | testSimplifyx(path); |
| 3141 | } |
| 3142 | |
| 3143 | static void testEight2() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3144 | SkPath path; |
caryclark@google.com | db0b3e0 | 2012-12-21 21:34:36 +0000 | [diff] [blame] | 3145 | path.moveTo(0, 0); |
| 3146 | path.lineTo(2, 0); |
| 3147 | path.lineTo(0, 2); |
| 3148 | path.lineTo(2, 2); |
| 3149 | path.close(); |
| 3150 | testSimplifyx(path); |
| 3151 | } |
| 3152 | |
| 3153 | static void testEight3() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3154 | SkPath path; |
caryclark@google.com | db0b3e0 | 2012-12-21 21:34:36 +0000 | [diff] [blame] | 3155 | path.moveTo(0, 0); |
| 3156 | path.lineTo(0, 2); |
| 3157 | path.lineTo(2, 0); |
| 3158 | path.lineTo(2, 2); |
| 3159 | path.close(); |
| 3160 | testSimplifyx(path); |
| 3161 | } |
| 3162 | |
| 3163 | static void testEight4() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3164 | SkPath path; |
caryclark@google.com | db0b3e0 | 2012-12-21 21:34:36 +0000 | [diff] [blame] | 3165 | path.moveTo(0, 0); |
| 3166 | path.lineTo(2, 2); |
| 3167 | path.lineTo(2, 0); |
| 3168 | path.lineTo(0, 2); |
| 3169 | path.close(); |
| 3170 | testSimplifyx(path); |
| 3171 | } |
| 3172 | |
| 3173 | static void testEight5() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3174 | SkPath path; |
caryclark@google.com | db0b3e0 | 2012-12-21 21:34:36 +0000 | [diff] [blame] | 3175 | path.moveTo(1, 0); |
| 3176 | path.lineTo(1, 2); |
| 3177 | path.lineTo(0, 2); |
| 3178 | path.lineTo(2, 0); |
| 3179 | path.close(); |
| 3180 | testSimplifyx(path); |
| 3181 | } |
| 3182 | |
| 3183 | static void testEight6() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3184 | SkPath path; |
caryclark@google.com | db0b3e0 | 2012-12-21 21:34:36 +0000 | [diff] [blame] | 3185 | path.moveTo(1, 0); |
| 3186 | path.lineTo(2, 0); |
| 3187 | path.lineTo(0, 2); |
| 3188 | path.lineTo(1, 2); |
| 3189 | path.close(); |
| 3190 | testSimplifyx(path); |
| 3191 | } |
| 3192 | |
| 3193 | static void testEight7() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3194 | SkPath path; |
caryclark@google.com | db0b3e0 | 2012-12-21 21:34:36 +0000 | [diff] [blame] | 3195 | path.moveTo(0, 0); |
| 3196 | path.lineTo(0, 1); |
| 3197 | path.lineTo(2, 1); |
| 3198 | path.lineTo(2, 2); |
| 3199 | path.close(); |
| 3200 | testSimplifyx(path); |
| 3201 | } |
| 3202 | |
| 3203 | static void testEight8() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3204 | SkPath path; |
caryclark@google.com | db0b3e0 | 2012-12-21 21:34:36 +0000 | [diff] [blame] | 3205 | path.moveTo(0, 0); |
| 3206 | path.lineTo(2, 2); |
| 3207 | path.lineTo(2, 1); |
| 3208 | path.lineTo(0, 1); |
| 3209 | path.close(); |
| 3210 | testSimplifyx(path); |
| 3211 | } |
| 3212 | |
| 3213 | static void testEight9() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3214 | SkPath path; |
caryclark@google.com | db0b3e0 | 2012-12-21 21:34:36 +0000 | [diff] [blame] | 3215 | path.moveTo(1, 0); |
| 3216 | path.lineTo(1, 2); |
| 3217 | path.lineTo(2, 1); |
| 3218 | path.lineTo(0, 1); |
| 3219 | path.close(); |
| 3220 | testSimplifyx(path); |
| 3221 | } |
| 3222 | |
| 3223 | static void testEight10() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3224 | SkPath path; |
caryclark@google.com | db0b3e0 | 2012-12-21 21:34:36 +0000 | [diff] [blame] | 3225 | path.moveTo(1, 0); |
| 3226 | path.lineTo(0, 1); |
| 3227 | path.lineTo(2, 1); |
| 3228 | path.lineTo(1, 2); |
| 3229 | path.close(); |
| 3230 | testSimplifyx(path); |
| 3231 | } |
| 3232 | |
| 3233 | static void testQuadratic80() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3234 | SkPath path; |
caryclark@google.com | db0b3e0 | 2012-12-21 21:34:36 +0000 | [diff] [blame] | 3235 | path.moveTo(0, 0); |
| 3236 | path.quadTo(1, 0, 2, 3); |
| 3237 | path.lineTo(2, 3); |
| 3238 | path.close(); |
| 3239 | path.moveTo(1, 0); |
| 3240 | path.lineTo(3, 0); |
| 3241 | path.quadTo(0, 1, 1, 1); |
| 3242 | path.close(); |
| 3243 | testSimplifyx(path); |
| 3244 | } |
| 3245 | |
| 3246 | static void testQuadratic81() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3247 | SkPath path; |
caryclark@google.com | db0b3e0 | 2012-12-21 21:34:36 +0000 | [diff] [blame] | 3248 | path.moveTo(0, 0); |
| 3249 | path.quadTo(2, 0, 1, 1); |
| 3250 | path.lineTo(1, 1); |
| 3251 | path.close(); |
| 3252 | path.moveTo(0, 0); |
| 3253 | path.lineTo(0, 0); |
| 3254 | path.quadTo(2, 1, 0, 2); |
| 3255 | path.close(); |
| 3256 | testSimplifyx(path); |
| 3257 | } |
| 3258 | |
| 3259 | static void testQuadratic82() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3260 | SkPath path; |
caryclark@google.com | db0b3e0 | 2012-12-21 21:34:36 +0000 | [diff] [blame] | 3261 | path.moveTo(0, 0); |
| 3262 | path.quadTo(2, 0, 1, 1); |
| 3263 | path.lineTo(0, 3); |
| 3264 | path.close(); |
| 3265 | path.moveTo(0, 0); |
| 3266 | path.lineTo(0, 0); |
| 3267 | path.quadTo(2, 1, 0, 2); |
| 3268 | path.close(); |
| 3269 | testSimplifyx(path); |
| 3270 | } |
| 3271 | |
caryclark@google.com | 3586ece | 2012-12-27 18:46:58 +0000 | [diff] [blame] | 3272 | static void testQuadratic83() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3273 | SkPath path; |
caryclark@google.com | 3586ece | 2012-12-27 18:46:58 +0000 | [diff] [blame] | 3274 | path.moveTo(0, 0); |
| 3275 | path.quadTo(0, 0, 2, 0); |
| 3276 | path.lineTo(2, 2); |
| 3277 | path.close(); |
| 3278 | path.moveTo(0, 1); |
| 3279 | path.lineTo(0, 2); |
| 3280 | path.quadTo(2, 2, 1, 3); |
| 3281 | path.close(); |
| 3282 | testSimplifyx(path); |
| 3283 | } |
| 3284 | |
caryclark@google.com | 10227bf | 2012-12-28 22:10:41 +0000 | [diff] [blame] | 3285 | static void testQuadratic84() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3286 | SkPath path; |
caryclark@google.com | 10227bf | 2012-12-28 22:10:41 +0000 | [diff] [blame] | 3287 | path.moveTo(0, 0); |
| 3288 | path.quadTo(2, 0, 1, 1); |
| 3289 | path.lineTo(2, 1); |
| 3290 | path.close(); |
| 3291 | path.moveTo(1, 0); |
| 3292 | path.lineTo(2, 0); |
| 3293 | path.quadTo(0, 1, 2, 2); |
| 3294 | path.close(); |
| 3295 | testSimplifyx(path); |
| 3296 | } |
| 3297 | |
| 3298 | static void testQuadratic85() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3299 | SkPath path; |
caryclark@google.com | 10227bf | 2012-12-28 22:10:41 +0000 | [diff] [blame] | 3300 | path.moveTo(0, 0); |
| 3301 | path.quadTo(3, 0, 1, 1); |
| 3302 | path.lineTo(1, 1); |
| 3303 | path.close(); |
| 3304 | path.moveTo(1, 0); |
| 3305 | path.lineTo(3, 0); |
| 3306 | path.quadTo(0, 1, 1, 2); |
| 3307 | path.close(); |
| 3308 | testSimplifyx(path); |
| 3309 | } |
| 3310 | |
| 3311 | static void testQuadratic86() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3312 | SkPath path; |
caryclark@google.com | 10227bf | 2012-12-28 22:10:41 +0000 | [diff] [blame] | 3313 | path.moveTo(0, 0); |
| 3314 | path.quadTo(0, 1, 1, 1); |
| 3315 | path.lineTo(2, 3); |
| 3316 | path.close(); |
| 3317 | path.moveTo(0, 0); |
| 3318 | path.lineTo(0, 0); |
| 3319 | path.quadTo(1, 1, 1, 3); |
| 3320 | path.close(); |
| 3321 | testSimplifyx(path); |
| 3322 | } |
| 3323 | |
| 3324 | static void testQuadratic87() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3325 | SkPath path; |
caryclark@google.com | 10227bf | 2012-12-28 22:10:41 +0000 | [diff] [blame] | 3326 | path.moveTo(0, 0); |
| 3327 | path.quadTo(2, 1, 0, 2); |
| 3328 | path.lineTo(2, 3); |
| 3329 | path.close(); |
| 3330 | path.moveTo(0, 0); |
| 3331 | path.lineTo(1, 1); |
| 3332 | path.quadTo(0, 2, 3, 2); |
| 3333 | path.close(); |
| 3334 | testSimplifyx(path); |
| 3335 | } |
| 3336 | |
| 3337 | static void testQuadratic88() { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3338 | SkPath path; |
caryclark@google.com | 10227bf | 2012-12-28 22:10:41 +0000 | [diff] [blame] | 3339 | path.moveTo(0, 0); |
| 3340 | path.quadTo(2, 1, 0, 2); |
| 3341 | path.lineTo(2, 2); |
| 3342 | path.close(); |
| 3343 | path.moveTo(1, 0); |
| 3344 | path.lineTo(1, 1); |
| 3345 | path.quadTo(0, 2, 2, 2); |
| 3346 | path.close(); |
| 3347 | testSimplifyx(path); |
| 3348 | } |
| 3349 | |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3350 | static void testQuadratic89x() { |
| 3351 | SkPath path; |
| 3352 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 3353 | path.moveTo(0, 0); |
| 3354 | path.quadTo(3, 1, 2, 2); |
| 3355 | path.lineTo(0, 3); |
| 3356 | path.close(); |
| 3357 | path.moveTo(0, 0); |
| 3358 | path.lineTo(2, 1); |
| 3359 | path.quadTo(3, 1, 3, 3); |
| 3360 | path.close(); |
| 3361 | testSimplifyx(path); |
| 3362 | } |
| 3363 | |
| 3364 | static void testQuadratic90x() { |
| 3365 | SkPath path; |
| 3366 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 3367 | path.moveTo(0, 0); |
| 3368 | path.quadTo(3, 0, 2, 2); |
| 3369 | path.lineTo(1, 3); |
| 3370 | path.close(); |
| 3371 | path.moveTo(0, 0); |
| 3372 | path.lineTo(0, 1); |
| 3373 | path.quadTo(3, 2, 2, 3); |
| 3374 | path.close(); |
| 3375 | testSimplifyx(path); |
| 3376 | } |
| 3377 | |
| 3378 | static void testQuadratic91() { |
| 3379 | SkPath path; |
| 3380 | path.moveTo(0, 0); |
| 3381 | path.quadTo(3, 2, 2, 3); |
| 3382 | path.lineTo(2, 3); |
| 3383 | path.close(); |
| 3384 | path.moveTo(0, 0); |
| 3385 | path.lineTo(1, 1); |
| 3386 | path.quadTo(2, 1, 2, 3); |
| 3387 | path.close(); |
| 3388 | testSimplifyx(path); |
| 3389 | } |
| 3390 | |
| 3391 | static void testQuadratic92x() { |
| 3392 | SkPath path; |
| 3393 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 3394 | path.moveTo(1, 0); |
| 3395 | path.quadTo(3, 0, 2, 2); |
| 3396 | path.lineTo(2, 2); |
| 3397 | path.close(); |
| 3398 | path.moveTo(2, 0); |
| 3399 | path.lineTo(0, 1); |
| 3400 | path.quadTo(3, 2, 2, 3); |
| 3401 | path.close(); |
| 3402 | testSimplifyx(path); |
| 3403 | } |
| 3404 | |
| 3405 | static void testLine82() { |
| 3406 | SkPath path; |
| 3407 | path.addRect(20, 0, 40, 40, SkPath::kCCW_Direction); |
| 3408 | path.addRect(24, 20, 36, 30, SkPath::kCCW_Direction); |
| 3409 | path.addRect(24, 32, 33, 36, SkPath::kCCW_Direction); |
| 3410 | testSimplifyx(path); |
| 3411 | } |
| 3412 | |
| 3413 | static void testLine82a() { |
| 3414 | SkPath path; |
| 3415 | path.addRect(0, 0, 6, 10, SkPath::kCW_Direction); |
| 3416 | path.addRect(2, 2, 4, 4, SkPath::kCW_Direction); |
| 3417 | path.addRect(2, 6, 4, 8, SkPath::kCW_Direction); |
| 3418 | testSimplifyx(path); |
| 3419 | } |
| 3420 | |
| 3421 | static void testLine82b() { |
| 3422 | SkPath path; |
| 3423 | path.addRect(0, 0, 6, 10, SkPath::kCW_Direction); |
| 3424 | path.addRect(2, 2, 4, 4, SkPath::kCW_Direction); |
| 3425 | path.addRect(2, 6, 4, 8, SkPath::kCCW_Direction); |
| 3426 | testSimplifyx(path); |
| 3427 | } |
| 3428 | |
| 3429 | static void testLine82c() { |
| 3430 | SkPath path; |
| 3431 | path.addRect(0, 0, 6, 10, SkPath::kCW_Direction); |
| 3432 | path.addRect(2, 2, 4, 4, SkPath::kCCW_Direction); |
| 3433 | path.addRect(2, 6, 4, 8, SkPath::kCW_Direction); |
| 3434 | testSimplifyx(path); |
| 3435 | } |
| 3436 | |
| 3437 | static void testLine82d() { |
| 3438 | SkPath path; |
| 3439 | path.addRect(0, 0, 6, 10, SkPath::kCW_Direction); |
| 3440 | path.addRect(2, 2, 4, 4, SkPath::kCCW_Direction); |
| 3441 | path.addRect(2, 6, 4, 8, SkPath::kCCW_Direction); |
| 3442 | testSimplifyx(path); |
| 3443 | } |
| 3444 | |
| 3445 | static void testLine82e() { |
| 3446 | SkPath path; |
| 3447 | path.addRect(0, 0, 6, 10, SkPath::kCCW_Direction); |
| 3448 | path.addRect(2, 2, 4, 4, SkPath::kCW_Direction); |
| 3449 | path.addRect(2, 6, 4, 8, SkPath::kCW_Direction); |
| 3450 | testSimplifyx(path); |
| 3451 | } |
| 3452 | |
| 3453 | static void testLine82f() { |
| 3454 | SkPath path; |
| 3455 | path.addRect(0, 0, 6, 10, SkPath::kCCW_Direction); |
| 3456 | path.addRect(2, 2, 4, 4, SkPath::kCW_Direction); |
| 3457 | path.addRect(2, 6, 4, 8, SkPath::kCCW_Direction); |
| 3458 | testSimplifyx(path); |
| 3459 | } |
| 3460 | |
| 3461 | static void testLine82g() { |
| 3462 | SkPath path; |
| 3463 | path.addRect(0, 0, 6, 10, SkPath::kCCW_Direction); |
| 3464 | path.addRect(2, 2, 4, 4, SkPath::kCCW_Direction); |
| 3465 | path.addRect(2, 6, 4, 8, SkPath::kCW_Direction); |
| 3466 | testSimplifyx(path); |
| 3467 | } |
| 3468 | |
| 3469 | static void testLine82h() { |
| 3470 | SkPath path; |
| 3471 | path.addRect(0, 0, 6, 10, SkPath::kCCW_Direction); |
| 3472 | path.addRect(2, 2, 4, 4, SkPath::kCCW_Direction); |
| 3473 | path.addRect(2, 6, 4, 8, SkPath::kCCW_Direction); |
| 3474 | testSimplifyx(path); |
| 3475 | } |
| 3476 | |
| 3477 | static void testLine83() { |
| 3478 | SkPath path; |
| 3479 | path.addRect(10, 30, 30, 40, SkPath::kCCW_Direction); |
| 3480 | path.addRect(0, 12, 12, 18, SkPath::kCCW_Direction); |
| 3481 | path.addRect(4, 13, 13, 16, SkPath::kCCW_Direction); |
| 3482 | testSimplifyx(path); |
| 3483 | } |
| 3484 | |
| 3485 | static void testLine84() { |
| 3486 | SkPath path; |
| 3487 | path.addRect(0, 12, 60, 30, SkPath::kCCW_Direction); |
| 3488 | path.addRect(10, 20, 40, 30, SkPath::kCW_Direction); |
| 3489 | path.addRect(0, 12, 12, 12, SkPath::kCW_Direction); |
| 3490 | path.addRect(4, 12, 13, 13, SkPath::kCW_Direction); |
| 3491 | testSimplifyx(path); |
| 3492 | } |
| 3493 | |
| 3494 | static void testLine84x() { |
| 3495 | SkPath path; |
| 3496 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 3497 | path.addRect(0, 12, 60, 30, SkPath::kCCW_Direction); |
| 3498 | path.addRect(10, 20, 40, 30, SkPath::kCCW_Direction); |
| 3499 | path.addRect(0, 12, 12, 12, SkPath::kCCW_Direction); |
| 3500 | path.addRect(4, 12, 13, 13, SkPath::kCCW_Direction); |
| 3501 | testSimplifyx(path); |
| 3502 | } |
| 3503 | |
| 3504 | static void testLine85() { |
| 3505 | SkPath path; |
| 3506 | path.addRect(36, 0, 66, 60, SkPath::kCCW_Direction); |
| 3507 | path.addRect(20, 0, 40, 40, SkPath::kCCW_Direction); |
| 3508 | path.addRect(12, 0, 24, 24, SkPath::kCCW_Direction); |
| 3509 | path.addRect(32, 0, 36, 41, SkPath::kCCW_Direction); |
| 3510 | testSimplifyx(path); |
| 3511 | } |
| 3512 | |
| 3513 | static void (*firstTest)() = testLine85; |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 3514 | |
| 3515 | static struct { |
| 3516 | void (*fun)(); |
| 3517 | const char* str; |
| 3518 | } tests[] = { |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 3519 | TEST(testLine85), |
| 3520 | TEST(testLine84), |
| 3521 | TEST(testLine84x), |
| 3522 | TEST(testLine83), |
| 3523 | TEST(testLine82h), |
| 3524 | TEST(testLine82g), |
| 3525 | TEST(testLine82f), |
| 3526 | TEST(testLine82e), |
| 3527 | TEST(testLine82d), |
| 3528 | TEST(testLine82c), |
| 3529 | TEST(testLine82b), |
| 3530 | TEST(testLine82a), |
| 3531 | TEST(testLine82), |
| 3532 | TEST(testQuadratic92x), |
| 3533 | TEST(testQuadratic91), |
| 3534 | TEST(testQuadratic90x), |
| 3535 | TEST(testQuadratic89x), |
caryclark@google.com | 10227bf | 2012-12-28 22:10:41 +0000 | [diff] [blame] | 3536 | TEST(testQuadratic88), |
| 3537 | TEST(testQuadratic87), |
| 3538 | TEST(testQuadratic86), |
| 3539 | TEST(testQuadratic85), |
| 3540 | TEST(testQuadratic84), |
caryclark@google.com | 3586ece | 2012-12-27 18:46:58 +0000 | [diff] [blame] | 3541 | TEST(testQuadratic83), |
caryclark@google.com | db0b3e0 | 2012-12-21 21:34:36 +0000 | [diff] [blame] | 3542 | TEST(testQuadratic82), |
| 3543 | TEST(testQuadratic81), |
| 3544 | TEST(testQuadratic80), |
| 3545 | TEST(testEight1), |
| 3546 | TEST(testEight2), |
| 3547 | TEST(testEight3), |
| 3548 | TEST(testEight4), |
| 3549 | TEST(testEight5), |
| 3550 | TEST(testEight6), |
| 3551 | TEST(testEight7), |
| 3552 | TEST(testEight8), |
| 3553 | TEST(testEight9), |
| 3554 | TEST(testEight10), |
| 3555 | TEST(testQuadratic79), |
| 3556 | TEST(testQuadratic78), |
| 3557 | TEST(testQuadratic77), |
| 3558 | TEST(testQuadratic76), |
| 3559 | TEST(testQuadratic75), |
caryclark@google.com | e7bd5f4 | 2012-12-13 19:47:53 +0000 | [diff] [blame] | 3560 | TEST(testQuadratic74), |
| 3561 | TEST(testQuadratic73), |
| 3562 | TEST(testQuadratic72), |
| 3563 | TEST(testQuadratic71), |
| 3564 | TEST(testQuadratic70x), |
| 3565 | TEST(testQuadratic69), |
skia.committer@gmail.com | 61b05dc | 2012-12-14 02:02:06 +0000 | [diff] [blame] | 3566 | TEST(testQuadratic68), |
caryclark@google.com | e7bd5f4 | 2012-12-13 19:47:53 +0000 | [diff] [blame] | 3567 | TEST(testQuadratic67x), |
| 3568 | TEST(testQuadratic65), |
| 3569 | TEST(testQuadratic64), |
| 3570 | TEST(testQuadratic63), |
| 3571 | TEST(testLine1a), |
| 3572 | TEST(testLine1ax), |
| 3573 | TEST(testQuadratic59), |
| 3574 | TEST(testQuadratic59x), |
caryclark@google.com | f839c03 | 2012-10-26 21:03:50 +0000 | [diff] [blame] | 3575 | TEST(testQuadratic58), |
caryclark@google.com | f839c03 | 2012-10-26 21:03:50 +0000 | [diff] [blame] | 3576 | TEST(testQuadratic56), |
| 3577 | TEST(testQuadratic55), |
| 3578 | TEST(testQuadratic53), |
caryclark@google.com | fb51afb | 2012-10-19 15:54:16 +0000 | [diff] [blame] | 3579 | TEST(testQuadratic51), |
caryclark@google.com | d168874 | 2012-09-18 20:08:37 +0000 | [diff] [blame] | 3580 | TEST(testQuadratic38), |
| 3581 | TEST(testQuadratic37), |
| 3582 | TEST(testQuadratic36), |
| 3583 | TEST(testQuadratic35), |
| 3584 | TEST(testQuadratic34), |
| 3585 | TEST(testQuadratic33), |
| 3586 | TEST(testQuadratic32), |
| 3587 | TEST(testQuadratic31), |
| 3588 | TEST(testQuadratic30), |
| 3589 | TEST(testQuadratic29), |
caryclark@google.com | 235f56a | 2012-09-14 14:19:30 +0000 | [diff] [blame] | 3590 | TEST(testQuadratic28), |
| 3591 | TEST(testQuadratic27), |
| 3592 | TEST(testQuadratic26), |
| 3593 | TEST(testQuadratic25), |
| 3594 | TEST(testQuadratic24), |
| 3595 | TEST(testQuadratic23), |
| 3596 | TEST(testQuadratic22), |
| 3597 | TEST(testQuadratic21), |
caryclark@google.com | 32546db | 2012-08-31 20:55:07 +0000 | [diff] [blame] | 3598 | TEST(testQuadratic20), |
caryclark@google.com | a7e483d | 2012-08-28 20:44:43 +0000 | [diff] [blame] | 3599 | TEST(testQuadratic19), |
caryclark@google.com | 3350c3c | 2012-08-24 15:24:36 +0000 | [diff] [blame] | 3600 | TEST(testQuadratic18), |
| 3601 | TEST(testQuadratic17x), |
| 3602 | TEST(testQuadratic15), |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 3603 | TEST(testQuadratic14), |
| 3604 | TEST(testQuadratic9), |
| 3605 | TEST(testQuadratic8), |
| 3606 | TEST(testQuadratic7), |
| 3607 | TEST(testQuadratic6), |
| 3608 | TEST(testQuadratic5), |
| 3609 | TEST(testQuadratic4x), |
| 3610 | TEST(testQuadratic3x), |
| 3611 | TEST(testQuadratic2x), |
| 3612 | TEST(testQuadratic1x), |
| 3613 | TEST(testQuadratic4), |
caryclark@google.com | 03f9706 | 2012-08-21 13:13:52 +0000 | [diff] [blame] | 3614 | TEST(testQuadratic3), |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 3615 | TEST(testQuadratic2), |
| 3616 | TEST(testQuadratic1), |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 3617 | TEST(testLine4ax), |
| 3618 | TEST(testLine3aax), |
| 3619 | TEST(testLine2ax), |
| 3620 | TEST(testLine1ax), |
| 3621 | TEST(testQuadralateral9x), |
| 3622 | TEST(testQuadralateral8x), |
| 3623 | TEST(testQuadralateral7x), |
| 3624 | TEST(testQuadralateral6x), |
| 3625 | TEST(testQuadralateral6ax), |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 3626 | TEST(testQuadralateral9), |
| 3627 | TEST(testQuadralateral8), |
| 3628 | TEST(testQuadralateral7), |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 3629 | TEST(testQuadralateral6), |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 3630 | TEST(testQuadralateral6a), |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 3631 | TEST(testFauxQuadralateral6dx), |
| 3632 | TEST(testFauxQuadralateral6cx), |
| 3633 | TEST(testFauxQuadralateral6bx), |
| 3634 | TEST(testFauxQuadralateral6ax), |
| 3635 | TEST(testFauxQuadralateral6x), |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 3636 | TEST(testFauxQuadralateral6d), |
| 3637 | TEST(testFauxQuadralateral6c), |
| 3638 | TEST(testFauxQuadralateral6b), |
| 3639 | TEST(testFauxQuadralateral6a), |
| 3640 | TEST(testFauxQuadralateral6), |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 3641 | TEST(testQuadralateral5x), |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 3642 | TEST(testQuadralateral5), |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 3643 | TEST(testNondegenerate4x), |
| 3644 | TEST(testNondegenerate3x), |
| 3645 | TEST(testNondegenerate2x), |
| 3646 | TEST(testNondegenerate1x), |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 3647 | TEST(testNondegenerate4), |
| 3648 | TEST(testNondegenerate3), |
| 3649 | TEST(testNondegenerate2), |
| 3650 | TEST(testNondegenerate1), |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 3651 | TEST(testDegenerate4x), |
| 3652 | TEST(testDegenerate3x), |
| 3653 | TEST(testDegenerate2x), |
| 3654 | TEST(testDegenerate1x), |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 3655 | TEST(testDegenerate4), |
| 3656 | TEST(testDegenerate3), |
| 3657 | TEST(testDegenerate2), |
| 3658 | TEST(testDegenerate1), |
caryclark@google.com | c899ad9 | 2012-08-23 15:24:42 +0000 | [diff] [blame] | 3659 | TEST(testLine79x), |
| 3660 | TEST(testLine78x), |
| 3661 | TEST(testLine77x), |
| 3662 | TEST(testLine76x), |
| 3663 | TEST(testLine75x), |
| 3664 | TEST(testLine74x), |
| 3665 | TEST(testLine73x), |
| 3666 | TEST(testLine72x), |
| 3667 | TEST(testLine71x), |
| 3668 | TEST(testLine70x), |
| 3669 | TEST(testLine69x), |
| 3670 | TEST(testLine68hx), |
| 3671 | TEST(testLine68gx), |
| 3672 | TEST(testLine68fx), |
| 3673 | TEST(testLine68ex), |
| 3674 | TEST(testLine68dx), |
| 3675 | TEST(testLine68cx), |
| 3676 | TEST(testLine68bx), |
| 3677 | TEST(testLine68ax), |
| 3678 | TEST(testLine67x), |
| 3679 | TEST(testLine66x), |
| 3680 | TEST(testLine65x), |
| 3681 | TEST(testLine64x), |
| 3682 | TEST(testLine63x), |
| 3683 | TEST(testLine62x), |
| 3684 | TEST(testLine61x), |
| 3685 | TEST(testLine60x), |
| 3686 | TEST(testLine59x), |
| 3687 | TEST(testLine58x), |
| 3688 | TEST(testLine57x), |
| 3689 | TEST(testLine56x), |
| 3690 | TEST(testLine55x), |
| 3691 | TEST(testLine54x), |
| 3692 | TEST(testLine53x), |
| 3693 | TEST(testLine52x), |
| 3694 | TEST(testLine51x), |
| 3695 | TEST(testLine50x), |
| 3696 | TEST(testLine49x), |
| 3697 | TEST(testLine48x), |
| 3698 | TEST(testLine47x), |
| 3699 | TEST(testLine46x), |
| 3700 | TEST(testLine45x), |
| 3701 | TEST(testLine44x), |
| 3702 | TEST(testLine43x), |
| 3703 | TEST(testLine42x), |
| 3704 | TEST(testLine41x), |
| 3705 | TEST(testLine40x), |
| 3706 | TEST(testLine38x), |
| 3707 | TEST(testLine37x), |
| 3708 | TEST(testLine36x), |
| 3709 | TEST(testLine35x), |
| 3710 | TEST(testLine34x), |
| 3711 | TEST(testLine33x), |
| 3712 | TEST(testLine32x), |
| 3713 | TEST(testLine31x), |
| 3714 | TEST(testLine30x), |
| 3715 | TEST(testLine29x), |
| 3716 | TEST(testLine28x), |
| 3717 | TEST(testLine27x), |
| 3718 | TEST(testLine26x), |
| 3719 | TEST(testLine25x), |
| 3720 | TEST(testLine24ax), |
| 3721 | TEST(testLine24x), |
| 3722 | TEST(testLine23x), |
| 3723 | TEST(testLine22x), |
| 3724 | TEST(testLine21x), |
| 3725 | TEST(testLine20x), |
| 3726 | TEST(testLine19x), |
| 3727 | TEST(testLine18x), |
| 3728 | TEST(testLine17x), |
| 3729 | TEST(testLine16x), |
| 3730 | TEST(testLine15x), |
| 3731 | TEST(testLine14x), |
| 3732 | TEST(testLine13x), |
| 3733 | TEST(testLine12x), |
| 3734 | TEST(testLine11x), |
| 3735 | TEST(testLine10ax), |
| 3736 | TEST(testLine10x), |
| 3737 | TEST(testLine9x), |
| 3738 | TEST(testLine8x), |
| 3739 | TEST(testLine7bx), |
| 3740 | TEST(testLine7ax), |
| 3741 | TEST(testLine7x), |
| 3742 | TEST(testLine6x), |
| 3743 | TEST(testLine5x), |
| 3744 | TEST(testLine4x), |
| 3745 | TEST(testLine3bx), |
| 3746 | TEST(testLine3ax), |
| 3747 | TEST(testLine3x), |
| 3748 | TEST(testLine2x), |
| 3749 | TEST(testLine1x), |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 3750 | TEST(testLine81), |
| 3751 | TEST(testLine80), |
caryclark@google.com | 2ddff93 | 2012-08-07 21:25:27 +0000 | [diff] [blame] | 3752 | TEST(testLine79), |
| 3753 | TEST(testLine78), |
| 3754 | TEST(testLine77), |
| 3755 | TEST(testLine76), |
| 3756 | TEST(testLine75), |
caryclark@google.com | 0c803d0 | 2012-08-06 11:15:47 +0000 | [diff] [blame] | 3757 | TEST(testLine74), |
caryclark@google.com | 200c211 | 2012-08-03 15:05:04 +0000 | [diff] [blame] | 3758 | TEST(testLine73), |
| 3759 | TEST(testLine72), |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 3760 | TEST(testLine71), |
| 3761 | TEST(testLine70), |
| 3762 | TEST(testLine69), |
| 3763 | TEST(testLine68h), |
| 3764 | TEST(testLine68g), |
| 3765 | TEST(testLine68f), |
| 3766 | TEST(testLine68e), |
| 3767 | TEST(testLine68d), |
| 3768 | TEST(testLine68c), |
| 3769 | TEST(testLine68b), |
| 3770 | TEST(testLine68a), |
| 3771 | TEST(testLine67), |
caryclark@google.com | 27c449a | 2012-07-27 18:26:38 +0000 | [diff] [blame] | 3772 | TEST(testLine66), |
| 3773 | TEST(testLine65), |
| 3774 | TEST(testLine64), |
| 3775 | TEST(testLine63), |
| 3776 | TEST(testLine62), |
| 3777 | TEST(testLine61), |
| 3778 | TEST(testLine60), |
caryclark@google.com | cc90505 | 2012-07-25 20:59:42 +0000 | [diff] [blame] | 3779 | TEST(testLine59), |
| 3780 | TEST(testLine58), |
caryclark@google.com | 1806344 | 2012-07-25 12:05:18 +0000 | [diff] [blame] | 3781 | TEST(testLine57), |
| 3782 | TEST(testLine56), |
caryclark@google.com | e21cb18 | 2012-07-23 21:26:31 +0000 | [diff] [blame] | 3783 | TEST(testLine55), |
| 3784 | TEST(testLine54), |
| 3785 | TEST(testLine53), |
| 3786 | TEST(testLine52), |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 3787 | TEST(testLine51), |
| 3788 | TEST(testLine50), |
| 3789 | TEST(testLine49), |
| 3790 | TEST(testLine48), |
| 3791 | TEST(testLine47), |
| 3792 | TEST(testLine46), |
| 3793 | TEST(testLine45), |
| 3794 | TEST(testLine44), |
| 3795 | TEST(testLine43), |
| 3796 | TEST(testLine42), |
| 3797 | TEST(testLine41), |
| 3798 | TEST(testLine40), |
| 3799 | TEST(testLine38), |
| 3800 | TEST(testLine37), |
| 3801 | TEST(testLine36), |
| 3802 | TEST(testLine35), |
| 3803 | TEST(testLine34), |
| 3804 | TEST(testLine33), |
| 3805 | TEST(testLine32), |
| 3806 | TEST(testLine31), |
| 3807 | TEST(testLine30), |
| 3808 | TEST(testLine29), |
| 3809 | TEST(testLine28), |
| 3810 | TEST(testLine27), |
| 3811 | TEST(testLine26), |
| 3812 | TEST(testLine25), |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 3813 | TEST(testLine24a), |
| 3814 | TEST(testLine24), |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 3815 | TEST(testLine23), |
| 3816 | TEST(testLine22), |
| 3817 | TEST(testLine21), |
| 3818 | TEST(testLine20), |
| 3819 | TEST(testLine19), |
| 3820 | TEST(testLine18), |
| 3821 | TEST(testLine17), |
| 3822 | TEST(testLine16), |
| 3823 | TEST(testLine15), |
| 3824 | TEST(testLine14), |
| 3825 | TEST(testLine13), |
| 3826 | TEST(testLine12), |
| 3827 | TEST(testLine11), |
| 3828 | TEST(testLine10a), |
| 3829 | TEST(testLine10), |
| 3830 | TEST(testLine9), |
| 3831 | TEST(testLine8), |
| 3832 | TEST(testLine7b), |
| 3833 | TEST(testLine7a), |
| 3834 | TEST(testLine7), |
| 3835 | TEST(testLine6), |
| 3836 | TEST(testLine5), |
| 3837 | TEST(testLine4), |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 3838 | TEST(testLine3b), |
| 3839 | TEST(testLine3a), |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 3840 | TEST(testLine3), |
| 3841 | TEST(testLine2), |
| 3842 | TEST(testLine1), |
caryclark@google.com | af46cff | 2012-05-22 21:12:00 +0000 | [diff] [blame] | 3843 | }; |
| 3844 | |
caryclark@google.com | 4eeda37 | 2012-12-06 21:47:48 +0000 | [diff] [blame] | 3845 | static void testIntersect1() { |
| 3846 | SkPath one, two; |
| 3847 | one.addRect(0, 0, 6, 6, SkPath::kCW_Direction); |
| 3848 | two.addRect(3, 3, 9, 9, SkPath::kCW_Direction); |
| 3849 | testShapeOp(one, two, kIntersect_Op); |
| 3850 | } |
| 3851 | |
| 3852 | static void testUnion1() { |
| 3853 | SkPath one, two; |
| 3854 | one.addRect(0, 0, 6, 6, SkPath::kCW_Direction); |
| 3855 | two.addRect(3, 3, 9, 9, SkPath::kCW_Direction); |
| 3856 | testShapeOp(one, two, kUnion_Op); |
| 3857 | } |
| 3858 | |
| 3859 | static void testDiff1() { |
| 3860 | SkPath one, two; |
| 3861 | one.addRect(0, 0, 6, 6, SkPath::kCW_Direction); |
| 3862 | two.addRect(3, 3, 9, 9, SkPath::kCW_Direction); |
| 3863 | testShapeOp(one, two, kDifference_Op); |
| 3864 | } |
| 3865 | |
| 3866 | static void testXor1() { |
| 3867 | SkPath one, two; |
| 3868 | one.addRect(0, 0, 6, 6, SkPath::kCW_Direction); |
| 3869 | two.addRect(3, 3, 9, 9, SkPath::kCW_Direction); |
| 3870 | testShapeOp(one, two, kXor_Op); |
| 3871 | } |
| 3872 | |
| 3873 | static void testIntersect2() { |
| 3874 | SkPath one, two; |
| 3875 | one.addRect(0, 0, 6, 6, SkPath::kCW_Direction); |
| 3876 | two.addRect(0, 3, 9, 9, SkPath::kCW_Direction); |
| 3877 | testShapeOp(one, two, kIntersect_Op); |
| 3878 | } |
| 3879 | |
| 3880 | static void testUnion2() { |
| 3881 | SkPath one, two; |
| 3882 | one.addRect(0, 0, 6, 6, SkPath::kCW_Direction); |
| 3883 | two.addRect(0, 3, 9, 9, SkPath::kCW_Direction); |
| 3884 | testShapeOp(one, two, kUnion_Op); |
| 3885 | } |
| 3886 | |
| 3887 | static void testDiff2() { |
| 3888 | SkPath one, two; |
| 3889 | one.addRect(0, 0, 6, 6, SkPath::kCW_Direction); |
| 3890 | two.addRect(0, 3, 9, 9, SkPath::kCW_Direction); |
| 3891 | testShapeOp(one, two, kDifference_Op); |
| 3892 | } |
| 3893 | |
| 3894 | static void testXor2() { |
| 3895 | SkPath one, two; |
| 3896 | one.addRect(0, 0, 6, 6, SkPath::kCW_Direction); |
| 3897 | two.addRect(0, 3, 9, 9, SkPath::kCW_Direction); |
| 3898 | testShapeOp(one, two, kXor_Op); |
| 3899 | } |
| 3900 | |
| 3901 | static void testOp1d() { |
| 3902 | SkPath path, pathB; |
| 3903 | path.setFillType(SkPath::kWinding_FillType); |
| 3904 | path.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 3905 | path.addRect(0, 0, 2, 2, SkPath::kCW_Direction); |
| 3906 | pathB.setFillType(SkPath::kWinding_FillType); |
| 3907 | pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 3908 | pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 3909 | testShapeOp(path, pathB, kDifference_Op); |
| 3910 | } |
| 3911 | |
| 3912 | static void testOp2d() { |
| 3913 | SkPath path, pathB; |
| 3914 | path.setFillType(SkPath::kWinding_FillType); |
| 3915 | path.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 3916 | path.addRect(0, 0, 2, 2, SkPath::kCW_Direction); |
| 3917 | pathB.setFillType(SkPath::kEvenOdd_FillType); |
| 3918 | pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 3919 | pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 3920 | testShapeOp(path, pathB, kDifference_Op); |
| 3921 | } |
| 3922 | |
| 3923 | static void testOp3d() { |
| 3924 | SkPath path, pathB; |
| 3925 | path.setFillType(SkPath::kWinding_FillType); |
| 3926 | path.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 3927 | path.addRect(1, 1, 2, 2, SkPath::kCW_Direction); |
| 3928 | pathB.setFillType(SkPath::kWinding_FillType); |
| 3929 | pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 3930 | pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 3931 | testShapeOp(path, pathB, kDifference_Op); |
| 3932 | } |
| 3933 | |
| 3934 | static void testOp1u() { |
| 3935 | SkPath path, pathB; |
| 3936 | path.setFillType(SkPath::kWinding_FillType); |
| 3937 | path.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 3938 | path.addRect(0, 0, 3, 3, SkPath::kCW_Direction); |
| 3939 | pathB.setFillType(SkPath::kWinding_FillType); |
| 3940 | pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 3941 | pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 3942 | testShapeOp(path, pathB, kUnion_Op); |
| 3943 | } |
| 3944 | |
| 3945 | static void testOp4d() { |
| 3946 | SkPath path, pathB; |
| 3947 | path.setFillType(SkPath::kWinding_FillType); |
| 3948 | path.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 3949 | path.addRect(2, 2, 4, 4, SkPath::kCW_Direction); |
| 3950 | pathB.setFillType(SkPath::kWinding_FillType); |
| 3951 | pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 3952 | pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 3953 | testShapeOp(path, pathB, kDifference_Op); |
| 3954 | } |
| 3955 | |
| 3956 | static void testOp5d() { |
| 3957 | SkPath path, pathB; |
| 3958 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 3959 | path.addRect(0, 0, 2, 2, SkPath::kCW_Direction); |
| 3960 | path.addRect(0, 0, 3, 3, SkPath::kCW_Direction); |
| 3961 | pathB.setFillType(SkPath::kEvenOdd_FillType); |
| 3962 | pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 3963 | pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 3964 | testShapeOp(path, pathB, kDifference_Op); |
| 3965 | } |
| 3966 | |
| 3967 | static void testOp6d() { |
| 3968 | SkPath path, pathB; |
| 3969 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 3970 | path.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 3971 | path.addRect(0, 0, 3, 3, SkPath::kCW_Direction); |
| 3972 | pathB.setFillType(SkPath::kWinding_FillType); |
| 3973 | pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 3974 | pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 3975 | testShapeOp(path, pathB, kDifference_Op); |
| 3976 | } |
| 3977 | |
| 3978 | static void testOp7d() { |
| 3979 | SkPath path, pathB; |
| 3980 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 3981 | path.addRect(0, 0, 2, 2, SkPath::kCW_Direction); |
| 3982 | path.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 3983 | pathB.setFillType(SkPath::kEvenOdd_FillType); |
| 3984 | pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 3985 | pathB.addRect(0, 0, 1, 1, SkPath::kCW_Direction); |
| 3986 | testShapeOp(path, pathB, kDifference_Op); |
| 3987 | } |
| 3988 | |
caryclark@google.com | e7bd5f4 | 2012-12-13 19:47:53 +0000 | [diff] [blame] | 3989 | static void testOp2u() { |
| 3990 | SkPath path, pathB; |
| 3991 | path.setFillType(SkPath::kEvenOdd_FillType); |
| 3992 | path.addRect(0, 0, 2, 2, SkPath::kCW_Direction); |
| 3993 | path.addRect(0, 0, 2, 2, SkPath::kCW_Direction); |
| 3994 | pathB.setFillType(SkPath::kWinding_FillType); |
| 3995 | pathB.addRect(0, 0, 3, 3, SkPath::kCW_Direction); |
| 3996 | pathB.addRect(1, 1, 2, 2, SkPath::kCW_Direction); |
| 3997 | testShapeOp(path, pathB, kUnion_Op); |
| 3998 | } |
| 3999 | |
caryclark@google.com | af46cff | 2012-05-22 21:12:00 +0000 | [diff] [blame] | 4000 | static const size_t testCount = sizeof(tests) / sizeof(tests[0]); |
| 4001 | |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 4002 | static struct { |
| 4003 | void (*fun)(); |
| 4004 | const char* str; |
| 4005 | } subTests[] = { |
caryclark@google.com | 235f56a | 2012-09-14 14:19:30 +0000 | [diff] [blame] | 4006 | TEST(testDiff1), |
caryclark@google.com | 235f56a | 2012-09-14 14:19:30 +0000 | [diff] [blame] | 4007 | TEST(testIntersect1), |
caryclark@google.com | 31143cf | 2012-11-09 22:14:19 +0000 | [diff] [blame] | 4008 | TEST(testUnion1), |
caryclark@google.com | 57cff8d | 2012-11-14 21:14:56 +0000 | [diff] [blame] | 4009 | TEST(testXor1), |
| 4010 | TEST(testDiff2), |
| 4011 | TEST(testIntersect2), |
| 4012 | TEST(testUnion2), |
| 4013 | TEST(testXor2), |
caryclark@google.com | b1c42bb | 2012-11-16 13:16:41 +0000 | [diff] [blame] | 4014 | TEST(testOp1d), |
caryclark@google.com | 729e1c4 | 2012-11-21 21:36:34 +0000 | [diff] [blame] | 4015 | TEST(testOp2d), |
| 4016 | TEST(testOp3d), |
caryclark@google.com | 4eeda37 | 2012-12-06 21:47:48 +0000 | [diff] [blame] | 4017 | TEST(testOp1u), |
| 4018 | TEST(testOp4d), |
| 4019 | TEST(testOp5d), |
| 4020 | TEST(testOp6d), |
| 4021 | TEST(testOp7d), |
caryclark@google.com | e7bd5f4 | 2012-12-13 19:47:53 +0000 | [diff] [blame] | 4022 | TEST(testOp2u), |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 4023 | }; |
| 4024 | |
| 4025 | static const size_t subTestCount = sizeof(subTests) / sizeof(subTests[0]); |
| 4026 | |
caryclark@google.com | e7bd5f4 | 2012-12-13 19:47:53 +0000 | [diff] [blame] | 4027 | static void (*firstBinaryTest)() = 0; |
caryclark@google.com | 57cff8d | 2012-11-14 21:14:56 +0000 | [diff] [blame] | 4028 | |
caryclark@google.com | af46cff | 2012-05-22 21:12:00 +0000 | [diff] [blame] | 4029 | static bool skipAll = false; |
caryclark@google.com | 0d3d09e | 2012-12-10 14:50:04 +0000 | [diff] [blame] | 4030 | static bool runBinaryTestsFirst = false; |
caryclark@google.com | 31143cf | 2012-11-09 22:14:19 +0000 | [diff] [blame] | 4031 | static bool runReverse = false; |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 4032 | static void (*stopTest)() = 0; |
caryclark@google.com | af46cff | 2012-05-22 21:12:00 +0000 | [diff] [blame] | 4033 | |
| 4034 | void SimplifyNew_Test() { |
| 4035 | if (skipAll) { |
| 4036 | return; |
| 4037 | } |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 4038 | #ifdef SK_DEBUG |
caryclark@google.com | 27c449a | 2012-07-27 18:26:38 +0000 | [diff] [blame] | 4039 | gDebugMaxWindSum = 4; |
| 4040 | gDebugMaxWindValue = 4; |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 4041 | size_t index; |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 4042 | #endif |
caryclark@google.com | 7fce0de | 2012-11-29 14:31:50 +0000 | [diff] [blame] | 4043 | if (runBinaryTestsFirst && firstBinaryTest) { |
caryclark@google.com | 57cff8d | 2012-11-14 21:14:56 +0000 | [diff] [blame] | 4044 | index = subTestCount - 1; |
| 4045 | while (index > 0 && subTests[index].fun != firstBinaryTest) { |
| 4046 | --index; |
| 4047 | } |
| 4048 | SkDebugf(" %s [%s]\n", __FUNCTION__, subTests[index].str); |
| 4049 | (*subTests[index].fun)(); |
| 4050 | } |
caryclark@google.com | 31143cf | 2012-11-09 22:14:19 +0000 | [diff] [blame] | 4051 | if (runBinaryTestsFirst) { |
caryclark@google.com | 534aa5b | 2012-08-02 20:08:21 +0000 | [diff] [blame] | 4052 | index = subTestCount - 1; |
| 4053 | do { |
| 4054 | SkDebugf(" %s [%s]\n", __FUNCTION__, subTests[index].str); |
| 4055 | (*subTests[index].fun)(); |
| 4056 | } while (index--); |
| 4057 | } |
| 4058 | index = testCount - 1; |
caryclark@google.com | af46cff | 2012-05-22 21:12:00 +0000 | [diff] [blame] | 4059 | if (firstTest) { |
caryclark@google.com | e21cb18 | 2012-07-23 21:26:31 +0000 | [diff] [blame] | 4060 | while (index > 0 && tests[index].fun != firstTest) { |
| 4061 | --index; |
caryclark@google.com | af46cff | 2012-05-22 21:12:00 +0000 | [diff] [blame] | 4062 | } |
caryclark@google.com | 24bec79 | 2012-08-20 12:43:57 +0000 | [diff] [blame] | 4063 | SkDebugf(" %s [%s]\n", __FUNCTION__, tests[index].str); |
caryclark@google.com | 59823f7 | 2012-08-09 18:17:47 +0000 | [diff] [blame] | 4064 | (*tests[index].fun)(); |
caryclark@google.com | af46cff | 2012-05-22 21:12:00 +0000 | [diff] [blame] | 4065 | } |
caryclark@google.com | 235f56a | 2012-09-14 14:19:30 +0000 | [diff] [blame] | 4066 | index = runReverse ? testCount - 1 : 0; |
| 4067 | size_t last = runReverse ? 0 : testCount - 1; |
caryclark@google.com | af46cff | 2012-05-22 21:12:00 +0000 | [diff] [blame] | 4068 | bool firstTestComplete = false; |
caryclark@google.com | e21cb18 | 2012-07-23 21:26:31 +0000 | [diff] [blame] | 4069 | do { |
| 4070 | SkDebugf(" %s [%s]\n", __FUNCTION__, tests[index].str); |
caryclark@google.com | 8dcf114 | 2012-07-02 20:27:02 +0000 | [diff] [blame] | 4071 | (*tests[index].fun)(); |
caryclark@google.com | af46cff | 2012-05-22 21:12:00 +0000 | [diff] [blame] | 4072 | firstTestComplete = true; |
caryclark@google.com | 8f9f468 | 2013-01-03 21:18:16 +0000 | [diff] [blame] | 4073 | if (tests[index].fun == stopTest) { |
| 4074 | SkDebugf("lastTest\n"); |
| 4075 | } |
caryclark@google.com | 235f56a | 2012-09-14 14:19:30 +0000 | [diff] [blame] | 4076 | if (index == last) { |
| 4077 | break; |
| 4078 | } |
| 4079 | index += runReverse ? -1 : 1; |
| 4080 | } while (true); |
caryclark@google.com | 31143cf | 2012-11-09 22:14:19 +0000 | [diff] [blame] | 4081 | if (!runBinaryTestsFirst) { |
| 4082 | index = subTestCount - 1; |
| 4083 | do { |
| 4084 | SkDebugf(" %s [%s]\n", __FUNCTION__, subTests[index].str); |
| 4085 | (*subTests[index].fun)(); |
| 4086 | } while (index--); |
| 4087 | } |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 4088 | #ifdef SK_DEBUG |
| 4089 | gDebugMaxWindSum = SK_MaxS32; |
| 4090 | gDebugMaxWindValue = SK_MaxS32; |
| 4091 | #endif |
caryclark@google.com | af46cff | 2012-05-22 21:12:00 +0000 | [diff] [blame] | 4092 | } |