diff options
| author | Yuqian Li <liyuqian@google.com> | 2016-11-29 10:27:16 -0500 |
|---|---|---|
| committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-11-29 18:18:54 +0000 |
| commit | 9939bd6454bbaaa7c20afef6ec5740db077c9885 (patch) | |
| tree | b2010b768b1ca18f910d1ff5900bf969c72d67d4 /tests/PathTest.cpp | |
| parent | cdb4d3c81d167ecad5f2176499540097443a5b2b (diff) | |
Compute slope using fSnappedY
If we use the oldy and dy directly as we did previously, the slope could
be very different from (newSnappedX - fSnappedX) / (newSnappedY -
fSnappedY) in the updateLine when the edge made a lot of updates with
small dy but large dx. That will cause bug skia:5995
BUG=skia:5995
Change-Id: If521976ed87195dfea5961afd58bedb98447c568
Reviewed-on: https://skia-review.googlesource.com/5269
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
Diffstat (limited to 'tests/PathTest.cpp')
| -rw-r--r-- | tests/PathTest.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp index f064a16f77..9be3976dae 100644 --- a/tests/PathTest.cpp +++ b/tests/PathTest.cpp @@ -242,6 +242,19 @@ static void test_path_crbugskia2820(skiatest::Reporter* reporter) {//GrContext* stroke.applyToPath(&path, path); } +static void test_path_crbugskia5995() { + auto surface(SkSurface::MakeRasterN32Premul(500, 500)); + SkCanvas* canvas = surface->getCanvas(); + SkPaint paint; + paint.setAntiAlias(true); + SkPath path; + path.moveTo(SkBits2Float(0x40303030), SkBits2Float(0x3e303030)); // 2.75294f, 0.172059f + path.quadTo(SkBits2Float(0x41d63030), SkBits2Float(0x30303030), SkBits2Float(0x41013030), + SkBits2Float(0x00000000)); // 26.7735f, 6.40969e-10f, 8.07426f, 0 + path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0 + canvas->drawPath(path, paint); +} + static void make_path0(SkPath* path) { // from * https://code.google.com/p/skia/issues/detail?id=1706 @@ -4528,6 +4541,7 @@ DEF_TEST(Paths, reporter) { test_dump(reporter); test_path_crbug389050(reporter); test_path_crbugskia2820(reporter); + test_path_crbugskia5995(); test_skbug_3469(reporter); test_skbug_3239(reporter); test_bounds_crbug_513799(reporter); |
