blob: f3ae2b600d060b925c8f1fabcf2520f33e10d0c6 [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.
Mike Kleinc0bd9f92019-04-23 12:05:21 -05003#include "tools/fiddle/examples.h"
Hal Canary87515122019-03-15 14:22:51 -04004// HASH=eb6d290887e1a3a0b051b4d7b012f5e1
Hal Canarya7181e7c2019-03-18 16:06:34 -04005REG_FIDDLE(Region_quickContains_2, 256, 256, true, 0) {
Hal Canary87515122019-03-15 14:22:51 -04006void draw(SkCanvas* canvas) {
7 auto debugster = [](const char* label, SkRegion& region) -> void {
8 SkDebugf("%s: %s\n", label, region.quickContains(2, 2, 3, 3) ? "true" : "false");
9 };
10 SkRegion region({1, 2, 3, 4});
11 debugster("quickContains 1", region);
12 region.op({1, 4, 3, 6}, SkRegion::kUnion_Op);
13 debugster("quickContains 2", region);
14 region.op({1, 7, 3, 8}, SkRegion::kUnion_Op);
15 debugster("quickContains 3", region);
16}
17} // END FIDDLE