caryclark@google.com | 9e49fb6 | 2012-08-27 14:11:33 +0000 | [diff] [blame] | 1 | /* |
| 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.com | d88e089 | 2012-03-27 13:23:51 +0000 | [diff] [blame] | 7 | #include "SkPath.h" |
| 8 | |
caryclark@google.com | 235f56a | 2012-09-14 14:19:30 +0000 | [diff] [blame^] | 9 | // region-inspired approach |
caryclark@google.com | d88e089 | 2012-03-27 13:23:51 +0000 | [diff] [blame] | 10 | void contourBounds(const SkPath& path, SkTDArray<SkRect>& boundsArray); |
| 11 | void simplify(const SkPath& path, bool asFill, SkPath& simple); |
caryclark@google.com | 235f56a | 2012-09-14 14:19:30 +0000 | [diff] [blame^] | 12 | |
| 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 |
| 17 | enum ShapeOp { |
| 18 | kDifference_Op, |
| 19 | kIntersect_Op, |
| 20 | kUnion_Op, |
| 21 | kXor_Op |
| 22 | }; |
| 23 | |
| 24 | enum ShapeOpMask { |
| 25 | kWinding_Mask = -1, |
| 26 | kNo_Mask = 0, |
| 27 | kEvenOdd_Mask = 1 |
| 28 | }; |
| 29 | #endif |
| 30 | |
| 31 | void operate(const SkPath& one, const SkPath& two, ShapeOp op, SkPath& result); |
caryclark@google.com | 65f9f0a | 2012-05-23 18:09:25 +0000 | [diff] [blame] | 32 | void simplifyx(const SkPath& path, SkPath& simple); |
caryclark@google.com | d88e089 | 2012-03-27 13:23:51 +0000 | [diff] [blame] | 33 | |
caryclark@google.com | 4758069 | 2012-07-23 12:14:49 +0000 | [diff] [blame] | 34 | // FIXME: remove this section once debugging is complete |
| 35 | extern const bool gRunTestsInOneThread; |
| 36 | #ifdef SK_DEBUG |
| 37 | extern int gDebugMaxWindSum; |
| 38 | extern int gDebugMaxWindValue; |
| 39 | #endif |