From e9bf6dc100e2ce913ee000273e1879ebc1ffbafd Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Mon, 7 Aug 2017 11:15:00 -0400 Subject: 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 Commit-Queue: Brian Salomon --- tests/PathTest.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/PathTest.cpp') 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) { -- cgit v1.2.3