OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 #ifndef SkPathOps_DEFINED | 7 #ifndef SkPathOps_DEFINED |
8 #define SkPathOps_DEFINED | 8 #define SkPathOps_DEFINED |
9 | 9 |
10 class SkPath; | 10 class SkPath; |
11 | 11 |
12 // FIXME: move this into SkPaths.h or just use the equivalent in SkRegion.h | 12 // FIXME: move everything below into the SkPath class |
13 /** | |
14 * The logical operations that can be performed when combining two paths. | |
15 */ | |
13 enum SkPathOp { | 16 enum SkPathOp { |
bsalomon
2013/04/22 13:13:57
We have SkRegion::Op which is used in a bunch of p
| |
14 kDifference_PathOp, //!< subtract the op path from the first path | 17 kDifference_PathOp, //!< subtract the op path from the first path |
15 kIntersect_PathOp, //!< intersect the two paths | 18 kIntersect_PathOp, //!< intersect the two paths |
16 kUnion_PathOp, //!< union (inclusive-or) the two paths | 19 kUnion_PathOp, //!< union (inclusive-or) the two paths |
17 kXOR_PathOp, //!< exclusive-or the two paths | 20 kXOR_PathOp, //!< exclusive-or the two paths |
18 /** subtract the first path from the op path */ | 21 kReverseDifference_PathOp, //!< subtract the first path from the op path |
19 kReverseDifference_PathOp, // FIXME: unsupported | |
20 kReplace_PathOp //!< replace the dst path with the op FIXME: unsupport ed: should it be? | |
21 }; | 22 }; |
22 | 23 |
23 // FIXME: these functions become members of SkPath | |
24 /** | 24 /** |
25 * Set this path to the result of applying the Op to this path and the | 25 * Set this path to the result of applying the Op to this path and the |
26 * specified path: this = (this op operand). The resulting path will be constr ucted | 26 * specified path: this = (this op operand). The resulting path will be constr ucted |
27 * from non-overlapping contours. The curve order is reduced where possible so that cubics may | 27 * from non-overlapping contours. The curve order is reduced where possible so that cubics may |
28 * be turned into quadratics, and quadratics maybe turned into lines. | 28 * be turned into quadratics, and quadratics maybe turned into lines. |
29 */ | 29 */ |
30 void Op(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result); | 30 void Op(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result); |
31 | 31 |
32 /** | 32 /** |
33 * Set this path to a set of non-overlapping contours that describe the same | 33 * Set this path to a set of non-overlapping contours that describe the same |
34 * area as the original path. The curve order is reduced where possible so tha t cubics may | 34 * area as the original path. The curve order is reduced where possible so tha t cubics may |
35 * be turned into quadratics, and quadratics maybe turned into lines. | 35 * be turned into quadratics, and quadratics maybe turned into lines. |
36 */ | 36 */ |
37 void Simplify(const SkPath& path, SkPath* result); | 37 void Simplify(const SkPath& path, SkPath* result); |
38 | 38 |
39 #endif | 39 #endif |
OLD | NEW |