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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkRRect.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/RoundRectTest.cpp
diff --git a/tests/RoundRectTest.cpp b/tests/RoundRectTest.cpp
index 9920d1013ba81eb69f56f42b03fc67ad84d5ccf0..8d8f76fbf0084ee51bd32353cfd7d2f7cd097b19 100644
--- a/tests/RoundRectTest.cpp
+++ b/tests/RoundRectTest.cpp
@@ -9,12 +9,29 @@
#include "SkRRect.h"
#include "Test.h"
-static void test_tricky_radii_crbug_458522(skiatest::Reporter* reporter) {
- SkRRect rr;
- const SkRect bounds = { 3709, 3709, 3709 + 7402, 3709 + 29825 };
- const SkScalar rad = 12814;
- const SkVector vec[] = { { rad, rad }, { 0, rad }, { rad, rad }, { 0, rad } };
- rr.setRectRadii(bounds, vec);
+static void test_tricky_radii(skiatest::Reporter* reporter) {
+ {
+ // crbug.com/458522
+ SkRRect rr;
+ const SkRect bounds = { 3709, 3709, 3709 + 7402, 3709 + 29825 };
+ const SkScalar rad = 12814;
+ const SkVector vec[] = { { rad, rad }, { 0, rad }, { rad, rad }, { 0, rad } };
+ rr.setRectRadii(bounds, vec);
+ }
+
+ {
+ // crbug.com//463920
+ SkRect r = SkRect::MakeLTRB(0, 0, 1009, 33554432.0);
+ SkVector radii[4] = {
+ { 13.0f, 8.0f }, { 170.0f, 2.0 }, { 256.0f, 33554432.0 }, { 110.0f, 5.0f }
+ };
+ SkRRect rr;
+ rr.setRectRadii(r, radii);
+
+ REPORTER_ASSERT(reporter, (double) rr.radii(SkRRect::kUpperRight_Corner).fY +
+ (double) rr.radii(SkRRect::kLowerRight_Corner).fY <=
+ rr.height());
+ }
}
static void test_empty_crbug_458524(skiatest::Reporter* reporter) {
@@ -660,6 +677,6 @@ DEF_TEST(RoundRect, reporter) {
test_round_rect_contains_rect(reporter);
test_round_rect_transform(reporter);
test_issue_2696(reporter);
- test_tricky_radii_crbug_458522(reporter);
+ test_tricky_radii(reporter);
test_empty_crbug_458524(reporter);
}
« 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