| 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 | 7 |
| 8 #ifndef SkStrokeRec_DEFINED | 8 #ifndef SkStrokeRec_DEFINED |
| 9 #define SkStrokeRec_DEFINED | 9 #define SkStrokeRec_DEFINED |
| 10 | 10 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 * in dst. | 78 * in dst. |
| 79 * | 79 * |
| 80 * If there was no change (i.e. style == hairline or fill) this returns | 80 * If there was no change (i.e. style == hairline or fill) this returns |
| 81 * false and dst is unchanged. Otherwise returns true and the result is | 81 * false and dst is unchanged. Otherwise returns true and the result is |
| 82 * stored in dst. | 82 * stored in dst. |
| 83 * | 83 * |
| 84 * src and dst may be the same path. | 84 * src and dst may be the same path. |
| 85 */ | 85 */ |
| 86 bool applyToPath(SkPath* dst, const SkPath& src) const; | 86 bool applyToPath(SkPath* dst, const SkPath& src) const; |
| 87 | 87 |
| 88 /** |
| 89 * Apply these stroke parameters to a paint. |
| 90 */ |
| 91 void applyToPaint(SkPaint* paint) const; |
| 92 |
| 88 bool operator==(const SkStrokeRec& other) const { | 93 bool operator==(const SkStrokeRec& other) const { |
| 89 return fWidth == other.fWidth && | 94 return fWidth == other.fWidth && |
| 90 fMiterLimit == other.fMiterLimit && | 95 fMiterLimit == other.fMiterLimit && |
| 91 fCap == other.fCap && | 96 fCap == other.fCap && |
| 92 fJoin == other.fJoin && | 97 fJoin == other.fJoin && |
| 93 fStrokeAndFill == other.fStrokeAndFill; | 98 fStrokeAndFill == other.fStrokeAndFill; |
| 94 } | 99 } |
| 95 | 100 |
| 96 private: | 101 private: |
| 97 void init(const SkPaint& paint, SkPaint::Style style); | 102 void init(const SkPaint& paint, SkPaint::Style style); |
| 98 | 103 |
| 99 | 104 |
| 100 SkScalar fWidth; | 105 SkScalar fWidth; |
| 101 SkScalar fMiterLimit; | 106 SkScalar fMiterLimit; |
| 102 SkPaint::Cap fCap; | 107 SkPaint::Cap fCap; |
| 103 SkPaint::Join fJoin; | 108 SkPaint::Join fJoin; |
| 104 bool fStrokeAndFill; | 109 bool fStrokeAndFill; |
| 105 }; | 110 }; |
| 106 | 111 |
| 107 #endif | 112 #endif |
| OLD | NEW |