| // Copyright 2019 Google LLC | |
| // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. | |
| #include "tools/fiddle/examples.h" | |
| REG_FIDDLE(Path_isLastContourClosed, 256, 256, true, 0) { | |
| void draw(SkCanvas* canvas) { | |
| auto debugster = [](const char* prefix, const SkPathBuilder& builder) -> void { | |
| SkPath path = builder.snapshot(); | |
| SkDebugf("%s last contour is %s" "closed\n", prefix, | |
| path.isLastContourClosed() ? "" : "not "); | |
| }; | |
| SkPathBuilder path; | |
| debugster("initial", path); | |
| path.close(); | |
| debugster("after close", path); | |
| path.lineTo(0, 0); | |
| debugster("after lineTo", path); | |
| path.close(); | |
| debugster("after close", path); | |
| } | |
| } // END FIDDLE |