blob: 8ea3691041b6761c5c1ea3e553d12f5ff777d7bc [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,
21 kXor_Op
22};
23
24enum ShapeOpMask {
25 kWinding_Mask = -1,
26 kNo_Mask = 0,
27 kEvenOdd_Mask = 1
28};
29#endif
30
31void operate(const SkPath& one, const SkPath& two, ShapeOp op, SkPath& result);
caryclark@google.com65f9f0a2012-05-23 18:09:25 +000032void simplifyx(const SkPath& path, SkPath& simple);
caryclark@google.comd88e0892012-03-27 13:23:51 +000033
caryclark@google.com47580692012-07-23 12:14:49 +000034// FIXME: remove this section once debugging is complete
35extern const bool gRunTestsInOneThread;
36#ifdef SK_DEBUG
37extern int gDebugMaxWindSum;
38extern int gDebugMaxWindValue;
39#endif