OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 | 7 |
8 #include "SkPathMeasure.h" | 8 #include "SkPathMeasure.h" |
9 #include "Test.h" | 9 #include "Test.h" |
10 | 10 |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 SkScalarNearlyEqual(position.fY, | 194 SkScalarNearlyEqual(position.fY, |
195 2.0f, | 195 2.0f, |
196 0.0001f)); | 196 0.0001f)); |
197 REPORTER_ASSERT(reporter, tangent.fX == -SK_Scalar1); | 197 REPORTER_ASSERT(reporter, tangent.fX == -SK_Scalar1); |
198 REPORTER_ASSERT(reporter, tangent.fY == 0); | 198 REPORTER_ASSERT(reporter, tangent.fY == 0); |
199 | 199 |
200 test_small_segment(); | 200 test_small_segment(); |
201 test_small_segment2(); | 201 test_small_segment2(); |
202 test_small_segment3(); | 202 test_small_segment3(); |
203 } | 203 } |
| 204 |
| 205 DEF_TEST(PathMeasureConic, reporter) { |
| 206 SkPoint stdP, hiP, pts[] = {{0,0}, {100,0}, {100,0}}; |
| 207 SkPath p; |
| 208 p.moveTo(0, 0); |
| 209 p.conicTo(pts[1], pts[2], 1); |
| 210 SkPathMeasure stdm(p, false); |
| 211 REPORTER_ASSERT(reporter, stdm.getPosTan(20, &stdP, nullptr)); |
| 212 p.reset(); |
| 213 p.moveTo(0, 0); |
| 214 p.conicTo(pts[1], pts[2], 10); |
| 215 stdm.setPath(&p, false); |
| 216 REPORTER_ASSERT(reporter, stdm.getPosTan(20, &hiP, nullptr)); |
| 217 REPORTER_ASSERT(reporter, 19.5f < stdP.fX && stdP.fX < 20.5f); |
| 218 REPORTER_ASSERT(reporter, 19.5f < hiP.fX && hiP.fX < 20.5f); |
| 219 } |
OLD | NEW |