| 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 "SkAAClip.h" | 8 #include "SkAAClip.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkMask.h" | 10 #include "SkMask.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 REPORTER_ASSERT(reporter, !clip0.getBounds().isEmpty()); | 221 REPORTER_ASSERT(reporter, !clip0.getBounds().isEmpty()); |
| 222 REPORTER_ASSERT(reporter, clip0 != clip1); | 222 REPORTER_ASSERT(reporter, clip0 != clip1); |
| 223 REPORTER_ASSERT(reporter, clip0.getBounds() == r); | 223 REPORTER_ASSERT(reporter, clip0.getBounds() == r); |
| 224 | 224 |
| 225 clip0.setEmpty(); | 225 clip0.setEmpty(); |
| 226 REPORTER_ASSERT(reporter, clip0.isEmpty()); | 226 REPORTER_ASSERT(reporter, clip0.isEmpty()); |
| 227 REPORTER_ASSERT(reporter, clip0.getBounds().isEmpty()); | 227 REPORTER_ASSERT(reporter, clip0.getBounds().isEmpty()); |
| 228 REPORTER_ASSERT(reporter, clip1 == clip0); | 228 REPORTER_ASSERT(reporter, clip1 == clip0); |
| 229 | 229 |
| 230 SkMask mask; | 230 SkMask mask; |
| 231 mask.fImage = nullptr; | |
| 232 clip0.copyToMask(&mask); | 231 clip0.copyToMask(&mask); |
| 233 REPORTER_ASSERT(reporter, nullptr == mask.fImage); | 232 REPORTER_ASSERT(reporter, nullptr == mask.fImage); |
| 234 REPORTER_ASSERT(reporter, mask.fBounds.isEmpty()); | 233 REPORTER_ASSERT(reporter, mask.fBounds.isEmpty()); |
| 235 } | 234 } |
| 236 | 235 |
| 237 static void rand_irect(SkIRect* r, int N, SkRandom& rand) { | 236 static void rand_irect(SkIRect* r, int N, SkRandom& rand) { |
| 238 r->setXYWH(0, 0, rand.nextU() % N, rand.nextU() % N); | 237 r->setXYWH(0, 0, rand.nextU() % N, rand.nextU() % N); |
| 239 int dx = rand.nextU() % (2*N); | 238 int dx = rand.nextU() % (2*N); |
| 240 int dy = rand.nextU() % (2*N); | 239 int dy = rand.nextU() % (2*N); |
| 241 // use int dx,dy to make the subtract be signed | 240 // use int dx,dy to make the subtract be signed |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 test_empty(reporter); | 438 test_empty(reporter); |
| 440 test_path_bounds(reporter); | 439 test_path_bounds(reporter); |
| 441 test_irect(reporter); | 440 test_irect(reporter); |
| 442 test_rgn(reporter); | 441 test_rgn(reporter); |
| 443 test_path_with_hole(reporter); | 442 test_path_with_hole(reporter); |
| 444 test_regressions(); | 443 test_regressions(); |
| 445 test_nearly_integral(reporter); | 444 test_nearly_integral(reporter); |
| 446 test_really_a_rect(reporter); | 445 test_really_a_rect(reporter); |
| 447 test_crbug_422693(reporter); | 446 test_crbug_422693(reporter); |
| 448 } | 447 } |
| OLD | NEW |