OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "PathOpsTestCommon.h" | 8 #include "PathOpsTestCommon.h" |
9 | 9 |
10 class PathTest_Private { | 10 class PathTest_Private { |
(...skipping 5146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5157 SkPath path, pathB; | 5157 SkPath path, pathB; |
5158 path.moveTo(100.34f, 303.312f); | 5158 path.moveTo(100.34f, 303.312f); |
5159 path.lineTo(-1e+08, 303.312f); | 5159 path.lineTo(-1e+08, 303.312f); |
5160 path.lineTo(102, 310.156f); | 5160 path.lineTo(102, 310.156f); |
5161 path.lineTo(100.34f, 310.156f); | 5161 path.lineTo(100.34f, 310.156f); |
5162 path.lineTo(100.34f, 303.312f); | 5162 path.lineTo(100.34f, 303.312f); |
5163 path.close(); | 5163 path.close(); |
5164 testPathOpCheck(reporter, path, pathB, kUnion_SkPathOp, filename, FLAGS_runF
ail); | 5164 testPathOpCheck(reporter, path, pathB, kUnion_SkPathOp, filename, FLAGS_runF
ail); |
5165 } | 5165 } |
5166 | 5166 |
| 5167 static void fuzz763_3(skiatest::Reporter* reporter, const char* filename) { |
| 5168 SkPath path; |
| 5169 path.setFillType((SkPath::FillType) 1); |
| 5170 path.moveTo(SkBits2Float(0x43b40000), SkBits2Float(0xcf000000)); // 360, -2.147
48e+09f |
| 5171 path.cubicTo(SkBits2Float(0x4e0d628f), SkBits2Float(0xceffffff), SkBits2Float(0x
4e800003), SkBits2Float(0xcec6b143), SkBits2Float(0x4e800002), SkBits2Float(0xce
7ffffc)); // 5.93012e+08f, -2.14748e+09f, 1.07374e+09f, -1.66675e+09f, 1.07374e
+09f, -1.07374e+09f |
| 5172 path.cubicTo(SkBits2Float(0x4e800002), SkBits2Float(0xcde53aee), SkBits2Float(0x
4e0d6292), SkBits2Float(0xc307820e), SkBits2Float(0x44627d00), SkBits2Float(0x43
7ffff2)); // 1.07374e+09f, -4.80731e+08f, 5.93012e+08f, -135.508f, 905.953f, 25
6 |
| 5173 path.lineTo(SkBits2Float(0x444bf3bc), SkBits2Float(0x4460537e)); // 815.808f, 8
97.305f |
| 5174 path.lineTo(SkBits2Float(0x43553abd), SkBits2Float(0x440f3cbd)); // 213.229f, 5
72.949f |
| 5175 path.lineTo(SkBits2Float(0x42000000), SkBits2Float(0x41800000)); // 32, 16 |
| 5176 path.lineTo(SkBits2Float(0x42c80000), SkBits2Float(0x44000000)); // 100, 512 |
| 5177 path.lineTo(SkBits2Float(0x43553abd), SkBits2Float(0x440f3cbd)); // 213.229f, 5
72.949f |
| 5178 path.lineTo(SkBits2Float(0x43b40000), SkBits2Float(0x44800000)); // 360, 1024 |
| 5179 path.lineTo(SkBits2Float(0x43b40000), SkBits2Float(0x45816000)); // 360, 4140 |
| 5180 |
| 5181 SkPath path1(path); |
| 5182 path.reset(); |
| 5183 path.setFillType((SkPath::FillType) 0); |
| 5184 path.moveTo(SkBits2Float(0x42fe0000), SkBits2Float(0x43a08000)); // 127, 321 |
| 5185 path.lineTo(SkBits2Float(0x45d5c000), SkBits2Float(0x43870000)); // 6840, 270 |
| 5186 path.lineTo(SkBits2Float(0xd0a00000), SkBits2Float(0x4cbebc20)); // -2.14748e+1
0f, 1e+08 |
| 5187 path.lineTo(SkBits2Float(0x451f7000), SkBits2Float(0x42800000)); // 2551, 64 |
| 5188 path.lineTo(SkBits2Float(0x42fe0000), SkBits2Float(0x43a08000)); // 127, 321 |
| 5189 path.close(); |
| 5190 |
| 5191 SkPath path2(path); |
| 5192 testPathOp(reporter, path1, path2, (SkPathOp) 2, filename); |
| 5193 } |
| 5194 |
5167 static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0; | 5195 static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0; |
5168 static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0; | 5196 static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0; |
5169 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0; | 5197 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0; |
5170 | 5198 |
5171 #define TEST(name) { name, #name } | 5199 #define TEST(name) { name, #name } |
5172 | 5200 |
5173 static struct TestDesc tests[] = { | 5201 static struct TestDesc tests[] = { |
| 5202 TEST(fuzz763_3), |
5174 TEST(fuzz38), | 5203 TEST(fuzz38), |
5175 TEST(cubics44d), | 5204 TEST(cubics44d), |
5176 TEST(cubics45u), | 5205 TEST(cubics45u), |
5177 TEST(loops61i), | 5206 TEST(loops61i), |
5178 TEST(loops62i), | 5207 TEST(loops62i), |
5179 TEST(loops63i), | 5208 TEST(loops63i), |
5180 TEST(loops58iAsQuads), | 5209 TEST(loops58iAsQuads), |
5181 TEST(cubics41d), | 5210 TEST(cubics41d), |
5182 TEST(loops59iasQuads), | 5211 TEST(loops59iasQuads), |
5183 TEST(loops59i), | 5212 TEST(loops59i), |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5738 }; | 5767 }; |
5739 | 5768 |
5740 static const size_t failTestCount = SK_ARRAY_COUNT(failTests); | 5769 static const size_t failTestCount = SK_ARRAY_COUNT(failTests); |
5741 | 5770 |
5742 DEF_TEST(PathOpsFailOp, reporter) { | 5771 DEF_TEST(PathOpsFailOp, reporter) { |
5743 #if DEBUG_SHOW_TEST_NAME | 5772 #if DEBUG_SHOW_TEST_NAME |
5744 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH); | 5773 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH); |
5745 #endif | 5774 #endif |
5746 RunTestSet(reporter, failTests, failTestCount, nullptr, nullptr, nullptr, fa
lse); | 5775 RunTestSet(reporter, failTests, failTestCount, nullptr, nullptr, nullptr, fa
lse); |
5747 } | 5776 } |
OLD | NEW |