blob: 40f4c89538b25505e26c21a2719ab85a556cb4c7 [file] [log] [blame]
Michael Ludwig417f3a52020-08-11 17:26:09 -04001/*
2 * Copyright 2020 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#include "gm/gm.h"
9#include "include/core/SkCanvas.h"
10#include "include/core/SkPaint.h"
11#include "include/core/SkPath.h"
Kevin Lubickcb4beb22022-09-14 10:51:46 -040012#include "include/core/SkPathEffect.h"
Michael Ludwig417f3a52020-08-11 17:26:09 -040013#include "include/effects/SkDashPathEffect.h"
14
15DEF_SIMPLE_GM(crbug_1113794, canvas, 600, 200) {
Mike Reed15a54032020-08-16 11:15:41 -040016 SkPath path = SkPath::Line({50.f, 80.f}, {50.f, 20.f});
Michael Ludwig417f3a52020-08-11 17:26:09 -040017
18 SkPaint paint;
19 paint.setColor(SK_ColorBLACK);
20 paint.setAntiAlias(true);
21 paint.setStrokeWidth(0.25f);
22 paint.setStyle(SkPaint::kStroke_Style);
23
24 static constexpr SkScalar kDash[2] = {10.f, 10.f};
25 paint.setPathEffect(SkDashPathEffect::Make(kDash, 2, 0.f));
26
Mike Reed2ac6ce82021-01-15 12:26:22 -050027 SkMatrix viewBox = SkMatrix::RectToRect(SkRect::MakeWH(100, 100), SkRect::MakeWH(600, 200));
Michael Ludwig417f3a52020-08-11 17:26:09 -040028 canvas->concat(viewBox);
29
30 canvas->drawPath(path, paint);
31}