Flutter Engine
The Flutter Engine
stroke_closed_degenerate_path.cpp
Go to the documentation of this file.
1// Copyright 2020 Google LLC.
2// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
4REG_FIDDLE(stroke_closed_degenerate_path, 256, 256, false, 0) {
5void draw(SkCanvas* canvas) {
7 path.addRect({50.f, 50.f, 50.f, 50.f});
8
9 SkPaint joinStroke;
10 joinStroke.setColor(SK_ColorGREEN);
11 joinStroke.setStrokeWidth(10.f);
14 canvas->drawPath(path, joinStroke);
15
16 canvas->translate(100.f, 0);
17
18 SkPaint capStroke;
19 capStroke.setColor(SK_ColorRED);
20 capStroke.setStrokeWidth(10.f);
23 canvas->drawPath(path, capStroke);
24}
25} // END FIDDLE
constexpr SkColor SK_ColorRED
Definition: SkColor.h:126
constexpr SkColor SK_ColorGREEN
Definition: SkColor.h:131
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
void drawPath(const SkPath &path, const SkPaint &paint)
Definition: SkCanvas.cpp:1747
@ kRound_Cap
adds circle
Definition: SkPaint.h:335
void setStyle(Style style)
Definition: SkPaint.cpp:105
void setColor(SkColor color)
Definition: SkPaint.cpp:119
void setStrokeCap(Cap cap)
Definition: SkPaint.cpp:179
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
void setStrokeJoin(Join join)
Definition: SkPaint.cpp:189
@ kRound_Join
adds circle
Definition: SkPaint.h:360
void setStrokeWidth(SkScalar width)
Definition: SkPaint.cpp:159
Definition: SkPath.h:59
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
REG_FIDDLE(stroke_closed_degenerate_path, 256, 256, false, 0)