OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 #include "GrStyle.h" | 8 #include "GrStyle.h" |
9 #include "SkDashPathPriv.h" | 9 #include "SkDashPathPriv.h" |
10 | 10 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 memcpy(&key[i++], &miter, sizeof(miter)); | 98 memcpy(&key[i++], &miter, sizeof(miter)); |
99 | 99 |
100 SkScalar width = style.strokeRec().getWidth(); | 100 SkScalar width = style.strokeRec().getWidth(); |
101 memcpy(&key[i++], &width, sizeof(width)); | 101 memcpy(&key[i++], &width, sizeof(width)); |
102 } | 102 } |
103 SkASSERT(KeySize(style, apply) == i); | 103 SkASSERT(KeySize(style, apply) == i); |
104 } | 104 } |
105 | 105 |
106 void GrStyle::initPathEffect(SkPathEffect* pe) { | 106 void GrStyle::initPathEffect(SkPathEffect* pe) { |
107 SkASSERT(!fPathEffect) | 107 SkASSERT(!fPathEffect); |
108 SkASSERT(SkPathEffect::kNone_DashType == fDashInfo.fType); | 108 SkASSERT(SkPathEffect::kNone_DashType == fDashInfo.fType); |
109 SkASSERT(0 == fDashInfo.fIntervals.count()); | 109 SkASSERT(0 == fDashInfo.fIntervals.count()); |
110 if (!pe) { | 110 if (!pe) { |
111 return; | 111 return; |
112 } | 112 } |
113 SkPathEffect::DashInfo info; | 113 SkPathEffect::DashInfo info; |
114 if (SkPathEffect::kDash_DashType == pe->asADash(&info)) { | 114 if (SkPathEffect::kDash_DashType == pe->asADash(&info)) { |
115 SkStrokeRec::Style recStyle = fStrokeRec.getStyle(); | 115 SkStrokeRec::Style recStyle = fStrokeRec.getStyle(); |
116 if (recStyle != SkStrokeRec::kFill_Style && recStyle != SkStrokeRec::kSt
rokeAndFill_Style) { | 116 if (recStyle != SkStrokeRec::kFill_Style && recStyle != SkStrokeRec::kSt
rokeAndFill_Style) { |
117 fDashInfo.fType = SkPathEffect::kDash_DashType; | 117 fDashInfo.fType = SkPathEffect::kDash_DashType; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 return false; | 190 return false; |
191 } else { | 191 } else { |
192 SkASSERT(SkStrokeRec::kFill_Style == strokeRec.getStyle() || | 192 SkASSERT(SkStrokeRec::kFill_Style == strokeRec.getStyle() || |
193 SkStrokeRec::kHairline_Style == strokeRec.getStyle()); | 193 SkStrokeRec::kHairline_Style == strokeRec.getStyle()); |
194 *style = strokeRec.getStyle() == SkStrokeRec::kFill_Style | 194 *style = strokeRec.getStyle() == SkStrokeRec::kFill_Style |
195 ? SkStrokeRec::kFill_InitStyle | 195 ? SkStrokeRec::kFill_InitStyle |
196 : SkStrokeRec::kHairline_InitStyle; | 196 : SkStrokeRec::kHairline_InitStyle; |
197 } | 197 } |
198 return true; | 198 return true; |
199 } | 199 } |
OLD | NEW |