Chromium Code Reviews| Index: tests/PathTest.cpp |
| diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp |
| index 3941ad6e183946ff42f86a40434c87c8b5467f02..5c00b53ac5129dfff87ce438d008823c2ff6f96d 100644 |
| --- a/tests/PathTest.cpp |
| +++ b/tests/PathTest.cpp |
| @@ -64,6 +64,37 @@ static void test_path_crbug364224() { |
| canvas->drawPath(path, paint); |
| } |
| +/** |
| + * In debug mode, this path is causing an assertion to fail in |
| + * SkPathStroker::preJoinTo() and, in Release, the use of an unitialized value. |
| + */ |
| +static void make_path_crbugskia2820(SkPath* path, skiatest::Reporter* reporter) { |
| + SkPoint orig, p1, p2, p3; |
| + orig = SkPoint::Make(SkIntToScalar(1), SkIntToScalar(1)); |
|
reed1
2014/08/20 19:07:18
:)
I find this very hard to read. Looking right b
Rémi Piotaix
2014/08/20 19:21:08
Done.
|
| + p1 = SkPoint::Make(SkIntToScalar(1)-SK_ScalarNearlyZero, SkIntToScalar(1)); |
| + p2 = SkPoint::Make(SkIntToScalar(1), SkIntToScalar(1)+SK_ScalarNearlyZero); |
| + p3 = SkPoint::Make(SkIntToScalar(2), SkIntToScalar(2)); |
| + |
| + REPORTER_ASSERT(reporter, SkPath::IsLineDegenerate(orig, p1)); |
|
reed1
2014/08/20 19:07:18
These lines are testing some aspect of IsLineDegen
Rémi Piotaix
2014/08/20 19:21:09
Done.
|
| + REPORTER_ASSERT(reporter, SkPath::IsLineDegenerate(orig, p2)); |
| + REPORTER_ASSERT(reporter, !SkPath::IsLineDegenerate(p1, p2)); |
| + REPORTER_ASSERT(reporter, !SkPath::IsLineDegenerate(p2, p3)); |
| + |
| + path->reset(); |
| + path->moveTo(SkIntToScalar(1), SkIntToScalar(1)); |
| + path->cubicTo(p1, p2, p3); |
| + path->close(); |
| +} |
| + |
| +static void test_path_crbugskia2820(skiatest::Reporter* reporter) {//GrContext* context) { |
| + SkPath path; |
| + make_path_crbugskia2820(&path, reporter); |
| + |
| + SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle); |
| + stroke.setStrokeStyle(2 * SK_Scalar1); |
| + stroke.applyToPath(&path, path); |
| +} |
| + |
| static void make_path0(SkPath* path) { |
| // from * https://code.google.com/p/skia/issues/detail?id=1706 |
| @@ -3553,4 +3584,5 @@ DEF_TEST(Paths, reporter) { |
| PathTest_Private::TestPathTo(reporter); |
| PathRefTest_Private::TestPathRef(reporter); |
| test_dump(reporter); |
| + test_path_crbugskia2820(reporter); |
| } |