| 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 SkStrokeRec(const SkPaint&, SkPaint::Style, SkScalar resScale = 1); |
| 25 explicit SkStrokeRec(const SkPaint&); | 25 explicit SkStrokeRec(const SkPaint&, SkScalar resScale = 1); |
| 26 | 26 |
| 27 enum Style { | 27 enum Style { |
| 28 kHairline_Style, | 28 kHairline_Style, |
| 29 kFill_Style, | 29 kFill_Style, |
| 30 kStroke_Style, | 30 kStroke_Style, |
| 31 kStrokeAndFill_Style | 31 kStrokeAndFill_Style |
| 32 }; | 32 }; |
| 33 enum { | 33 enum { |
| 34 kStyleCount = kStrokeAndFill_Style + 1 | 34 kStyleCount = kStrokeAndFill_Style + 1 |
| 35 }; | 35 }; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 bool operator==(const SkStrokeRec& other) const { | 93 bool operator==(const SkStrokeRec& other) const { |
| 94 return fWidth == other.fWidth && | 94 return fWidth == other.fWidth && |
| 95 fMiterLimit == other.fMiterLimit && | 95 fMiterLimit == other.fMiterLimit && |
| 96 fCap == other.fCap && | 96 fCap == other.fCap && |
| 97 fJoin == other.fJoin && | 97 fJoin == other.fJoin && |
| 98 fStrokeAndFill == other.fStrokeAndFill; | 98 fStrokeAndFill == other.fStrokeAndFill; |
| 99 } | 99 } |
| 100 | 100 |
| 101 private: | 101 private: |
| 102 void init(const SkPaint& paint, SkPaint::Style style); | 102 void init(const SkPaint&, SkPaint::Style, SkScalar resScale); |
| 103 | 103 |
| 104 | 104 SkScalar fResScale; |
| 105 SkScalar fWidth; | 105 SkScalar fWidth; |
| 106 SkScalar fMiterLimit; | 106 SkScalar fMiterLimit; |
| 107 SkPaint::Cap fCap; | 107 SkPaint::Cap fCap; |
| 108 SkPaint::Join fJoin; | 108 SkPaint::Join fJoin; |
| 109 bool fStrokeAndFill; | 109 bool fStrokeAndFill; |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 #endif | 112 #endif |
| OLD | NEW |