Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: tests/RoundRectTest.cpp

Issue 998903003: Fix bug with very large round rects with large radii (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Added comment Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkRRect.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « src/core/SkRRect.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698