2016-07-19 23:50:03 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2016 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "Fuzz.h"
|
2018-03-09 19:02:46 +00:00
|
|
|
#include "FuzzCommon.h"
|
2016-07-19 23:50:03 +00:00
|
|
|
#include "SkPath.h"
|
|
|
|
#include "SkPathOps.h"
|
|
|
|
|
|
|
|
const int kLastOp = SkPathOp::kReverseDifference_SkPathOp;
|
|
|
|
|
|
|
|
DEF_FUZZ(Pathop, fuzz) {
|
|
|
|
SkOpBuilder builder;
|
|
|
|
|
2016-11-10 21:17:49 +00:00
|
|
|
uint8_t stragglerOp;
|
|
|
|
fuzz->next(&stragglerOp);
|
2016-11-01 19:01:12 +00:00
|
|
|
SkPath path;
|
|
|
|
|
2018-09-25 16:16:53 +00:00
|
|
|
FuzzEvilPath(fuzz, &path, SkPath::Verb::kDone_Verb);
|
2016-11-01 19:01:12 +00:00
|
|
|
builder.add(path, static_cast<SkPathOp>(stragglerOp % (kLastOp + 1)));
|
2016-07-19 23:50:03 +00:00
|
|
|
|
|
|
|
SkPath result;
|
|
|
|
builder.resolve(&result);
|
|
|
|
}
|