• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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) {
draw(SkCanvas * canvas)5 void 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);
12     joinStroke.setStyle(SkPaint::kStroke_Style);
13     joinStroke.setStrokeJoin(SkPaint::kRound_Join);
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);
21     capStroke.setStyle(SkPaint::kStroke_Style);
22     capStroke.setStrokeCap(SkPaint::kRound_Cap);
23     canvas->drawPath(path, capStroke);
24 }
25 }  // END FIDDLE
26