diff options
author | caryclark <caryclark@google.com> | 2015-03-02 10:07:56 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-02 10:07:56 -0800 |
commit | 5ccef577902ce1aefa05fb8107ad5d0aba848e7d (patch) | |
tree | d7bec4c94c21054c720a1007c4c2aca2dbd4484a /tests | |
parent | 341c808070dddc59a024bd15d1d65ca90cef3dfb (diff) |
treat backwards quads as not convex
If a quad, cubic, or conic goes back on itself, assume it's not convex.
In a future CL, we could check to see if the curve is linear so that
linear curves are treated the same as lines.
BUG=skia:3469
Review URL: https://codereview.chromium.org/971773002
Diffstat (limited to 'tests')
-rw-r--r-- | tests/PathTest.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp index a868d93d78..aeab7e6e25 100644 --- a/tests/PathTest.cpp +++ b/tests/PathTest.cpp @@ -38,6 +38,14 @@ static void test_add_rrect(skiatest::Reporter* reporter, const SkRect& bounds, REPORTER_ASSERT(reporter, bounds == path.getBounds()); } +static void test_skbug_3469(skiatest::Reporter* reporter) { + SkPath path; + path.moveTo(20, 20); + path.quadTo(20, 50, 80, 50); + path.quadTo(20, 50, 20, 80); + REPORTER_ASSERT(reporter, !path.isConvex()); +} + static void test_skbug_3239(skiatest::Reporter* reporter) { const float min = SkBits2Float(0xcb7f16c8); /* -16717512.000000 */ const float max = SkBits2Float(0x4b7f1c1d); /* 16718877.000000 */ @@ -3732,5 +3740,6 @@ DEF_TEST(Paths, reporter) { PathRefTest_Private::TestPathRef(reporter); test_dump(reporter); test_path_crbugskia2820(reporter); + test_skbug_3469(reporter); test_skbug_3239(reporter); } |