OLD | NEW |
1 // Copyright (C) 2013 Google Inc. All rights reserved. | 1 // Copyright (C) 2013 Google Inc. All rights reserved. |
2 // | 2 // |
3 // Redistribution and use in source and binary forms, with or without | 3 // Redistribution and use in source and binary forms, with or without |
4 // modification, are permitted provided that the following conditions are | 4 // modification, are permitted provided that the following conditions are |
5 // met: | 5 // met: |
6 // | 6 // |
7 // * Redistributions of source code must retain the above copyright | 7 // * Redistributions of source code must retain the above copyright |
8 // notice, this list of conditions and the following disclaimer. | 8 // notice, this list of conditions and the following disclaimer. |
9 // * Redistributions in binary form must reproduce the above | 9 // * Redistributions in binary form must reproduce the above |
10 // copyright notice, this list of conditions and the following disclaimer | 10 // copyright notice, this list of conditions and the following disclaimer |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 77 |
78 LineJoin lineJoin() const { return (LineJoin)m_lineJoin; } | 78 LineJoin lineJoin() const { return (LineJoin)m_lineJoin; } |
79 void setLineJoin(LineJoin join) { m_lineJoin = (SkPaint::Join)join; } | 79 void setLineJoin(LineJoin join) { m_lineJoin = (SkPaint::Join)join; } |
80 | 80 |
81 float miterLimit() const { return m_miterLimit; } | 81 float miterLimit() const { return m_miterLimit; } |
82 void setMiterLimit(float miterLimit) { m_miterLimit = miterLimit; } | 82 void setMiterLimit(float miterLimit) { m_miterLimit = miterLimit; } |
83 | 83 |
84 void setLineDash(const DashArray&, float); | 84 void setLineDash(const DashArray&, float); |
85 | 85 |
86 // Sets everything on the paint except the pattern, gradient and color. | 86 // Sets everything on the paint except the pattern, gradient and color. |
87 // GraphicsContext::setupShader does that. If a non-zero length is provided,
the | 87 // If a non-zero length is provided, the number of dashes/dots on a |
88 // number of dashes/dots on a dashed/dotted line will be adjusted to | 88 // dashed/dotted line will be adjusted to start and end that length with a |
89 // start and end that length with a dash/dot. | 89 // dash/dot. |
90 void setupPaint(SkPaint*, int length = 0) const; | 90 void setupPaint(SkPaint*, int length = 0) const; |
91 | 91 |
92 // Setup any DashPathEffect on the paint. If a non-zero length is provided, | 92 // Setup any DashPathEffect on the paint. If a non-zero length is provided, |
93 // and no line dash has been set, the number of dashes/dots on a dashed/dott
ed | 93 // and no line dash has been set, the number of dashes/dots on a dashed/dott
ed |
94 // line will be adjusted to start and end that length with a dash/dot. | 94 // line will be adjusted to start and end that length with a dash/dot. |
95 void setupPaintDashPathEffect(SkPaint*, int) const; | 95 void setupPaintDashPathEffect(SkPaint*, int) const; |
96 | 96 |
97 private: | 97 private: |
98 StrokeStyle m_style; | 98 StrokeStyle m_style; |
99 float m_thickness; | 99 float m_thickness; |
100 Color m_color; | 100 Color m_color; |
101 RefPtr<Gradient> m_gradient; | 101 RefPtr<Gradient> m_gradient; |
102 RefPtr<Pattern> m_pattern; | 102 RefPtr<Pattern> m_pattern; |
103 SkPaint::Cap m_lineCap; | 103 SkPaint::Cap m_lineCap; |
104 SkPaint::Join m_lineJoin; | 104 SkPaint::Join m_lineJoin; |
105 float m_miterLimit; | 105 float m_miterLimit; |
106 RefPtr<SkDashPathEffect> m_dash; | 106 RefPtr<SkDashPathEffect> m_dash; |
107 }; | 107 }; |
108 | 108 |
109 } // namespace WebCore | 109 } // namespace WebCore |
110 | 110 |
111 #endif // StrokeData_h | 111 #endif // StrokeData_h |
OLD | NEW |