| 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. |
| 3 |
#include "tools/fiddle/examples.h" |
| 4 |
REG_FIDDLE(stroke_closed_degenerate_path, 256, 256, false, 0) { |
| 5 |
void draw(SkCanvas* canvas) { |
| 6 |
SkPath path = SkPath::Rect({50.f, 50.f, 50.f, 50.f}); |
| 7 |
|
| 8 |
SkPaint joinStroke; |
| 9 |
joinStroke.setColor(SK_ColorGREEN); |
| 10 |
joinStroke.setStrokeWidth(10.f); |
| 11 |
joinStroke.setStyle(SkPaint::kStroke_Style); |
| 12 |
joinStroke.setStrokeJoin(SkPaint::kRound_Join); |
| 13 |
canvas->drawPath(path, joinStroke); |
| 14 |
|
| 15 |
canvas->translate(100.f, 0); |
| 16 |
|
| 17 |
SkPaint capStroke; |
| 18 |
capStroke.setColor(SK_ColorRED); |
| 19 |
capStroke.setStrokeWidth(10.f); |
| 20 |
capStroke.setStyle(SkPaint::kStroke_Style); |
| 21 |
capStroke.setStrokeCap(SkPaint::kRound_Cap); |
| 22 |
canvas->drawPath(path, capStroke); |
| 23 |
} |
| 24 |
} // END FIDDLE |