diff options
author | caryclark <caryclark@google.com> | 2016-04-06 08:54:06 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-06 08:54:06 -0700 |
commit | 4693a1748f19fa4ee83c6eee2333b39ffb3febd4 (patch) | |
tree | edba3e060e46c29e8092521152af7109b51c8a6d /gm/cubicpaths.cpp | |
parent | c416912da4840af0c49bd8cdcf00044ed39500f6 (diff) |
cubic stroke fix
Normally parallel tangents means that the stroke can
be represented with a line. But looping cubics can
have parallel tangents if the loop is 180 degrees.
Check to see if the tangents direction is opposite
to subdivide further.
R=reed@google.com
BUG=skia:5099
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1862753002
Review URL: https://codereview.chromium.org/1862753002
Diffstat (limited to 'gm/cubicpaths.cpp')
-rw-r--r-- | gm/cubicpaths.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gm/cubicpaths.cpp b/gm/cubicpaths.cpp index 413c51757e..819dac25dc 100644 --- a/gm/cubicpaths.cpp +++ b/gm/cubicpaths.cpp @@ -413,6 +413,19 @@ private: typedef skiagm::GM INHERITED; }; +DEF_SIMPLE_GM(bug5099, canvas, 50, 50) { + SkPaint p; + p.setColor(SK_ColorRED); + p.setAntiAlias(true); + p.setStyle(SkPaint::kStroke_Style); + p.setStrokeWidth(10); + + SkPath path; + path.moveTo(6, 27); + path.cubicTo(31.5f, 1.5f, 3.5f, 4.5f, 29, 29); + canvas->drawPath(path, p); +} + ////////////////////////////////////////////////////////////////////////////// DEF_GM( return new CubicPathGM; ) |