From c5e4e7437af95ead91e5dc33e0bf1642cd2787df Mon Sep 17 00:00:00 2001 From: Yuqian Li Date: Mon, 18 Sep 2017 14:38:43 -0400 Subject: skipRect should only work for lines (not quads or cubics) The added unit test shows that we'll trigger SkASSERT failure if we forgot to check that the edges are lines (instead of quads or cubics). Similar to skia:7015, this bug is not triggered in our production because we don't use DAA for convex paths by default. The skipRect is an optimization just for convex paths. Bug: skia:7051 Change-Id: Id87ce2d452ede0db9a48425541f473af19ee0572 Reviewed-on: https://skia-review.googlesource.com/48045 Reviewed-by: Mike Reed Commit-Queue: Yuqian Li --- tests/PathTest.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/PathTest.cpp') diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp index 8c629d9485..4fb559b323 100644 --- a/tests/PathTest.cpp +++ b/tests/PathTest.cpp @@ -4482,6 +4482,16 @@ static void test_skbug_7015() { test_draw_AA_path(500, 500, path); } +static void test_skbug_7051() { + SkPath path; + path.moveTo(10, 10); + path.cubicTo(10, 20, 10, 30, 30, 30); + path.lineTo(50, 20); + path.lineTo(50, 10); + path.close(); + test_draw_AA_path(100, 100, path); +} + #endif static void test_interp(skiatest::Reporter* reporter) { @@ -4559,6 +4569,7 @@ DEF_TEST(Paths, reporter) { #if !defined(SK_SUPPORT_LEGACY_DELTA_AA) test_skbug_6947(); test_skbug_7015(); + test_skbug_7051(); #endif SkSize::Make(3, 4); -- cgit v1.2.3