aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/strokes.cpp
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2015-11-30 13:47:11 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-11-30 13:47:11 -0800
commitb775e91e8760200f145a95672c29cc703b8a4f5f (patch)
tree0325d0f0abd3b810478b91b4123e7db161e308ab /gm/strokes.cpp
parent69cfe95b7be386cf7d349b61388e93ea7c3cd386 (diff)
add more conservative check for wayward divide
When the parallel stroke to the curve can't be computed from the intersection of the tangent lines, as straight line connects the two points instead. Allow the intersection to succeed unless the ratio isn't finite or the contribution of (1 - ratio) isn't significant. R=reed@google.com,fmalita@chromium.org BUG=skia:4603 Review URL: https://codereview.chromium.org/1484873003
Diffstat (limited to 'gm/strokes.cpp')
-rw-r--r--gm/strokes.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/gm/strokes.cpp b/gm/strokes.cpp
index bd393829e0..aa2db9ccb2 100644
--- a/gm/strokes.cpp
+++ b/gm/strokes.cpp
@@ -193,6 +193,22 @@ private:
typedef skiagm::GM INHERITED;
};
+DEF_SIMPLE_GM(CubicStroke, canvas, 384, 384) {
+ SkPaint p;
+ p.setAntiAlias(true);
+ p.setStyle(SkPaint::kStroke_Style);
+ p.setStrokeWidth(1.0720f);
+ SkPath path;
+ path.moveTo(-6000,-6000);
+ path.cubicTo(-3500,5500,-500,5500,2500,-6500);
+ canvas->drawPath(path, p);
+ p.setStrokeWidth(1.0721f);
+ canvas->translate(10, 10);
+ canvas->drawPath(path, p);
+ p.setStrokeWidth(1.0722f);
+ canvas->translate(10, 10);
+ canvas->drawPath(path, p);
+}
class Strokes2GM : public skiagm::GM {
SkPath fPath;