OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 #include "PathOpsExtendedTest.h" | 7 #include "PathOpsExtendedTest.h" |
8 #include "TestClassDef.h" | |
9 | 8 |
10 DEF_TEST(PathOpsInverse, reporter) { | 9 DEF_TEST(PathOpsInverse, reporter) { |
11 SkPath one, two; | 10 SkPath one, two; |
12 for (int op = kDifference_PathOp; op <= kReverseDifference_PathOp; ++op) { | 11 for (int op = kDifference_PathOp; op <= kReverseDifference_PathOp; ++op) { |
13 for (int oneFill = SkPath::kWinding_FillType; oneFill <= SkPath::kInvers
eEvenOdd_FillType; | 12 for (int oneFill = SkPath::kWinding_FillType; oneFill <= SkPath::kInvers
eEvenOdd_FillType; |
14 ++oneFill) { | 13 ++oneFill) { |
15 for (int oneDir = SkPath::kCW_Direction; oneDir != SkPath::kCCW_Dire
ction; ++oneDir) { | 14 for (int oneDir = SkPath::kCW_Direction; oneDir != SkPath::kCCW_Dire
ction; ++oneDir) { |
16 one.reset(); | 15 one.reset(); |
17 one.setFillType((SkPath::FillType) oneFill); | 16 one.setFillType((SkPath::FillType) oneFill); |
18 one.addRect(0, 0, 6, 6, (SkPath::Direction) oneDir); | 17 one.addRect(0, 0, 6, 6, (SkPath::Direction) oneDir); |
19 for (int twoFill = SkPath::kWinding_FillType; | 18 for (int twoFill = SkPath::kWinding_FillType; |
20 twoFill <= SkPath::kInverseEvenOdd_FillType; ++twoFill)
{ | 19 twoFill <= SkPath::kInverseEvenOdd_FillType; ++twoFill)
{ |
21 for (int twoDir = SkPath::kCW_Direction; twoDir != SkPath::k
CCW_Direction; | 20 for (int twoDir = SkPath::kCW_Direction; twoDir != SkPath::k
CCW_Direction; |
22 ++twoDir) { | 21 ++twoDir) { |
23 two.reset(); | 22 two.reset(); |
24 two.setFillType((SkPath::FillType) twoFill); | 23 two.setFillType((SkPath::FillType) twoFill); |
25 two.addRect(3, 3, 9, 9, (SkPath::Direction) twoDir); | 24 two.addRect(3, 3, 9, 9, (SkPath::Direction) twoDir); |
26 testPathOp(reporter, one, two, (SkPathOp) op); | 25 testPathOp(reporter, one, two, (SkPathOp) op); |
27 } | 26 } |
28 } | 27 } |
29 } | 28 } |
30 } | 29 } |
31 } | 30 } |
32 } | 31 } |
OLD | NEW |