OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 GrStrokeInfo_DEFINED | 8 #ifndef GrStrokeInfo_DEFINED |
9 #define GrStrokeInfo_DEFINED | 9 #define GrStrokeInfo_DEFINED |
10 | 10 |
11 #include "SkPathEffect.h" | 11 #include "SkPathEffect.h" |
12 #include "SkStrokeRec.h" | 12 #include "SkStrokeRec.h" |
13 #include "SkTemplates.h" | 13 #include "SkTemplates.h" |
14 | 14 |
15 class GrUniqueKey; | 15 class GrUniqueKey; |
16 | 16 |
17 /* | 17 /* |
18 * GrStrokeInfo encapsulates all the pertinent infomation regarding the stroke.
The SkStrokeRec | 18 * GrStrokeInfo encapsulates all the pertinent infomation regarding the stroke.
The SkStrokeRec |
19 * which holds information on fill style, width, miter, cap, and join. It also h
olds information | 19 * which holds information on fill style, width, miter, cap, and join. It also h
olds information |
20 * about the dash like intervals, count, and phase. | 20 * about the dash like intervals, count, and phase. |
21 */ | 21 */ |
22 class GrStrokeInfo : public SkStrokeRec { | 22 class GrStrokeInfo : public SkStrokeRec { |
23 public: | 23 public: |
| 24 static const GrStrokeInfo& FillInfo() { |
| 25 static const GrStrokeInfo gFill(kFill_InitStyle); |
| 26 return gFill; |
| 27 } |
| 28 |
24 GrStrokeInfo(SkStrokeRec::InitStyle style) | 29 GrStrokeInfo(SkStrokeRec::InitStyle style) |
25 : INHERITED(style) | 30 : INHERITED(style) |
26 , fDashType(SkPathEffect::kNone_DashType) { | 31 , fDashType(SkPathEffect::kNone_DashType) { |
27 } | 32 } |
28 | 33 |
29 GrStrokeInfo(const GrStrokeInfo& src, bool includeDash = true) | 34 GrStrokeInfo(const GrStrokeInfo& src, bool includeDash = true) |
30 : INHERITED(src) { | 35 : INHERITED(src) { |
31 if (includeDash && src.isDashed()) { | 36 if (includeDash && src.isDashed()) { |
32 fDashType = src.fDashType; | 37 fDashType = src.fDashType; |
33 fDashPhase = src.fDashPhase; | 38 fDashPhase = src.fDashPhase; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 this->setDashInfo(pe); | 182 this->setDashInfo(pe); |
178 } | 183 } |
179 | 184 |
180 SkPathEffect::DashType fDashType; | 185 SkPathEffect::DashType fDashType; |
181 SkScalar fDashPhase; | 186 SkScalar fDashPhase; |
182 SkAutoSTArray<2, SkScalar> fIntervals; | 187 SkAutoSTArray<2, SkScalar> fIntervals; |
183 typedef SkStrokeRec INHERITED; | 188 typedef SkStrokeRec INHERITED; |
184 }; | 189 }; |
185 | 190 |
186 #endif | 191 #endif |
OLD | NEW |