| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkRandom.h" |
| 9 #include "SkRegion.h" |
| 8 #include "Test.h" | 10 #include "Test.h" |
| 9 #include "SkRegion.h" | |
| 10 #include "SkRandom.h" | |
| 11 | 11 |
| 12 static void Union(SkRegion* rgn, const SkIRect& rect) { | 12 static void Union(SkRegion* rgn, const SkIRect& rect) { |
| 13 rgn->op(rect, SkRegion::kUnion_Op); | 13 rgn->op(rect, SkRegion::kUnion_Op); |
| 14 } | 14 } |
| 15 | 15 |
| 16 #define TEST_NO_INTERSECT(rgn, rect) REPORTER_ASSERT(reporter, !rgn.intersect
s(rect)) | 16 #define TEST_NO_INTERSECT(rgn, rect) REPORTER_ASSERT(reporter, !rgn.intersect
s(rect)) |
| 17 #define TEST_INTERSECT(rgn, rect) REPORTER_ASSERT(reporter, rgn.intersects
(rect)) | 17 #define TEST_INTERSECT(rgn, rect) REPORTER_ASSERT(reporter, rgn.intersects
(rect)) |
| 18 #define TEST_NO_CONTAINS(rgn, rect) REPORTER_ASSERT(reporter, !rgn.contains(
rect)) | 18 #define TEST_NO_CONTAINS(rgn, rect) REPORTER_ASSERT(reporter, !rgn.contains(
rect)) |
| 19 | 19 |
| 20 // inspired by http://code.google.com/p/skia/issues/detail?id=958 | 20 // inspired by http://code.google.com/p/skia/issues/detail?id=958 |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 rand_rect(&rect[j], rand); | 247 rand_rect(&rect[j], rand); |
| 248 } | 248 } |
| 249 REPORTER_ASSERT(reporter, test_rects(rect, N)); | 249 REPORTER_ASSERT(reporter, test_rects(rect, N)); |
| 250 } | 250 } |
| 251 | 251 |
| 252 test_proc(reporter, contains_proc); | 252 test_proc(reporter, contains_proc); |
| 253 test_proc(reporter, intersects_proc); | 253 test_proc(reporter, intersects_proc); |
| 254 test_empties(reporter); | 254 test_empties(reporter); |
| 255 test_fromchrome(reporter); | 255 test_fromchrome(reporter); |
| 256 } | 256 } |
| OLD | NEW |