aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/RoundRectTest.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-02-13 14:33:02 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-02-13 14:33:02 -0800
commit694b0d115d5efcd663c422d316d2cf3abaa1d354 (patch)
treed02766200217a405ddc5fc7dc908465d99b1525c /tests/RoundRectTest.cpp
parent4283f13af2bb12fbc2856de9a730038a8ca1f2d7 (diff)
fix more tricky-float cases in SkRRect validate
BUG=458524,458522 Review URL: https://codereview.chromium.org/921163003
Diffstat (limited to 'tests/RoundRectTest.cpp')
-rw-r--r--tests/RoundRectTest.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/RoundRectTest.cpp b/tests/RoundRectTest.cpp
index b67718a6b1..cff3e8f35a 100644
--- a/tests/RoundRectTest.cpp
+++ b/tests/RoundRectTest.cpp
@@ -9,6 +9,27 @@
#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_empty_crbug_458524(skiatest::Reporter* reporter) {
+ SkRRect rr;
+ const SkRect bounds = { 3709, 3709, 3709 + 7402, 3709 + 29825 };
+ const SkScalar rad = 40;
+ rr.setRectXY(bounds, rad, rad);
+
+ SkRRect other;
+ SkMatrix matrix;
+ matrix.setScale(0, 1);
+ rr.transform(matrix, &other);
+ REPORTER_ASSERT(reporter, SkRRect::kEmpty_Type == other.getType());
+}
+
static const SkScalar kWidth = 100.0f;
static const SkScalar kHeight = 100.0f;
@@ -621,4 +642,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_empty_crbug_458524(reporter);
}