aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PathTest.cpp
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2018-04-09 16:07:11 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-10 11:53:53 +0000
commit5c715188470e97e4f573ffe78b7ee9451aaa7612 (patch)
treeda999fa13996a8fbae6df7dc320c25dd6c6e8103 /tests/PathTest.cpp
parent84660e986d10489c9c29613dd4df38771c7d64f8 (diff)
fix path to rect when missing close verb
R=brianosman@google.com,robertphillips@google.com TBR=reed@google.com Bug: 824145,skia:7792 Change-Id: I24f121cfa7d437c95b94bd917d3c4888a10c519e Reviewed-on: https://skia-review.googlesource.com/119569 Commit-Queue: Cary Clark <caryclark@skia.org> Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests/PathTest.cpp')
-rw-r--r--tests/PathTest.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index a87b371b5e..c3c023d6a6 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -4899,3 +4899,16 @@ DEF_TEST(ClipPath_nonfinite, reporter) {
REPORTER_ASSERT(reporter, !canvas->isClipEmpty());
}
+// skbug.com/7792
+DEF_TEST(Path_isRect, reporter) {
+ SkPath path;
+ SkPoint points[] = { {10, 10}, {75, 75}, {150, 75}, {150, 150}, {75, 150} };
+ for (size_t index = 0; index < SK_ARRAY_COUNT(points); ++index) {
+ index < 2 ? path.moveTo(points[index]) : path.lineTo(points[index]);
+ }
+ SkRect rect;
+ REPORTER_ASSERT(reporter, path.isRect(&rect, nullptr, nullptr));
+ SkRect compare;
+ compare.set(&points[1], SK_ARRAY_COUNT(points) - 1);
+ REPORTER_ASSERT(reporter, rect == compare);
+}