diff options
author | Yuqian Li <liyuqian@google.com> | 2017-09-06 17:10:05 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-07 14:30:01 +0000 |
commit | a81b62674aa0bc382b8efbc54aaae8a75b6ec6ed (patch) | |
tree | c1d191eea011bb32d44d2f3b1126e7ef4feb3e1e /tests | |
parent | ca82a922e3d081ae83c940f4fd3ccc8cc6f0916f (diff) |
Fix SkASSERT for convex paths with DAA
As DAA does not chop edges at Y extrema, it's valid for convex edges to
have only one edge (e.g., a single cubic edge with the valley shape \_/).
This wasn't an issue for production because DAA is never called for
convex paths by default.
Bug=skia:7015
Change-Id: Iac79801d6a24188970ef6f7bf723494a25d92a1e
Reviewed-on: https://skia-review.googlesource.com/42942
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/PathTest.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp index 37127ff129..bdd15fbfb3 100644 --- a/tests/PathTest.cpp +++ b/tests/PathTest.cpp @@ -4517,6 +4517,24 @@ static void test_skbug_6947() { paint.setAntiAlias(true); surface->getCanvas()->drawPath(path, paint); } + +static void test_skbug_7015() { + SkPath path; + path.setFillType(SkPath::kWinding_FillType); + path.moveTo(SkBits2Float(0x4388c000), SkBits2Float(0x43947c08)); // 273.5f, 296.969f + path.lineTo(SkBits2Float(0x4386c000), SkBits2Float(0x43947c08)); // 269.5f, 296.969f + // 269.297f, 292.172f, 273.695f, 292.172f, 273.5f, 296.969f + path.cubicTo(SkBits2Float(0x4386a604), SkBits2Float(0x43921604), + SkBits2Float(0x4388d8f6), SkBits2Float(0x43921604), + SkBits2Float(0x4388c000), SkBits2Float(0x43947c08)); + path.close(); + + auto surface = SkSurface::MakeRasterN32Premul(500, 500); + SkPaint paint; + paint.setAntiAlias(true); + surface->getCanvas()->drawPath(path, paint); +} + #endif static void test_interp(skiatest::Reporter* reporter) { @@ -4593,6 +4611,7 @@ DEF_TEST(Paths, reporter) { test_fuzz_crbug_668907(); #if !defined(SK_SUPPORT_LEGACY_DELTA_AA) test_skbug_6947(); + test_skbug_7015(); #endif SkSize::Make(3, 4); |