diff options
author | caryclark <caryclark@google.com> | 2016-03-01 09:42:03 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-01 09:42:03 -0800 |
commit | e3e8c727413f9473e139b69d43f89b8884e732d7 (patch) | |
tree | 1b1f9b69903a870170b0ab7b5693cdc6b0855735 /gm/pathfill.cpp | |
parent | 9ea8acdf3ff8b7787e59de8c393e12a72b34ddc0 (diff) |
add gm for distance field bug
Added gm to illustrate this bug. If you trace through
the red path, it uses GrAADistanceFieldPathRenderer
when it draws without antialiasing.
R=jvanverth@google.com
BUG=skia:4864
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1755683002
Review URL: https://codereview.chromium.org/1755683002
Diffstat (limited to 'gm/pathfill.cpp')
-rw-r--r-- | gm/pathfill.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gm/pathfill.cpp b/gm/pathfill.cpp index a524588241..b4010ce606 100644 --- a/gm/pathfill.cpp +++ b/gm/pathfill.cpp @@ -213,6 +213,28 @@ private: typedef skiagm::GM INHERITED; }; +DEF_SIMPLE_GM(rotatedcubicpath, canvas, 200, 200) { + SkPaint p; + p.setAntiAlias(true); + p.setStyle(SkPaint::kFill_Style); + + canvas->translate(50, 50); + SkPath path; + path.moveTo(48,-23); + path.cubicTo(48,-29.5, 6,-30, 6,-30); + path.cubicTo(6,-30, 2,0, 2,0); + path.cubicTo(2,0, 44,-21.5, 48,-23); + path.close(); + + p.setColor(SK_ColorBLUE); + canvas->drawPath(path, p); + + // Rotated path, which is not antialiased on GPU + p.setColor(SK_ColorRED); + canvas->rotate(90); + canvas->drawPath(path, p); +} + /////////////////////////////////////////////////////////////////////////////// DEF_GM( return new PathFillGM; ) |