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 */ 7 #include "SkPath.h" 8 9 // region-inspired approach 10 void contourBounds(const SkPath& path, SkTDArray<SkRect>& boundsArray); 11 void simplify(const SkPath& path, bool asFill, SkPath& simple); 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 kShapeOp_Count 23 }; 24 25 enum ShapeOpMask { 26 kWinding_Mask = -1, 27 kNo_Mask = 0, 28 kEvenOdd_Mask = 1 29 }; 30 #endif 31 32 void operate(const SkPath& one, const SkPath& two, ShapeOp op, SkPath& result); 33 void simplifyx(const SkPath& path, SkPath& simple); 34 35 // FIXME: remove this section once debugging is complete 36 extern const bool gRunTestsInOneThread; 37 #ifdef SK_DEBUG 38 extern int gDebugMaxWindSum; 39 extern int gDebugMaxWindValue; 40 #endif 41