aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/RegionTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/RegionTest.cpp')
-rw-r--r--tests/RegionTest.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/RegionTest.cpp b/tests/RegionTest.cpp
index 23ac9b7ae9..db43e333c0 100644
--- a/tests/RegionTest.cpp
+++ b/tests/RegionTest.cpp
@@ -92,11 +92,25 @@ static void contains_proc(skiatest::Reporter* reporter,
test_contains_iter(reporter, b);
}
+static void test_intersects_iter(skiatest::Reporter* reporter, const SkRegion& rgn) {
+ SkRegion::Iterator iter(rgn);
+ while (!iter.done()) {
+ SkIRect r = iter.rect();
+ REPORTER_ASSERT(reporter, rgn.intersects(r));
+ r.inset(-1, -1);
+ REPORTER_ASSERT(reporter, rgn.intersects(r));
+ iter.next();
+ }
+}
+
static void intersects_proc(skiatest::Reporter* reporter,
const SkRegion& a, const SkRegion& b) {
bool c0 = a.intersects(b);
bool c1 = slow_intersects(a, b);
REPORTER_ASSERT(reporter, c0 == c1);
+
+ test_intersects_iter(reporter, a);
+ test_intersects_iter(reporter, b);
}
static void test_proc(skiatest::Reporter* reporter,