Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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) {
6 SkPath path;
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)
void drawPath(const SkPath &path, const SkPaint &paint)
@ 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
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition examples.h:60