| 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 "PathOpsCubicIntersectionTestData.h" | 7 #include "PathOpsCubicIntersectionTestData.h" |
| 8 #include "PathOpsTestCommon.h" | 8 #include "PathOpsTestCommon.h" |
| 9 #include "SkIntersections.h" | 9 #include "SkIntersections.h" |
| 10 #include "SkPathOpsRect.h" | 10 #include "SkPathOpsRect.h" |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 for (size_t index = firstFail; index < selfSetCount; ++index) { | 483 for (size_t index = firstFail; index < selfSetCount; ++index) { |
| 484 const SkDCubic& cubic = selfSet[index]; | 484 const SkDCubic& cubic = selfSet[index]; |
| 485 #if ONE_OFF_DEBUG | 485 #if ONE_OFF_DEBUG |
| 486 int idx2; | 486 int idx2; |
| 487 double max[3]; | 487 double max[3]; |
| 488 int ts = cubic.findMaxCurvature(max); | 488 int ts = cubic.findMaxCurvature(max); |
| 489 for (idx2 = 0; idx2 < ts; ++idx2) { | 489 for (idx2 = 0; idx2 < ts; ++idx2) { |
| 490 SkDebugf("%s max[%d]=%1.9g (%1.9g, %1.9g)\n", __FUNCTION__, idx2, | 490 SkDebugf("%s max[%d]=%1.9g (%1.9g, %1.9g)\n", __FUNCTION__, idx2, |
| 491 max[idx2], cubic.xyAtT(max[idx2]).fX, cubic.xyAtT(max[idx2])
.fY); | 491 max[idx2], cubic.xyAtT(max[idx2]).fX, cubic.xyAtT(max[idx2])
.fY); |
| 492 } | 492 } |
| 493 SkTDArray<double> ts1; | 493 SkTArray<double, true> ts1; |
| 494 SkTDArray<SkDQuad> quads1; | 494 SkTArray<SkDQuad, true> quads1; |
| 495 cubic.toQuadraticTs(cubic.calcPrecision(), &ts1); | 495 cubic.toQuadraticTs(cubic.calcPrecision(), &ts1); |
| 496 for (idx2 = 0; idx2 < ts1.count(); ++idx2) { | 496 for (idx2 = 0; idx2 < ts1.count(); ++idx2) { |
| 497 SkDebugf("%s t[%d]=%1.9g\n", __FUNCTION__, idx2, ts1[idx2]); | 497 SkDebugf("%s t[%d]=%1.9g\n", __FUNCTION__, idx2, ts1[idx2]); |
| 498 } | 498 } |
| 499 CubicToQuads(cubic, cubic.calcPrecision(), quads1); | 499 CubicToQuads(cubic, cubic.calcPrecision(), quads1); |
| 500 for (idx2 = 0; idx2 < quads1.count(); ++idx2) { | 500 for (idx2 = 0; idx2 < quads1.count(); ++idx2) { |
| 501 const SkDQuad& q = quads1[idx2]; | 501 const SkDQuad& q = quads1[idx2]; |
| 502 SkDebugf(" {{{%1.9g,%1.9g}, {%1.9g,%1.9g}, {%1.9g,%1.9g}}},\n", | 502 SkDebugf(" {{{%1.9g,%1.9g}, {%1.9g,%1.9g}, {%1.9g,%1.9g}}},\n", |
| 503 q[0].fX, q[0].fY, q[1].fX, q[1].fY, q[2].fX, q[2].fY); | 503 q[0].fX, q[0].fY, q[1].fX, q[1].fY, q[2].fX, q[2].fY); |
| 504 } | 504 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 519 oneOffTest(reporter); | 519 oneOffTest(reporter); |
| 520 oneOffTests(reporter); | 520 oneOffTests(reporter); |
| 521 cubicIntersectionSelfTest(reporter); | 521 cubicIntersectionSelfTest(reporter); |
| 522 standardTestCases(reporter); | 522 standardTestCases(reporter); |
| 523 if (false) CubicIntersection_IntersectionFinder(); | 523 if (false) CubicIntersection_IntersectionFinder(); |
| 524 if (false) CubicIntersection_RandTest(reporter); | 524 if (false) CubicIntersection_RandTest(reporter); |
| 525 } | 525 } |
| 526 | 526 |
| 527 #include "TestClassDef.h" | 527 #include "TestClassDef.h" |
| 528 DEFINE_TESTCLASS_SHORT(PathOpsCubicIntersectionTest) | 528 DEFINE_TESTCLASS_SHORT(PathOpsCubicIntersectionTest) |
| OLD | NEW |