Hal Canary | 13872dd | 2018-04-06 10:25:12 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 8 | #include "fuzz/Fuzz.h" |
| 9 | #include "fuzz/FuzzCommon.h" |
Hal Canary | 13872dd | 2018-04-06 10:25:12 -0400 | [diff] [blame] | 10 | |
| 11 | DEF_FUZZ(RegionOp, fuzz) { // `fuzz -t api -n RegionOp` |
Kevin Lubick | 7845b97 | 2021-03-29 08:07:32 -0400 | [diff] [blame] | 12 | SkRegion region; |
| 13 | // FuzzNiceRegion generates a random region by joining a random amount of regions |
| 14 | // together. This fuzzer simply targets that directly. 300 was picked arbitrarily as |
| 15 | // a number over 2^8. |
| 16 | FuzzNiceRegion(fuzz, ®ion, 300); |
| 17 | // Do a computation to make sure region is not optimized out. |
| 18 | region.computeRegionComplexity(); |
Hal Canary | 13872dd | 2018-04-06 10:25:12 -0400 | [diff] [blame] | 19 | } |