OLD | NEW |
(Empty) | |
| 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 #ifndef SkPathOps_DEFINED |
| 8 #define SkPathOps_DEFINED |
| 9 |
| 10 class SkPath; |
| 11 |
| 12 // FIXME: move this into SkPaths.h or just use the equivalent in SkRegion.h |
| 13 enum SkPathOp { |
| 14 kDifference_PathOp, //!< subtract the op path from the first path |
| 15 kIntersect_PathOp, //!< intersect the two paths |
| 16 kUnion_PathOp, //!< union (inclusive-or) the two paths |
| 17 kXOR_PathOp, //!< exclusive-or the two paths |
| 18 /** 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 |
| 23 // FIXME: these functions become members of SkPath |
| 24 /** |
| 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 |
| 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. |
| 29 */ |
| 30 void Op(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result); |
| 31 |
| 32 /** |
| 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 |
| 35 * be turned into quadratics, and quadratics maybe turned into lines. |
| 36 */ |
| 37 void Simplify(const SkPath& path, SkPath* result); |
| 38 |
| 39 #endif |
OLD | NEW |