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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 | 327 |
328 SkAAClip clip; | 328 SkAAClip clip; |
329 clip.setPath(path); | 329 clip.setPath(path); |
330 | 330 |
331 REPORTER_ASSERT(reporter, clip.getBounds() == SkIRect::MakeWH(100, 100)); | 331 REPORTER_ASSERT(reporter, clip.getBounds() == SkIRect::MakeWH(100, 100)); |
332 REPORTER_ASSERT(reporter, !clip.isRect()); | 332 REPORTER_ASSERT(reporter, !clip.isRect()); |
333 | 333 |
334 // This rect should intersect the clip, but slice-out all of the "soft" part
s, | 334 // This rect should intersect the clip, but slice-out all of the "soft" part
s, |
335 // leaving just a rect. | 335 // leaving just a rect. |
336 const SkIRect ir = SkIRect::MakeLTRB(10, -10, 50, 90); | 336 const SkIRect ir = SkIRect::MakeLTRB(10, -10, 50, 90); |
337 | 337 |
338 clip.op(ir, SkRegion::kIntersect_Op); | 338 clip.op(ir, SkRegion::kIntersect_Op); |
339 | 339 |
340 REPORTER_ASSERT(reporter, clip.getBounds() == SkIRect::MakeLTRB(10, 0, 50, 9
0)); | 340 REPORTER_ASSERT(reporter, clip.getBounds() == SkIRect::MakeLTRB(10, 0, 50, 9
0)); |
341 // the clip recognized that that it is just a rect! | 341 // the clip recognized that that it is just a rect! |
342 REPORTER_ASSERT(reporter, clip.isRect()); | 342 REPORTER_ASSERT(reporter, clip.isRect()); |
343 } | 343 } |
344 | 344 |
345 #include "SkRasterClip.h" | 345 #include "SkRasterClip.h" |
346 | 346 |
347 static void copyToMask(const SkRasterClip& rc, SkMask* mask) { | 347 static void copyToMask(const SkRasterClip& rc, SkMask* mask) { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 test_empty(reporter); | 439 test_empty(reporter); |
440 test_path_bounds(reporter); | 440 test_path_bounds(reporter); |
441 test_irect(reporter); | 441 test_irect(reporter); |
442 test_rgn(reporter); | 442 test_rgn(reporter); |
443 test_path_with_hole(reporter); | 443 test_path_with_hole(reporter); |
444 test_regressions(); | 444 test_regressions(); |
445 test_nearly_integral(reporter); | 445 test_nearly_integral(reporter); |
446 test_really_a_rect(reporter); | 446 test_really_a_rect(reporter); |
447 test_crbug_422693(reporter); | 447 test_crbug_422693(reporter); |
448 } | 448 } |
OLD | NEW |