Debian Codegraph @

docs/examples/Paint_057.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_057, 462, 256, false, 0) {
5 void draw(SkCanvas* canvas) {
6 SkPath path = SkPathBuilder()
7 .moveTo(10, 50)
8 .quadTo(35, 110, 60, 210)
9 .quadTo(105, 110, 130, 10)
10 .detach();
11 SkPaint paint; // set to default kMiter_Join
12 paint.setAntiAlias(true);
13 paint.setStyle(SkPaint::kStroke_Style);
14 paint.setStrokeWidth(20);
15 canvas->drawPath(path, paint);
16 canvas->translate(150, 0);
17 paint.setStrokeJoin(SkPaint::kBevel_Join);
18 canvas->drawPath(path, paint);
19 canvas->translate(150, 0);
20 paint.setStrokeJoin(SkPaint::kRound_Join);
21 canvas->drawPath(path, paint);
22 }
23 } // END FIDDLE