| 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_countPoints, 256, 256, true, 0) { |
| 5 |
void draw(SkCanvas* canvas) { |
| 6 |
auto debugster = [](const char* prefix, const SkPath& path) -> void { |
| 7 |
SkDebugf("%s point count: %d\n", prefix, path.countPoints()); |
| 8 |
}; |
| 9 |
SkPath path; |
| 10 |
debugster("empty", path); |
| 11 |
path = SkPathBuilder().lineTo(0, 0).detach(); |
| 12 |
debugster("zero line", path); |
| 13 |
path = SkPath::Line({10, 10}, {20, 20}); |
| 14 |
debugster("line", path); |
| 15 |
} |
| 16 |
} // END FIDDLE |