blob: d6959b9ed10fa16e73caeed6edbbdd381852158c [file] [log] [blame]
caryclark@google.com9e49fb62012-08-27 14:11:33 +00001/*
2 * Copyright 2012 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 */
caryclark@google.comd88e0892012-03-27 13:23:51 +00007#include "SkPath.h"
8
caryclark@google.com235f56a2012-09-14 14:19:30 +00009// region-inspired approach
caryclark@google.comd88e0892012-03-27 13:23:51 +000010void contourBounds(const SkPath& path, SkTDArray<SkRect>& boundsArray);
11void simplify(const SkPath& path, bool asFill, SkPath& simple);
caryclark@google.com235f56a2012-09-14 14:19:30 +000012
13// contour outer edge walking approach
14#ifndef DEFINE_SHAPE_OP
15// FIXME: namespace testing doesn't allow global enums like this
16#define DEFINE_SHAPE_OP
17enum ShapeOp {
18 kDifference_Op,
19 kIntersect_Op,
20 kUnion_Op,
caryclark@google.com31143cf2012-11-09 22:14:19 +000021 kXor_Op,
skia.committer@gmail.com453995e2012-11-10 02:01:26 +000022 kShapeOp_Count
caryclark@google.com235f56a2012-09-14 14:19:30 +000023};
24
25enum ShapeOpMask {
26 kWinding_Mask = -1,
27 kNo_Mask = 0,
28 kEvenOdd_Mask = 1
29};
30#endif
31
32void operate(const SkPath& one, const SkPath& two, ShapeOp op, SkPath& result);
caryclark@google.com65f9f0a2012-05-23 18:09:25 +000033void simplifyx(const SkPath& path, SkPath& simple);
caryclark@google.comd88e0892012-03-27 13:23:51 +000034
caryclark@google.com47580692012-07-23 12:14:49 +000035// FIXME: remove this section once debugging is complete
36extern const bool gRunTestsInOneThread;
37#ifdef SK_DEBUG
38extern int gDebugMaxWindSum;
39extern int gDebugMaxWindValue;
40#endif