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 // HASH=d153f87bd518a4ab947b7e407ea1db79
5 REG_FIDDLE(Region_Iterator_reset, 256, 256, true, 0) {
draw(SkCanvas * canvas)6 void draw(SkCanvas* canvas) {
7     auto debugster = [](const char* label, SkRegion::Iterator& iter) -> void {
8         SkDebugf("%14s: done=%s\n", label, iter.done() ? "true" : "false");
9     };
10     SkRegion region;
11     SkRegion::Iterator iter(region);
12     debugster("empty region", iter);
13     region.setRect({1, 2, 3, 4});
14     debugster("after set rect", iter);
15     iter.reset(region);
16     debugster("after reset", iter);
17 }
18 }  // END FIDDLE
19