Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: src/gpu/GrStyle.h

Issue 1953473002: Fix ASAN errors. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrShape.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/gpu/GrShape.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698