blob: c16548b9d99b38e0e55ab9543d5bbf3f07e910cf [file] [log] [blame]
Hal Canary87515122019-03-15 14:22:51 -04001// 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
Hal Canarya7181e7c2019-03-18 16:06:34 -04005REG_FIDDLE(Region_setRect_2, 256, 256, true, 0) {
Hal Canary87515122019-03-15 14:22:51 -04006void 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