From 21402e3851454e90329bad52893f29959da086f7 Mon Sep 17 00:00:00 2001 From: egdaniel Date: Wed, 5 Nov 2014 05:02:27 -0800 Subject: 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 --- gm/dashing.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gm/dashing.cpp') 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); } }; -- cgit v1.2.3