diff options
author | egdaniel <egdaniel@google.com> | 2014-11-05 05:02:27 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-05 05:02:27 -0800 |
commit | 21402e3851454e90329bad52893f29959da086f7 (patch) | |
tree | 06923683a74242ca885cf1c667974ea7fd1260db /gm/dashing.cpp | |
parent | 9f2251c73ed6f417dd1057d487bf523e04488440 (diff) |
Bug fix for cull_line in SkDashPathEffect.
In cull_line we must also check if both points are the same. Otherwise we
fail the assert in the else "SkASSERT(dy && !dx)".
This is currently blocking the roll as it fails a webkit test.
BUG=skia:
Review URL: https://codereview.chromium.org/703783002
Diffstat (limited to 'gm/dashing.cpp')
-rw-r--r-- | gm/dashing.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gm/dashing.cpp b/gm/dashing.cpp index d6c1c97df9..7e32bfaf90 100644 --- a/gm/dashing.cpp +++ b/gm/dashing.cpp @@ -34,6 +34,16 @@ static void show_giant_dash(SkCanvas* canvas) { drawline(canvas, 1, 1, paint, SkIntToScalar(20 * 1000)); } +static void show_zero_len_dash(SkCanvas* canvas) { + SkPaint paint; + + drawline(canvas, 2, 2, paint, SkIntToScalar(0)); + paint.setStyle(SkPaint::kStroke_Style); + paint.setStrokeWidth(SkIntToScalar(2)); + canvas->translate(0, SkIntToScalar(20)); + drawline(canvas, 4, 4, paint, SkIntToScalar(0)); +} + class DashingGM : public skiagm::GM { public: DashingGM() {} @@ -81,6 +91,8 @@ protected: } show_giant_dash(canvas); + canvas->translate(0, SkIntToScalar(20)); + show_zero_len_dash(canvas); } }; |