| 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 3571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3582 path.close(); | 3582 path.close(); |
| 3583 pathB.moveTo(1,5); | 3583 pathB.moveTo(1,5); |
| 3584 pathB.cubicTo(-5.66666651f,3.33333349f, 8.83333302f,2.33333349f, 0,1); | 3584 pathB.cubicTo(-5.66666651f,3.33333349f, 8.83333302f,2.33333349f, 0,1); |
| 3585 pathB.close(); | 3585 pathB.close(); |
| 3586 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); | 3586 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename); |
| 3587 } | 3587 } |
| 3588 | 3588 |
| 3589 #include "SkPathOpsCubic.h" | 3589 #include "SkPathOpsCubic.h" |
| 3590 | 3590 |
| 3591 static void loop1asQuad(skiatest::Reporter* reporter, const char* filename) { | 3591 static void loop1asQuad(skiatest::Reporter* reporter, const char* filename) { |
| 3592 SkDCubic c1 = {{{0,1}, {1,5}, {-5.66666651f,3.33333349f}, {8.83333302f,2.333
33349f}}}; | 3592 CubicPts cubic1 = {{{0,1}, {1,5}, {-5.66666651f,3.33333349f}, {8.83333302f,2
.33333349f}}}; |
| 3593 SkDCubic c2 = {{{1,5}, {-5.66666651f,3.33333349f}, {8.83333302f,2.33333349f}
, {0,1}}}; | 3593 CubicPts cubic2 = {{{1,5}, {-5.66666651f,3.33333349f}, {8.83333302f,2.333333
49f}, {0,1}}}; |
| 3594 SkDCubic c1, c2; |
| 3595 c1.debugSet(cubic1.fPts); |
| 3596 c2.debugSet(cubic2.fPts); |
| 3594 double c1InflectionTs[2], c2InflectionTs[2]; | 3597 double c1InflectionTs[2], c2InflectionTs[2]; |
| 3595 SkDEBUGCODE(int c1InfTCount =) c1.findInflections(c1InflectionTs); | 3598 SkDEBUGCODE(int c1InfTCount =) c1.findInflections(c1InflectionTs); |
| 3596 SkASSERT(c1InfTCount == 2); | 3599 SkASSERT(c1InfTCount == 2); |
| 3597 SkDEBUGCODE(int c2InfTCount =) c2.findInflections(c2InflectionTs); | 3600 SkDEBUGCODE(int c2InfTCount =) c2.findInflections(c2InflectionTs); |
| 3598 SkASSERT(c2InfTCount == 1); | 3601 SkASSERT(c2InfTCount == 1); |
| 3599 SkASSERT(c1InflectionTs[0] > c1InflectionTs[1]); | 3602 SkASSERT(c1InflectionTs[0] > c1InflectionTs[1]); |
| 3600 SkDCubicPair c1pair = c1.chopAt(c1InflectionTs[0]); | 3603 SkDCubicPair c1pair = c1.chopAt(c1InflectionTs[0]); |
| 3601 SkDCubicPair c1apair = c1pair.first().chopAt(c1InflectionTs[1]); | 3604 SkDCubicPair c1apair = c1pair.first().chopAt(c1InflectionTs[1]); |
| 3602 SkDCubicPair c2pair = c2.chopAt(c2InflectionTs[0]); | 3605 SkDCubicPair c2pair = c2.chopAt(c2InflectionTs[0]); |
| 3603 SkDQuad q1[2] = { c1pair.first().toQuad(), c1pair.second().toQuad() }; | 3606 SkDQuad q1[2] = { c1pair.first().toQuad(), c1pair.second().toQuad() }; |
| (...skipping 4780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8384 } | 8387 } |
| 8385 | 8388 |
| 8386 static struct TestDesc repTests[] = { | 8389 static struct TestDesc repTests[] = { |
| 8387 TEST(fuzz763_5a), | 8390 TEST(fuzz763_5a), |
| 8388 }; | 8391 }; |
| 8389 | 8392 |
| 8390 DEF_TEST(PathOpsRepOp, reporter) { | 8393 DEF_TEST(PathOpsRepOp, reporter) { |
| 8391 for (int index = 0; index < 1; ++index) | 8394 for (int index = 0; index < 1; ++index) |
| 8392 RunTestSet(reporter, repTests, SK_ARRAY_COUNT(repTests), nullptr, nullptr, n
ullptr, false); | 8395 RunTestSet(reporter, repTests, SK_ARRAY_COUNT(repTests), nullptr, nullptr, n
ullptr, false); |
| 8393 } | 8396 } |
| OLD | NEW |