| 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_Iter_isClosedContour, 256, 256, true, 0) { |
| 5 |
void draw(SkCanvas* canvas) { |
| 6 |
for (bool forceClose : { false, true } ) { |
| 7 |
SkPathBuilder path = SkPathBuilder().conicTo(1, 2, 3, 4, .5f); |
| 8 |
SkPath::Iter iter(path.snapshot(), forceClose); |
| 9 |
SkDebugf("without close(), forceClose is %s: isClosedContour returns %s\n", |
| 10 |
forceClose ? "true " : "false", iter.isClosedContour() ? "true" : "false"); |
| 11 |
path.close(); |
| 12 |
iter.setPath(path.detach(), forceClose); |
| 13 |
SkDebugf("with close(), forceClose is %s: isClosedContour returns %s\n", |
| 14 |
forceClose ? "true " : "false", iter.isClosedContour() ? "true" : "false"); |
| 15 |
} |
| 16 |
} |
| 17 |
} // END FIDDLE |