blob: 0fa33917986fcf68ef8b74a2c5f5c0c97188c384 [file] [log] [blame]
Hal Canary83c2f702019-03-07 14:53:03 -05001// 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 "fiddle/examples.h"
4// HASH=5b31a1b077818a8150ad50f3b19e7bfe
5REG_FIDDLE(Region_031, 256, 256, true, 0) {
6void draw(SkCanvas* canvas) {
7 auto debugster = [](const char* label, bool success, SkRegion& region) -> void {
8 auto r = region.getBounds();
9 SkDebugf("%14s: success:%s {%d,%d,%d,%d}\n", label, success ? "true" : "false",
10 r.fLeft, r.fTop, r.fRight, r.fBottom);
11 };
12 SkRegion region;
13 bool success = region.setRect(1, 2, 3, 4);
14 debugster("set to: 1,2,3,4", success, region);
15 success = region.setRect(3, 2, 1, 4);
16 debugster("set to: 3,2,1,4", success, region);
17}
18} // END FIDDLE