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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 * strokeAndFill==false -> new style will be Hairline | 57 * strokeAndFill==false -> new style will be Hairline |
58 */ | 58 */ |
59 void setStrokeStyle(SkScalar width, bool strokeAndFill = false); | 59 void setStrokeStyle(SkScalar width, bool strokeAndFill = false); |
60 | 60 |
61 void setStrokeParams(SkPaint::Cap cap, SkPaint::Join join, SkScalar miterLim
it) { | 61 void setStrokeParams(SkPaint::Cap cap, SkPaint::Join join, SkScalar miterLim
it) { |
62 fCap = cap; | 62 fCap = cap; |
63 fJoin = join; | 63 fJoin = join; |
64 fMiterLimit = miterLimit; | 64 fMiterLimit = miterLimit; |
65 } | 65 } |
66 | 66 |
| 67 void setResScale(SkScalar rs) { |
| 68 SkASSERT(rs > 0 && SkScalarIsFinite(rs)); |
| 69 fResScale = rs; |
| 70 } |
| 71 |
67 /** | 72 /** |
68 * Returns true if this specifes any thick stroking, i.e. applyToPath() | 73 * Returns true if this specifes any thick stroking, i.e. applyToPath() |
69 * will return true. | 74 * will return true. |
70 */ | 75 */ |
71 bool needToApply() const { | 76 bool needToApply() const { |
72 Style style = this->getStyle(); | 77 Style style = this->getStyle(); |
73 return (kStroke_Style == style) || (kStrokeAndFill_Style == style); | 78 return (kStroke_Style == style) || (kStrokeAndFill_Style == style); |
74 } | 79 } |
75 | 80 |
76 /** | 81 /** |
(...skipping 26 matching lines...) Expand all Loading... |
103 | 108 |
104 SkScalar fResScale; | 109 SkScalar fResScale; |
105 SkScalar fWidth; | 110 SkScalar fWidth; |
106 SkScalar fMiterLimit; | 111 SkScalar fMiterLimit; |
107 SkPaint::Cap fCap; | 112 SkPaint::Cap fCap; |
108 SkPaint::Join fJoin; | 113 SkPaint::Join fJoin; |
109 bool fStrokeAndFill; | 114 bool fStrokeAndFill; |
110 }; | 115 }; |
111 | 116 |
112 #endif | 117 #endif |
OLD | NEW |