OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkMatrix.h" | 8 #include "SkMatrix.h" |
9 #include "SkRRect.h" | 9 #include "SkRRect.h" |
10 #include "Test.h" | 10 #include "Test.h" |
11 | 11 |
12 static void test_tricky_radii_crbug_458522(skiatest::Reporter* reporter) { | 12 static void test_tricky_radii(skiatest::Reporter* reporter) { |
13 SkRRect rr; | 13 { |
14 const SkRect bounds = { 3709, 3709, 3709 + 7402, 3709 + 29825 }; | 14 // crbug.com/458522 |
15 const SkScalar rad = 12814; | 15 SkRRect rr; |
16 const SkVector vec[] = { { rad, rad }, { 0, rad }, { rad, rad }, { 0, rad }
}; | 16 const SkRect bounds = { 3709, 3709, 3709 + 7402, 3709 + 29825 }; |
17 rr.setRectRadii(bounds, vec); | 17 const SkScalar rad = 12814; |
| 18 const SkVector vec[] = { { rad, rad }, { 0, rad }, { rad, rad }, { 0, ra
d } }; |
| 19 rr.setRectRadii(bounds, vec); |
| 20 } |
| 21 |
| 22 { |
| 23 // crbug.com//463920 |
| 24 SkRect r = SkRect::MakeLTRB(0, 0, 1009, 33554432.0); |
| 25 SkVector radii[4] = { |
| 26 { 13.0f, 8.0f }, { 170.0f, 2.0 }, { 256.0f, 33554432.0 }, { 110.0f,
5.0f } |
| 27 }; |
| 28 SkRRect rr; |
| 29 rr.setRectRadii(r, radii); |
| 30 |
| 31 REPORTER_ASSERT(reporter, (double) rr.radii(SkRRect::kUpperRight_Corner)
.fY + |
| 32 (double) rr.radii(SkRRect::kLowerRight_Corner)
.fY <= |
| 33 rr.height()); |
| 34 } |
18 } | 35 } |
19 | 36 |
20 static void test_empty_crbug_458524(skiatest::Reporter* reporter) { | 37 static void test_empty_crbug_458524(skiatest::Reporter* reporter) { |
21 SkRRect rr; | 38 SkRRect rr; |
22 const SkRect bounds = { 3709, 3709, 3709 + 7402, 3709 + 29825 }; | 39 const SkRect bounds = { 3709, 3709, 3709 + 7402, 3709 + 29825 }; |
23 const SkScalar rad = 40; | 40 const SkScalar rad = 40; |
24 rr.setRectXY(bounds, rad, rad); | 41 rr.setRectXY(bounds, rad, rad); |
25 | 42 |
26 SkRRect other; | 43 SkRRect other; |
27 SkMatrix matrix; | 44 SkMatrix matrix; |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 DEF_TEST(RoundRect, reporter) { | 670 DEF_TEST(RoundRect, reporter) { |
654 test_round_rect_basic(reporter); | 671 test_round_rect_basic(reporter); |
655 test_round_rect_rects(reporter); | 672 test_round_rect_rects(reporter); |
656 test_round_rect_ovals(reporter); | 673 test_round_rect_ovals(reporter); |
657 test_round_rect_general(reporter); | 674 test_round_rect_general(reporter); |
658 test_round_rect_iffy_parameters(reporter); | 675 test_round_rect_iffy_parameters(reporter); |
659 test_inset(reporter); | 676 test_inset(reporter); |
660 test_round_rect_contains_rect(reporter); | 677 test_round_rect_contains_rect(reporter); |
661 test_round_rect_transform(reporter); | 678 test_round_rect_transform(reporter); |
662 test_issue_2696(reporter); | 679 test_issue_2696(reporter); |
663 test_tricky_radii_crbug_458522(reporter); | 680 test_tricky_radii(reporter); |
664 test_empty_crbug_458524(reporter); | 681 test_empty_crbug_458524(reporter); |
665 } | 682 } |
OLD | NEW |