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 #include "SkIntersections.h" | 9 #include "SkIntersections.h" |
10 #include "SkPathOpsLine.h" | 10 #include "SkPathOpsLine.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 SkASSERT(ValidQuad(quad)); | 78 SkASSERT(ValidQuad(quad)); |
79 const SkDLine& line = oneOffs[index].line; | 79 const SkDLine& line = oneOffs[index].line; |
80 SkASSERT(ValidLine(line)); | 80 SkASSERT(ValidLine(line)); |
81 SkIntersections intersections; | 81 SkIntersections intersections; |
82 int result = doIntersect(intersections, quad, line, flipped); | 82 int result = doIntersect(intersections, quad, line, flipped); |
83 for (int inner = 0; inner < result; ++inner) { | 83 for (int inner = 0; inner < result; ++inner) { |
84 double quadT = intersections[0][inner]; | 84 double quadT = intersections[0][inner]; |
85 SkDPoint quadXY = quad.ptAtT(quadT); | 85 SkDPoint quadXY = quad.ptAtT(quadT); |
86 double lineT = intersections[1][inner]; | 86 double lineT = intersections[1][inner]; |
87 SkDPoint lineXY = line.ptAtT(lineT); | 87 SkDPoint lineXY = line.ptAtT(lineT); |
| 88 if (!quadXY.approximatelyEqual(lineXY)) { |
| 89 quadXY.approximatelyEqual(lineXY); |
| 90 SkDebugf(""); |
| 91 } |
88 REPORTER_ASSERT(reporter, quadXY.approximatelyEqual(lineXY)); | 92 REPORTER_ASSERT(reporter, quadXY.approximatelyEqual(lineXY)); |
89 } | 93 } |
90 } | 94 } |
91 } | 95 } |
92 | 96 |
93 static void PathOpsQuadLineIntersectionTestOne(skiatest::Reporter* reporter) { | 97 static void PathOpsQuadLineIntersectionTestOne(skiatest::Reporter* reporter) { |
94 testOneOffs(reporter); | 98 testOneOffs(reporter); |
95 } | 99 } |
96 | 100 |
97 static void PathOpsQuadLineIntersectionTest(skiatest::Reporter* reporter) { | 101 static void PathOpsQuadLineIntersectionTest(skiatest::Reporter* reporter) { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 REPORTER_ASSERT(reporter, 0); | 142 REPORTER_ASSERT(reporter, 0); |
139 } | 143 } |
140 } | 144 } |
141 } | 145 } |
142 } | 146 } |
143 | 147 |
144 #include "TestClassDef.h" | 148 #include "TestClassDef.h" |
145 DEFINE_TESTCLASS_SHORT(PathOpsQuadLineIntersectionTest) | 149 DEFINE_TESTCLASS_SHORT(PathOpsQuadLineIntersectionTest) |
146 | 150 |
147 DEFINE_TESTCLASS_SHORT(PathOpsQuadLineIntersectionTestOne) | 151 DEFINE_TESTCLASS_SHORT(PathOpsQuadLineIntersectionTestOne) |
OLD | NEW |