| 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 #include "SkTArray.h" |   11 #include "SkTArray.h" | 
|   12 #include "SkTDArray.h" |   12 #include "SkTDArray.h" | 
|   13  |   13  | 
|   14 class SkPath; |   14 class SkPath; | 
|   15 struct SkRect; |   15 struct SkRect; | 
|   16  |   16  | 
 |   17  | 
 |   18 // FIXME: remove this once the define in src/skia/SkUserConfig.h lands | 
 |   19 #ifndef SK_SUPPORT_LEGACY_PATHOP_ENUMS | 
 |   20 #define SK_SUPPORT_LEGACY_PATHOP_ENUMS | 
 |   21 #endif | 
 |   22  | 
|   17 // FIXME: move everything below into the SkPath class |   23 // FIXME: move everything below into the SkPath class | 
|   18 /** |   24 /** | 
|   19   *  The logical operations that can be performed when combining two paths. |   25   *  The logical operations that can be performed when combining two paths. | 
|   20   */ |   26   */ | 
|   21 enum SkPathOp { |   27 enum SkPathOp { | 
|   22     kDifference_SkPathOp,         //!< subtract the op path from the first path |   28     kDifference_SkPathOp,         //!< subtract the op path from the first path | 
|   23     kIntersect_SkPathOp,          //!< intersect the two paths |   29     kIntersect_SkPathOp,          //!< intersect the two paths | 
|   24     kUnion_SkPathOp,              //!< union (inclusive-or) the two paths |   30     kUnion_SkPathOp,              //!< union (inclusive-or) the two paths | 
|   25     kXOR_SkPathOp,                //!< exclusive-or the two paths |   31     kXOR_SkPathOp,                //!< exclusive-or the two paths | 
|   26     kReverseDifference_SkPathOp,  //!< subtract the first path from the op path |   32     kReverseDifference_SkPathOp,  //!< subtract the first path from the op path | 
 |   33  | 
 |   34 #ifdef SK_SUPPORT_LEGACY_PATHOP_ENUMS | 
 |   35     kDifference_PathOp = 0,     //!< subtract the op path from the first path | 
 |   36     kIntersect_PathOp,          //!< intersect the two paths | 
 |   37     kUnion_PathOp,              //!< union (inclusive-or) the two paths | 
 |   38     kXOR_PathOp,                //!< exclusive-or the two paths | 
 |   39     kReverseDifference_PathOp,  //!< subtract the first path from the op path | 
 |   40 #endif | 
|   27 }; |   41 }; | 
|   28  |   42  | 
|   29 /** Set this path to the result of applying the Op to this path and the |   43 /** Set this path to the result of applying the Op to this path and the | 
|   30     specified path: this = (this op operand). |   44     specified path: this = (this op operand). | 
|   31     The resulting path will be constructed from non-overlapping contours. |   45     The resulting path will be constructed from non-overlapping contours. | 
|   32     The curve order is reduced where possible so that cubics may be turned |   46     The curve order is reduced where possible so that cubics may be turned | 
|   33     into quadratics, and quadratics maybe turned into lines. |   47     into quadratics, and quadratics maybe turned into lines. | 
|   34  |   48  | 
|   35     Returns true if operation was able to produce a result; |   49     Returns true if operation was able to produce a result; | 
|   36     otherwise, result is unmodified. |   50     otherwise, result is unmodified. | 
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   87     bool resolve(SkPath* result); |  101     bool resolve(SkPath* result); | 
|   88  |  102  | 
|   89 private: |  103 private: | 
|   90     SkTArray<SkPath> fPathRefs; |  104     SkTArray<SkPath> fPathRefs; | 
|   91     SkTDArray<SkPathOp> fOps; |  105     SkTDArray<SkPathOp> fOps; | 
|   92  |  106  | 
|   93     void reset(); |  107     void reset(); | 
|   94 }; |  108 }; | 
|   95  |  109  | 
|   96 #endif |  110 #endif | 
| OLD | NEW |