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(Path_isEmpty, 256, 256, true, 0) {
draw(SkCanvas * canvas)5 void draw(SkCanvas* canvas) {
6 auto debugster = [](const char* prefix, const SkPath& path) -> void {
7 SkDebugf("%s path is %s" "empty\n", prefix, path.isEmpty() ? "" : "not ");
8 };
9 SkPath path;
10 debugster("initial", path);
11 path.moveTo(0, 0);
12 debugster("after moveTo", path);
13 path.rewind();
14 debugster("after rewind", path);
15 path.lineTo(0, 0);
16 debugster("after lineTo", path);
17 path.reset();
18 debugster("after reset", path);
19 }
20 } // END FIDDLE
21