• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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=6cca7b96836266800d852664a1366453
5 REG_FIDDLE(Region_Cliperator_done, 256, 256, true, 0) {
draw(SkCanvas * canvas)6 void draw(SkCanvas* canvas) {
7     auto debugster = [](const char* label, SkRegion& region) -> void {
8         SkRegion::Cliperator clipper(region, {0, 0, 5, 5});
9         SkDebugf("%14s done=%s\n", label, clipper.done() ? "true" : "false");
10     };
11     SkRegion region;
12     debugster("empty region", region);
13     region.setRect({1, 2, 3, 4});
14     debugster("after add rect", region);
15 }
16 }  // END FIDDLE
17