Debian Codegraph @

docs/examples/Paint_053.cpp

raw
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_053, 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, 30)
11 .lineTo(30, 30)
12 .moveTo(70, 30)
13 .lineTo(90, 40)
14 .detach();
15 for (SkPaint::Cap c : { SkPaint::kButt_Cap, SkPaint::kRound_Cap, SkPaint::kSquare_Cap } ) {
16 paint.setStrokeCap(c);
17 canvas->drawPath(path, paint);
18 canvas->translate(0, 70);
19 }
20 }
21 } // END FIDDLE