diff options
author | Cary Clark <caryclark@skia.org> | 2018-04-12 14:00:24 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-04-12 20:45:32 +0000 |
commit | 88ba9710b5e93a3a2e15e205f6979d245e76a127 (patch) | |
tree | 19f669565d257c7cb8f2544d12ac7e51e027f0d8 /gm/pathfill.cpp | |
parent | b809efbbfae3efc1f5940a34f36cb07bf46166c5 (diff) |
son of path is rect bug
This variation tricks SkPath::isRect by exploiting
that the implementation resets the point pointer to
process the close verb, and using the reset pointer
to walk over a series of points that don't move.
In addition to fixing this, rename variables to
make the line creation more obvious, since left,
right, and friends, are not the left and right.
R=robertphillips@google.com
Bug: 824145,skia:7792
Change-Id: If8ebbc3eedd270652670d6e111a5bc02e61f0eec
Reviewed-on: https://skia-review.googlesource.com/121122
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'gm/pathfill.cpp')
-rw-r--r-- | gm/pathfill.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gm/pathfill.cpp b/gm/pathfill.cpp index 18b30c9b0b..74cafcb1c4 100644 --- a/gm/pathfill.cpp +++ b/gm/pathfill.cpp @@ -509,4 +509,19 @@ DEF_SIMPLE_GM(bug7792, canvas, 600, 600) { path.lineTo(75, 10); path.close(); canvas->drawPath(path, p); + // from skbug.com/7792 comment 19 + canvas->translate(200, 0); + path.reset(); + path.moveTo(75, 75); + path.lineTo(75, 75); + path.lineTo(75, 75); + path.lineTo(75, 75); + path.lineTo(150, 75); + path.lineTo(150, 150); + path.lineTo(75, 150); + path.close(); + path.moveTo(10, 10); + path.lineTo(30, 10); + path.lineTo(10, 30); + canvas->drawPath(path, p); } |