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 #ifndef GrStyle_DEFINED | 8 #ifndef GrStyle_DEFINED |
9 #define GrStyle_DEFINED | 9 #define GrStyle_DEFINED |
10 | 10 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 152 |
153 private: | 153 private: |
154 void initPathEffect(SkPathEffect* pe); | 154 void initPathEffect(SkPathEffect* pe); |
155 | 155 |
156 struct DashInfo { | 156 struct DashInfo { |
157 DashInfo() : fType(SkPathEffect::kNone_DashType) {} | 157 DashInfo() : fType(SkPathEffect::kNone_DashType) {} |
158 DashInfo& operator=(const DashInfo& that) { | 158 DashInfo& operator=(const DashInfo& that) { |
159 fType = that.fType; | 159 fType = that.fType; |
160 fPhase = that.fPhase; | 160 fPhase = that.fPhase; |
161 fIntervals.reset(that.fIntervals.count()); | 161 fIntervals.reset(that.fIntervals.count()); |
162 memcpy(fIntervals.get(), that.fIntervals.get(), | 162 sk_careful_memcpy(fIntervals.get(), that.fIntervals.get(), |
163 sizeof(SkScalar) * that.fIntervals.count()); | 163 sizeof(SkScalar) * that.fIntervals.count()); |
164 return *this; | 164 return *this; |
165 } | 165 } |
166 void reset() { | 166 void reset() { |
167 fType = SkPathEffect::kNone_DashType; | 167 fType = SkPathEffect::kNone_DashType; |
168 fIntervals.reset(0); | 168 fIntervals.reset(0); |
169 } | 169 } |
170 SkPathEffect::DashType fType; | 170 SkPathEffect::DashType fType; |
171 SkScalar fPhase; | 171 SkScalar fPhase; |
172 SkAutoSTArray<4, SkScalar> fIntervals; | 172 SkAutoSTArray<4, SkScalar> fIntervals; |
173 }; | 173 }; |
174 | 174 |
175 SkStrokeRec fStrokeRec; | 175 SkStrokeRec fStrokeRec; |
176 sk_sp<SkPathEffect> fPathEffect; | 176 sk_sp<SkPathEffect> fPathEffect; |
177 DashInfo fDashInfo; | 177 DashInfo fDashInfo; |
178 }; | 178 }; |
179 | 179 |
180 #endif | 180 #endif |
OLD | NEW |