| 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 #include "SkPreConfig.h" |
| 11 |
| 10 class SkPath; | 12 class SkPath; |
| 11 | 13 |
| 12 // FIXME: move everything below into the SkPath class | 14 // FIXME: move everything below into the SkPath class |
| 13 /** | 15 /** |
| 14 * The logical operations that can be performed when combining two paths. | 16 * The logical operations that can be performed when combining two paths. |
| 15 */ | 17 */ |
| 16 enum SkPathOp { | 18 enum SkPathOp { |
| 17 kDifference_PathOp, //!< subtract the op path from the first path | 19 kDifference_PathOp, //!< subtract the op path from the first path |
| 18 kIntersect_PathOp, //!< intersect the two paths | 20 kIntersect_PathOp, //!< intersect the two paths |
| 19 kUnion_PathOp, //!< union (inclusive-or) the two paths | 21 kUnion_PathOp, //!< union (inclusive-or) the two paths |
| 20 kXOR_PathOp, //!< exclusive-or the two paths | 22 kXOR_PathOp, //!< exclusive-or the two paths |
| 21 kReverseDifference_PathOp, //!< subtract the first path from the op path | 23 kReverseDifference_PathOp, //!< subtract the first path from the op path |
| 22 }; | 24 }; |
| 23 | 25 |
| 24 /** Set this path to the result of applying the Op to this path and the | 26 /** Set this path to the result of applying the Op to this path and the |
| 25 specified path: this = (this op operand). | 27 specified path: this = (this op operand). |
| 26 The resulting path will be constructed from non-overlapping contours. | 28 The resulting path will be constructed from non-overlapping contours. |
| 27 The curve order is reduced where possible so that cubics may be turned | 29 The curve order is reduced where possible so that cubics may be turned |
| 28 into quadratics, and quadratics maybe turned into lines. | 30 into quadratics, and quadratics maybe turned into lines. |
| 29 | 31 |
| 30 Returns true if operation was able to produce a result; | 32 Returns true if operation was able to produce a result; |
| 31 otherwise, result is unmodified. | 33 otherwise, result is unmodified. |
| 32 | 34 |
| 33 @param one The first operand (for difference, the minuend) | 35 @param one The first operand (for difference, the minuend) |
| 34 @param two The second operand (for difference, the subtrahend) | 36 @param two The second operand (for difference, the subtrahend) |
| 35 @param result The product of the operands. The result may be one of the | 37 @param result The product of the operands. The result may be one of the |
| 36 inputs. | 38 inputs. |
| 37 @return True if operation succeeded. | 39 @return True if operation succeeded. |
| 38 */ | 40 */ |
| 39 bool Op(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result); | 41 bool SK_API Op(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result
); |
| 40 | 42 |
| 41 /** Set this path to a set of non-overlapping contours that describe the | 43 /** Set this path to a set of non-overlapping contours that describe the |
| 42 same area as the original path. | 44 same area as the original path. |
| 43 The curve order is reduced where possible so that cubics may | 45 The curve order is reduced where possible so that cubics may |
| 44 be turned into quadratics, and quadratics maybe turned into lines. | 46 be turned into quadratics, and quadratics maybe turned into lines. |
| 45 | 47 |
| 46 Returns true if operation was able to produce a result; | 48 Returns true if operation was able to produce a result; |
| 47 otherwise, result is unmodified. | 49 otherwise, result is unmodified. |
| 48 | 50 |
| 49 @param path The path to simplify. | 51 @param path The path to simplify. |
| 50 @param result The simplified path. The result may be the input. | 52 @param result The simplified path. The result may be the input. |
| 51 @return True if simplification succeeded. | 53 @return True if simplification succeeded. |
| 52 */ | 54 */ |
| 53 bool Simplify(const SkPath& path, SkPath* result); | 55 bool SK_API Simplify(const SkPath& path, SkPath* result); |
| 54 | 56 |
| 55 #endif | 57 #endif |
| OLD | NEW |