diff options
author | Brian Salomon <bsalomon@google.com> | 2017-08-07 11:15:00 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-08-08 15:38:30 +0000 |
commit | e9bf6dc100e2ce913ee000273e1879ebc1ffbafd (patch) | |
tree | 6d7ffa217ed1d3f8ecbfc914f168dedd07ae7a4f /tests/PathTest.cpp | |
parent | 04e4dd3eed1be9fd07b7f3cf9fb7ec955ac1a5f7 (diff) |
Don't compare against uninit edge in SkPath::conservativelyContainsRect
Bug: chromium:752478
Change-Id: Ic281f06b300329ea9823b3eb76cc56b7a43fd2a5
Reviewed-on: https://skia-review.googlesource.com/31520
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tests/PathTest.cpp')
-rw-r--r-- | tests/PathTest.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp index cdaa1c5845..1c6c6e81fc 100644 --- a/tests/PathTest.cpp +++ b/tests/PathTest.cpp @@ -1955,6 +1955,13 @@ static void test_conservativelyContains(skiatest::Reporter* reporter) { path.reset(); path.lineTo(100, 100); REPORTER_ASSERT(reporter, !path.conservativelyContainsRect(SkRect::MakeXYWH(0, 0, 1, 1))); + + // An empty path should not contain any rectangle. It's questionable whether an empty path + // contains an empty rectangle. However, since it is a conservative test it is ok to + // return false. + path.reset(); + REPORTER_ASSERT(reporter, !path.conservativelyContainsRect(SkRect::MakeWH(1,1))); + REPORTER_ASSERT(reporter, !path.conservativelyContainsRect(SkRect::MakeWH(0,0))); } static void test_isRect_open_close(skiatest::Reporter* reporter) { |