diff options
author | 2015-12-17 09:03:27 -0800 | |
---|---|---|
committer | 2015-12-17 09:03:28 -0800 | |
commit | c91065d028472688ce15e635a29abe5256ff89ef (patch) | |
tree | 1bd18e7488def6f660f38681438c99a3e244f001 /tests/PathTest.cpp | |
parent | f0795ab1f2556b5ef45ee48983c32d5d0be0a8da (diff) |
Use the unswapped end point y for early out case in winding_line
The x-coordinates are not swapped, so using the swapped y will result
in a comparison with the wrong (end) point.
BUG=skia:4265
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1533873002
Review URL: https://codereview.chromium.org/1533873002
Diffstat (limited to 'tests/PathTest.cpp')
-rw-r--r-- | tests/PathTest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp index 464943b8dc..aa2ffdb32f 100644 --- a/tests/PathTest.cpp +++ b/tests/PathTest.cpp @@ -3542,6 +3542,16 @@ static void test_contains(skiatest::Reporter* reporter) { REPORTER_ASSERT(reporter, !p.contains(7, 7)); p.reset(); p.moveTo(4, 4); + p.lineTo(8, 4); + p.lineTo(8, 8); + p.lineTo(4, 8); + // test on vertices + REPORTER_ASSERT(reporter, p.contains(4, 4)); + REPORTER_ASSERT(reporter, p.contains(8, 4)); + REPORTER_ASSERT(reporter, p.contains(8, 8)); + REPORTER_ASSERT(reporter, p.contains(4, 8)); + p.reset(); + p.moveTo(4, 4); p.lineTo(6, 8); p.lineTo(2, 8); // test on edge |