| 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 "PathOpsTestCommon.h" | 7 #include "PathOpsTestCommon.h" |
| 8 #include "SkOpSegment.h" | 8 #include "SkOpSegment.h" |
| 9 #include "SkTArray.h" | 9 #include "SkTArray.h" |
| 10 #include "Test.h" | 10 #include "Test.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 SkPoint startPt; | 209 SkPoint startPt; |
| 210 }; | 210 }; |
| 211 | 211 |
| 212 #define TEST_ENTRY(name) #name, name, SK_ARRAY_COUNT(name) | 212 #define TEST_ENTRY(name) #name, name, SK_ARRAY_COUNT(name) |
| 213 | 213 |
| 214 static const SortSetTests tests[] = { | 214 static const SortSetTests tests[] = { |
| 215 { TEST_ENTRY(set17), {0, 0}}, | 215 { TEST_ENTRY(set17), {0, 0}}, |
| 216 { TEST_ENTRY(set16), {130.090179f,11417.5957f} }, | 216 { TEST_ENTRY(set16), {130.090179f,11417.5957f} }, |
| 217 // { TEST_ENTRY(set15), {0, 0}}, | 217 // { TEST_ENTRY(set15), {0, 0}}, |
| 218 { TEST_ENTRY(set14), {0, 0}}, | 218 { TEST_ENTRY(set14), {0, 0}}, |
| 219 { TEST_ENTRY(set13), {0, 0}}, | 219 // { TEST_ENTRY(set13), {0, 0}}, |
| 220 { TEST_ENTRY(set12), {0, 0}}, | 220 { TEST_ENTRY(set12), {0, 0}}, |
| 221 { TEST_ENTRY(set11), {0, 0}}, | 221 { TEST_ENTRY(set11), {0, 0}}, |
| 222 { TEST_ENTRY(set10), {0, 0}}, | 222 { TEST_ENTRY(set10), {0, 0}}, |
| 223 { TEST_ENTRY(set9), {0, 0}}, | 223 { TEST_ENTRY(set9), {0, 0}}, |
| 224 { TEST_ENTRY(set6a), {3.55555558f,2.77777767f} }, | 224 { TEST_ENTRY(set6a), {3.55555558f,2.77777767f} }, |
| 225 { TEST_ENTRY(set8a), {1.5f,1} }, | 225 { TEST_ENTRY(set8a), {1.5f,1} }, |
| 226 { TEST_ENTRY(set8), {0, 0}}, | 226 { TEST_ENTRY(set8), {0, 0}}, |
| 227 { TEST_ENTRY(set7), {0, 0}}, | 227 { TEST_ENTRY(set7), {0, 0}}, |
| 228 { TEST_ENTRY(set6a), {3.55555558f,2.77777767f} }, | 228 { TEST_ENTRY(set6a), {3.55555558f,2.77777767f} }, |
| 229 { TEST_ENTRY(set6), {0, 0}}, | 229 { TEST_ENTRY(set6), {0, 0}}, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 SkASSERT(ValidCubic(dCubic)); | 280 SkASSERT(ValidCubic(dCubic)); |
| 281 if (useIntersectPt) { | 281 if (useIntersectPt) { |
| 282 break; | 282 break; |
| 283 } | 283 } |
| 284 start = dCubic.ptAtT(set[idx].tStart).asSkPoint(); | 284 start = dCubic.ptAtT(set[idx].tStart).asSkPoint(); |
| 285 end = dCubic.ptAtT(set[idx].tEnd).asSkPoint(); | 285 end = dCubic.ptAtT(set[idx].tEnd).asSkPoint(); |
| 286 } break; | 286 } break; |
| 287 } | 287 } |
| 288 double tStart = set[idx].tStart; | 288 double tStart = set[idx].tStart; |
| 289 double tEnd = set[idx].tEnd; | 289 double tEnd = set[idx].tEnd; |
| 290 seg->addT(NULL, start, tStart, SkOpSpan::kPointIsExact); | 290 seg->addT(NULL, start, tStart); |
| 291 seg->addT(NULL, end, tEnd, SkOpSpan::kPointIsExact); | 291 seg->addT(NULL, end, tEnd); |
| 292 if (tStart != 0 && tEnd != 0) { | 292 if (tStart != 0 && tEnd != 0) { |
| 293 seg->addT(NULL, set[idx].ptData[0], 0, SkOpSpan::kPointIsExact); | 293 seg->addT(NULL, set[idx].ptData[0], 0); |
| 294 } | 294 } |
| 295 if (tStart != 1 && tEnd != 1) { | 295 if (tStart != 1 && tEnd != 1) { |
| 296 seg->addT(NULL, set[idx].ptData[set[idx].ptCount - 1], 1, SkOpSpan::kPoi
ntIsExact); | 296 seg->addT(NULL, set[idx].ptData[set[idx].ptCount - 1], 1); |
| 297 } | 297 } |
| 298 int tIndex = 0; | 298 int tIndex = 0; |
| 299 ts[0] = 0; | 299 ts[0] = 0; |
| 300 ts[1] = 1; | 300 ts[1] = 1; |
| 301 do { | 301 do { |
| 302 if (seg->t(tIndex) == set[idx].tStart) { | 302 if (seg->t(tIndex) == set[idx].tStart) { |
| 303 ts[0] = tIndex; | 303 ts[0] = tIndex; |
| 304 } | 304 } |
| 305 if (seg->t(tIndex) == set[idx].tEnd) { | 305 if (seg->t(tIndex) == set[idx].tEnd) { |
| 306 ts[1] = tIndex; | 306 ts[1] = tIndex; |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 } | 469 } |
| 470 } | 470 } |
| 471 #endif | 471 #endif |
| 472 | 472 |
| 473 #include "TestClassDef.h" | 473 #include "TestClassDef.h" |
| 474 DEFINE_TESTCLASS_SHORT(PathOpsAngleTest) | 474 DEFINE_TESTCLASS_SHORT(PathOpsAngleTest) |
| 475 | 475 |
| 476 DEFINE_TESTCLASS_SHORT(PathOpsAngleTestOne) | 476 DEFINE_TESTCLASS_SHORT(PathOpsAngleTestOne) |
| 477 | 477 |
| 478 // DEFINE_TESTCLASS_SHORT(PathOpsAngleFindSlop) | 478 // DEFINE_TESTCLASS_SHORT(PathOpsAngleFindSlop) |
| OLD | NEW |