caryclark@google.com | 7dfbb07 | 2013-04-22 14:37:05 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2013 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | #include "PathOpsExtendedTest.h" |
| 8 | |
tfarina@chromium.org | 78e7b4e | 2014-01-02 21:45:03 +0000 | [diff] [blame] | 9 | DEF_TEST(PathOpsInverse, reporter) { |
caryclark@google.com | 7dfbb07 | 2013-04-22 14:37:05 +0000 | [diff] [blame] | 10 | SkPath one, two; |
Cary Clark | 4533f3d | 2018-08-08 09:48:09 -0400 | [diff] [blame] | 11 | int testCount = 0; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 12 | for (int op = kDifference_SkPathOp; op <= kReverseDifference_SkPathOp; ++op) { |
caryclark@google.com | 7dfbb07 | 2013-04-22 14:37:05 +0000 | [diff] [blame] | 13 | for (int oneFill = SkPath::kWinding_FillType; oneFill <= SkPath::kInverseEvenOdd_FillType; |
| 14 | ++oneFill) { |
| 15 | for (int oneDir = SkPath::kCW_Direction; oneDir != SkPath::kCCW_Direction; ++oneDir) { |
| 16 | one.reset(); |
| 17 | one.setFillType((SkPath::FillType) oneFill); |
| 18 | one.addRect(0, 0, 6, 6, (SkPath::Direction) oneDir); |
| 19 | for (int twoFill = SkPath::kWinding_FillType; |
| 20 | twoFill <= SkPath::kInverseEvenOdd_FillType; ++twoFill) { |
| 21 | for (int twoDir = SkPath::kCW_Direction; twoDir != SkPath::kCCW_Direction; |
| 22 | ++twoDir) { |
| 23 | two.reset(); |
| 24 | two.setFillType((SkPath::FillType) twoFill); |
| 25 | two.addRect(3, 3, 9, 9, (SkPath::Direction) twoDir); |
Cary Clark | 4533f3d | 2018-08-08 09:48:09 -0400 | [diff] [blame] | 26 | SkString testName; |
| 27 | testName.printf("inverseTest%d", ++testCount); |
| 28 | testPathOp(reporter, one, two, (SkPathOp) op, testName.c_str()); |
caryclark@google.com | 7dfbb07 | 2013-04-22 14:37:05 +0000 | [diff] [blame] | 29 | } |
| 30 | } |
| 31 | } |
| 32 | } |
| 33 | } |
| 34 | } |