diff options
author | Cary Clark <caryclark@skia.org> | 2018-04-11 14:30:27 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-04-11 19:13:07 +0000 |
commit | 8540e110f91df1b1596bd66711e5ad908de1888a (patch) | |
tree | 7a909831fa9e01e094c49696cd507b5035f25163 /gm | |
parent | ac78c7f415c20377f697a4fce42cb6572e24782b (diff) |
more path is rect bugs
More edge cases found; clean up the logic a bit
to make more clear where the rectangle points
start and stop.
R=robertphillips@google.com,brianosman@google.com
Bug: 824145,skia:7792
Change-Id: Ie24dfd1519f30875f44ffac68e20d777490b00b9
Reviewed-on: https://skia-review.googlesource.com/120422
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'gm')
-rw-r--r-- | gm/pathfill.cpp | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/gm/pathfill.cpp b/gm/pathfill.cpp index d96f356bef..af91b8409d 100644 --- a/gm/pathfill.cpp +++ b/gm/pathfill.cpp @@ -432,3 +432,70 @@ DEF_SIMPLE_GM(rotatedcubicpath, canvas, 200, 200) { DEF_GM( return new PathFillGM; ) DEF_GM( return new PathInverseFillGM; ) + +DEF_SIMPLE_GM(bug7792, canvas, 800, 200) { + // from skbug.com/7792 bug description + SkPaint p; + SkPath path; + path.moveTo(10, 10); + path.moveTo(75, 75); + path.lineTo(150, 75); + path.lineTo(150, 150); + path.lineTo(75, 150); + canvas->drawPath(path, p); + // from skbug.com/7792 comment 3 + canvas->translate(200, 0); + path.reset(); + path.moveTo(75, 50); + path.moveTo(100, 75); + path.lineTo(150, 75); + path.lineTo(150, 150); + path.lineTo(75, 150); + path.lineTo(75, 50); + path.close(); + canvas->drawPath(path, p); + // from skbug.com/7792 comment 9 + canvas->translate(200, 0); + path.reset(); + path.moveTo(10, 10); + path.moveTo(75, 75); + path.lineTo(150, 75); + path.lineTo(150, 150); + path.lineTo(75, 150); + path.close(); + canvas->drawPath(path, p); + // from skbug.com/7792 comment 11 + canvas->translate(-200 * 2, 200); + path.reset(); + path.moveTo(75, 150); + path.lineTo(75, 75); + path.lineTo(150, 75); + path.lineTo(150, 150); + path.lineTo(75, 150); + path.moveTo(75, 150); + canvas->drawPath(path, p); + // from skbug.com/7792 comment 14 + canvas->translate(200, 0); + path.reset(); + path.moveTo(250, 75); + path.moveTo(250, 75); + path.moveTo(250, 75); + path.moveTo(100, 75); + path.lineTo(150, 75); + path.lineTo(150, 150); + path.lineTo(75, 150); + path.lineTo(75, 75); + path.close(); + path.lineTo(0, 0); + path.close(); + canvas->drawPath(path, p); + // from skbug.com/7792 comment 15 + canvas->translate(200, 0); + path.reset(); + path.moveTo(75, 75); + path.lineTo(150, 75); + path.lineTo(150, 150); + path.lineTo(75, 150); + path.moveTo(250, 75); + canvas->drawPath(path, p); +} |