Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Region_Iterator_reset.cpp
Go to the documentation of this file.
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.
4// HASH=d153f87bd518a4ab947b7e407ea1db79
5REG_FIDDLE(Region_Iterator_reset, 256, 256, true, 0) {
6void 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
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
void reset(const SkRegion &region)
bool setRect(const SkIRect &rect)
Definition SkRegion.cpp:192
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition examples.h:60