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 "SkPath.h" | 8 #include "SkPath.h" |
9 #include "SkPathOps.h" | 9 #include "SkPathOps.h" |
10 #include "SkPoint.h" | 10 #include "SkPoint.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 case 5: path.cubicTo(finitePts[f], finitePts[f], finitePts[g]); break; | 80 case 5: path.cubicTo(finitePts[f], finitePts[f], finitePts[g]); break; |
81 case 6: path.cubicTo(finitePts[f], finitePts[g], finitePts[f]); break; | 81 case 6: path.cubicTo(finitePts[f], finitePts[g], finitePts[f]); break; |
82 case 7: path.cubicTo(finitePts[f], finitePts[g], finitePts[g]); break; | 82 case 7: path.cubicTo(finitePts[f], finitePts[g], finitePts[g]); break; |
83 case 8: path.cubicTo(finitePts[g], finitePts[f], finitePts[f]); break; | 83 case 8: path.cubicTo(finitePts[g], finitePts[f], finitePts[f]); break; |
84 case 9: path.cubicTo(finitePts[g], finitePts[f], finitePts[g]); break; | 84 case 9: path.cubicTo(finitePts[g], finitePts[f], finitePts[g]); break; |
85 case 10: path.moveTo(finitePts[f]); break; | 85 case 10: path.moveTo(finitePts[f]); break; |
86 } | 86 } |
87 SkPath result; | 87 SkPath result; |
88 result.setFillType(SkPath::kWinding_FillType); | 88 result.setFillType(SkPath::kWinding_FillType); |
89 bool success = Simplify(path, &result); | 89 bool success = Simplify(path, &result); |
90 if (index != 17 && index != 31 && index != 38) { // cubic fails to chop in
two without creating NaNs | 90 REPORTER_ASSERT(reporter, success); |
91 REPORTER_ASSERT(reporter, success); | 91 REPORTER_ASSERT(reporter, result.getFillType() != SkPath::kWinding_FillType)
; |
92 REPORTER_ASSERT(reporter, result.getFillType() != SkPath::kWinding_FillT
ype); | |
93 } | |
94 reporter->bumpTestCount(); | 92 reporter->bumpTestCount(); |
95 } | 93 } |
96 | 94 |
97 static void fuzz_59(skiatest::Reporter* reporter, const char* filename) { | 95 static void fuzz_59(skiatest::Reporter* reporter, const char* filename) { |
98 SkPath path; | 96 SkPath path; |
99 path.moveTo(SkBits2Float(0x430c0000), SkBits2Float(0xce58f41c)); // 140, -9
.09969e+08f | 97 path.moveTo(SkBits2Float(0x430c0000), SkBits2Float(0xce58f41c)); // 140, -9
.09969e+08f |
100 path.lineTo(SkBits2Float(0x43480000), SkBits2Float(0xce58f419)); // 200, -9
.09969e+08f | 98 path.lineTo(SkBits2Float(0x43480000), SkBits2Float(0xce58f419)); // 200, -9
.09969e+08f |
101 path.lineTo(SkBits2Float(0x42200000), SkBits2Float(0xce58f41b)); // 40, -9.
09969e+08f | 99 path.lineTo(SkBits2Float(0x42200000), SkBits2Float(0xce58f41b)); // 40, -9.
09969e+08f |
102 path.lineTo(SkBits2Float(0x43700000), SkBits2Float(0xce58f41b)); // 240, -9
.09969e+08f | 100 path.lineTo(SkBits2Float(0x43700000), SkBits2Float(0xce58f41b)); // 240, -9
.09969e+08f |
103 path.lineTo(SkBits2Float(0x428c0000), SkBits2Float(0xce58f419)); // 70, -9.
09969e+08f | 101 path.lineTo(SkBits2Float(0x428c0000), SkBits2Float(0xce58f419)); // 70, -9.
09969e+08f |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 175 |
178 DEF_TEST(PathOpsSimplifyFailOne, reporter) { | 176 DEF_TEST(PathOpsSimplifyFailOne, reporter) { |
179 int index = 0; | 177 int index = 0; |
180 failOne(reporter, index); | 178 failOne(reporter, index); |
181 } | 179 } |
182 | 180 |
183 DEF_TEST(PathOpsSimplifyDontFailOne, reporter) { | 181 DEF_TEST(PathOpsSimplifyDontFailOne, reporter) { |
184 int index = 17; | 182 int index = 17; |
185 dontFailOne(reporter, index); | 183 dontFailOne(reporter, index); |
186 } | 184 } |
OLD | NEW |