Flutter Engine
The Flutter Engine
crbug_1113794.cpp
Go to the documentation of this file.
1/*
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"
11#include "include/core/SkPath.h"
14
15DEF_SIMPLE_GM(crbug_1113794, canvas, 600, 200) {
16 SkPath path = SkPath::Line({50.f, 80.f}, {50.f, 20.f});
17
19 paint.setColor(SK_ColorBLACK);
20 paint.setAntiAlias(true);
21 paint.setStrokeWidth(0.25f);
23
24 static constexpr SkScalar kDash[2] = {10.f, 10.f};
25 paint.setPathEffect(SkDashPathEffect::Make(kDash, 2, 0.f));
26
27 SkMatrix viewBox = SkMatrix::RectToRect(SkRect::MakeWH(100, 100), SkRect::MakeWH(600, 200));
28 canvas->concat(viewBox);
29
30 canvas->drawPath(path, paint);
31}
constexpr SkColor SK_ColorBLACK
Definition: SkColor.h:103
static sk_sp< SkPathEffect > Make(const SkScalar intervals[], int count, SkScalar phase)
static SkMatrix RectToRect(const SkRect &src, const SkRect &dst, ScaleToFit mode=kFill_ScaleToFit)
Definition: SkMatrix.h:157
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
Definition: SkPath.h:59
static SkPath Line(const SkPoint a, const SkPoint b)
Definition: SkPath.h:106
const Paint & paint
Definition: color_source.cc:38
DEF_SIMPLE_GM(crbug_1113794, canvas, 600, 200)
float SkScalar
Definition: extension.cpp:12
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57
static constexpr SkRect MakeWH(float w, float h)
Definition: SkRect.h:609