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" | 10 #include "SkPreConfig.h" |
11 | 11 |
12 class SkPath; | 12 class SkPath; |
| 13 struct SkRect; |
13 | 14 |
14 // FIXME: move everything below into the SkPath class | 15 // FIXME: move everything below into the SkPath class |
15 /** | 16 /** |
16 * The logical operations that can be performed when combining two paths. | 17 * The logical operations that can be performed when combining two paths. |
17 */ | 18 */ |
18 enum SkPathOp { | 19 enum SkPathOp { |
19 kDifference_PathOp, //!< subtract the op path from the first path | 20 kDifference_PathOp, //!< subtract the op path from the first path |
20 kIntersect_PathOp, //!< intersect the two paths | 21 kIntersect_PathOp, //!< intersect the two paths |
21 kUnion_PathOp, //!< union (inclusive-or) the two paths | 22 kUnion_PathOp, //!< union (inclusive-or) the two paths |
22 kXOR_PathOp, //!< exclusive-or the two paths | 23 kXOR_PathOp, //!< exclusive-or the two paths |
(...skipping 24 matching lines...) Expand all Loading... |
47 | 48 |
48 Returns true if operation was able to produce a result; | 49 Returns true if operation was able to produce a result; |
49 otherwise, result is unmodified. | 50 otherwise, result is unmodified. |
50 | 51 |
51 @param path The path to simplify. | 52 @param path The path to simplify. |
52 @param result The simplified path. The result may be the input. | 53 @param result The simplified path. The result may be the input. |
53 @return True if simplification succeeded. | 54 @return True if simplification succeeded. |
54 */ | 55 */ |
55 bool SK_API Simplify(const SkPath& path, SkPath* result); | 56 bool SK_API Simplify(const SkPath& path, SkPath* result); |
56 | 57 |
| 58 /** Set the resulting rectangle to the tight bounds of the path. |
| 59 |
| 60 @param path The path measured. |
| 61 @param result The tight bounds of the path. |
| 62 @return True if the bounds could be computed. |
| 63 */ |
| 64 bool SK_API TightBounds(const SkPath& path, SkRect* result); |
| 65 |
57 #endif | 66 #endif |
OLD | NEW |