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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 } | 422 } |
423 | 423 |
424 // Building aaclip meant aa-scan-convert a path into a huge clip. | 424 // Building aaclip meant aa-scan-convert a path into a huge clip. |
425 // the old algorithm sized the supersampler to the size of the clip, which overf
lowed | 425 // the old algorithm sized the supersampler to the size of the clip, which overf
lowed |
426 // its internal 16bit coordinates. The fix was to intersect the clip+path_bounds
before | 426 // its internal 16bit coordinates. The fix was to intersect the clip+path_bounds
before |
427 // sizing the supersampler. | 427 // sizing the supersampler. |
428 // | 428 // |
429 // Before the fix, the following code would assert in debug builds. | 429 // Before the fix, the following code would assert in debug builds. |
430 // | 430 // |
431 static void test_crbug_422693(skiatest::Reporter* reporter) { | 431 static void test_crbug_422693(skiatest::Reporter* reporter) { |
432 #if 0 | |
433 SkRasterClip rc(SkIRect::MakeLTRB(-25000, -25000, 25000, 25000)); | 432 SkRasterClip rc(SkIRect::MakeLTRB(-25000, -25000, 25000, 25000)); |
434 SkPath path; | 433 SkPath path; |
435 path.addCircle(50, 50, 50); | 434 path.addCircle(50, 50, 50); |
436 rc.op(path, rc.getBounds().size(), SkRegion::kIntersect_Op, true); | 435 rc.op(path, rc.getBounds().size(), SkRegion::kIntersect_Op, true); |
437 #endif | |
438 } | 436 } |
439 | 437 |
440 DEF_TEST(AAClip, reporter) { | 438 DEF_TEST(AAClip, reporter) { |
441 test_empty(reporter); | 439 test_empty(reporter); |
442 test_path_bounds(reporter); | 440 test_path_bounds(reporter); |
443 test_irect(reporter); | 441 test_irect(reporter); |
444 test_rgn(reporter); | 442 test_rgn(reporter); |
445 test_path_with_hole(reporter); | 443 test_path_with_hole(reporter); |
446 test_regressions(); | 444 test_regressions(); |
447 test_nearly_integral(reporter); | 445 test_nearly_integral(reporter); |
448 test_really_a_rect(reporter); | 446 test_really_a_rect(reporter); |
449 test_crbug_422693(reporter); | 447 test_crbug_422693(reporter); |
450 } | 448 } |
OLD | NEW |