blob: 18f9e81564a7e125839cbe80e409eefbf16c5a5e [file] [log] [blame]
kjlubicke5654502016-07-19 16:50:03 -07001/*
2 * Copyright 2016 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
8#include "Fuzz.h"
Cary Clark91390c82018-03-09 14:02:46 -05009#include "FuzzCommon.h"
kjlubicke5654502016-07-19 16:50:03 -070010#include "SkPath.h"
11#include "SkPathOps.h"
12
13const int kLastOp = SkPathOp::kReverseDifference_SkPathOp;
14
kjlubicke5654502016-07-19 16:50:03 -070015DEF_FUZZ(Pathop, fuzz) {
16 SkOpBuilder builder;
kjlubicke5654502016-07-19 16:50:03 -070017
Kevin Lubick416b2482016-11-10 16:17:49 -050018 uint8_t stragglerOp;
19 fuzz->next(&stragglerOp);
Kevin Lubick2f535ce2016-11-01 15:01:12 -040020 SkPath path;
21
22 BuildPath(fuzz, &path, SkPath::Verb::kDone_Verb);
23 builder.add(path, static_cast<SkPathOp>(stragglerOp % (kLastOp + 1)));
kjlubicke5654502016-07-19 16:50:03 -070024
25 SkPath result;
26 builder.resolve(&result);
27}