| 1 |
// Copyright 2019 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(Paint_setStrokeCap_b, 256, 200, false, 0) { |
| 5 |
void draw(SkCanvas* canvas) { |
| 6 |
SkPaint paint; |
| 7 |
paint.setStyle(SkPaint::kStroke_Style); |
| 8 |
paint.setStrokeWidth(20); |
| 9 |
SkPath path = SkPathBuilder() |
| 10 |
.moveTo(30, 20) |
| 11 |
.lineTo(40, 40) |
| 12 |
.conicTo(70, 20, 100, 20, .707f) |
| 13 |
.detach(); |
| 14 |
for (SkPaint::Join j : { SkPaint::kMiter_Join, SkPaint::kRound_Join, SkPaint::kBevel_Join } ) { |
| 15 |
paint.setStrokeJoin(j); |
| 16 |
canvas->drawPath(path, paint); |
| 17 |
canvas->translate(0, 70); |
| 18 |
} |
| 19 |
} |
| 20 |
} // END FIDDLE |