diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-05-21 16:47:43 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-05-21 16:47:43 +0000 |
commit | de1837bb96b0f72dad7482786d6e577013d4a85b (patch) | |
tree | dd8014fad98ff030bca602091b294ec9da83c429 /gm/dashing.cpp | |
parent | c811ea3d3cbdc69053b697e1f9cbef97c8c81f8b (diff) |
remove bogus nearlyzero checks
Review URL: https://codereview.appspot.com/6213060
git-svn-id: http://skia.googlecode.com/svn/trunk@4014 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm/dashing.cpp')
-rw-r--r-- | gm/dashing.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/gm/dashing.cpp b/gm/dashing.cpp index 2fdda4fae0..196b401495 100644 --- a/gm/dashing.cpp +++ b/gm/dashing.cpp @@ -10,7 +10,8 @@ #include "SkPaint.h" #include "SkDashPathEffect.h" -static void drawline(SkCanvas* canvas, int on, int off, const SkPaint& paint) { +static void drawline(SkCanvas* canvas, int on, int off, const SkPaint& paint, + SkScalar finalX = SkIntToScalar(600)) { SkPaint p(paint); const SkScalar intervals[] = { @@ -19,7 +20,16 @@ static void drawline(SkCanvas* canvas, int on, int off, const SkPaint& paint) { }; p.setPathEffect(new SkDashPathEffect(intervals, 2, 0))->unref(); - canvas->drawLine(0, 0, SkIntToScalar(600), 0, p); + canvas->drawLine(0, 0, finalX, 0, p); +} + +// earlier bug stopped us from drawing very long single-segment dashes, because +// SkPathMeasure was skipping very small delta-T values (nearlyzero). This is +// now fixes, so this giant dash should appear. +static void show_giant_dash(SkCanvas* canvas) { + SkPaint paint; + + drawline(canvas, 1, 1, paint, SkIntToScalar(20 * 1000)); } class DashingGM : public skiagm::GM { @@ -64,6 +74,8 @@ protected: } } } + + show_giant_dash(canvas); } }; |