| 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 |
| 11 #include "SkPaint.h" | 11 #include "SkPaint.h" |
| 12 | 12 |
| 13 class SkPath; | 13 class SkPath; |
| 14 | 14 |
| 15 class SkStrokeRec { | 15 class SkStrokeRec { |
| 16 public: | 16 public: |
| 17 enum InitStyle { | 17 enum InitStyle { |
| 18 kHairline_InitStyle, | 18 kHairline_InitStyle, |
| 19 kFill_InitStyle | 19 kFill_InitStyle |
| 20 }; | 20 }; |
| 21 SkStrokeRec(InitStyle style); | 21 SkStrokeRec(InitStyle style); |
| 22 | 22 |
| 23 SkStrokeRec(const SkStrokeRec&); | 23 SkStrokeRec(const SkStrokeRec&); |
| 24 SkStrokeRec(const SkPaint&, SkPaint::Style); |
| 24 explicit SkStrokeRec(const SkPaint&); | 25 explicit SkStrokeRec(const SkPaint&); |
| 25 | 26 |
| 26 enum Style { | 27 enum Style { |
| 27 kHairline_Style, | 28 kHairline_Style, |
| 28 kFill_Style, | 29 kFill_Style, |
| 29 kStroke_Style, | 30 kStroke_Style, |
| 30 kStrokeAndFill_Style | 31 kStrokeAndFill_Style |
| 31 }; | 32 }; |
| 32 | 33 |
| 33 Style getStyle() const; | 34 Style getStyle() const; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 84 |
| 84 bool operator==(const SkStrokeRec& other) const { | 85 bool operator==(const SkStrokeRec& other) const { |
| 85 return fWidth == other.fWidth && | 86 return fWidth == other.fWidth && |
| 86 fMiterLimit == other.fMiterLimit && | 87 fMiterLimit == other.fMiterLimit && |
| 87 fCap == other.fCap && | 88 fCap == other.fCap && |
| 88 fJoin == other.fJoin && | 89 fJoin == other.fJoin && |
| 89 fStrokeAndFill == other.fStrokeAndFill; | 90 fStrokeAndFill == other.fStrokeAndFill; |
| 90 } | 91 } |
| 91 | 92 |
| 92 private: | 93 private: |
| 94 void init(const SkPaint& paint, SkPaint::Style style); |
| 95 |
| 96 |
| 93 SkScalar fWidth; | 97 SkScalar fWidth; |
| 94 SkScalar fMiterLimit; | 98 SkScalar fMiterLimit; |
| 95 SkPaint::Cap fCap; | 99 SkPaint::Cap fCap; |
| 96 SkPaint::Join fJoin; | 100 SkPaint::Join fJoin; |
| 97 bool fStrokeAndFill; | 101 bool fStrokeAndFill; |
| 98 }; | 102 }; |
| 99 | 103 |
| 100 #endif | 104 #endif |
| OLD | NEW |