| 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) { |
| 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 = SkPathBuilder().moveTo(0, 0).detach(); |
| 12 |
debugster("after moveTo", path); |
| 13 |
path = SkPathBuilder().lineTo(0, 0).detach(); |
| 14 |
debugster("after lineTo", path); |
| 15 |
path.reset(); |
| 16 |
debugster("after reset", path); |
| 17 |
} |
| 18 |
} // END FIDDLE |