xref: /aosp_15_r20/external/skia/docs/examples/Region_isComplex.cpp (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
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(Region_isComplex, 256, 256, true, 0) {
draw(SkCanvas * canvas)5 void draw(SkCanvas* canvas) {
6     auto debugster = [](const char* label, const SkRegion& region) -> void {
7                 SkDebugf("%s: region is %s" "complex\n", label, region.isComplex() ? "" : "not ");
8     };
9     SkRegion region;
10     debugster("initial", region);
11     region.setRect({1, 2, 3, 4});
12     debugster("set rect", region);
13     region.op({2, 3, 4, 5}, SkRegion::kUnion_Op);
14     debugster("op rect", region);
15 }
16 }  // END FIDDLE
17