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 "GrShape.h" | 8 #include "GrShape.h" |
9 | 9 |
10 GrShape& GrShape::operator=(const GrShape& that) { | 10 GrShape& GrShape::operator=(const GrShape& that) { |
(...skipping 14 matching lines...) Expand all Loading... |
25 break; | 25 break; |
26 case Type::kPath: | 26 case Type::kPath: |
27 if (wasPath) { | 27 if (wasPath) { |
28 *fPath.get() = *that.fPath.get(); | 28 *fPath.get() = *that.fPath.get(); |
29 } else { | 29 } else { |
30 fPath.set(*that.fPath.get()); | 30 fPath.set(*that.fPath.get()); |
31 } | 31 } |
32 break; | 32 break; |
33 } | 33 } |
34 fInheritedKey.reset(that.fInheritedKey.count()); | 34 fInheritedKey.reset(that.fInheritedKey.count()); |
35 memcpy(fInheritedKey.get(), that.fInheritedKey.get(), | 35 sk_careful_memcpy(fInheritedKey.get(), that.fInheritedKey.get(), |
36 sizeof(uint32_t) * fInheritedKey.count()); | 36 sizeof(uint32_t) * fInheritedKey.count()); |
37 return *this; | 37 return *this; |
38 } | 38 } |
39 | 39 |
40 int GrShape::unstyledKeySize() const { | 40 int GrShape::unstyledKeySize() const { |
41 if (fInheritedKey.count()) { | 41 if (fInheritedKey.count()) { |
42 return fInheritedKey.count(); | 42 return fInheritedKey.count(); |
43 } | 43 } |
44 switch (fType) { | 44 switch (fType) { |
45 case Type::kEmpty: | 45 case Type::kEmpty: |
46 return 1; | 46 return 1; |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 srcForStrokeRec = tmpPath.init(); | 210 srcForStrokeRec = tmpPath.init(); |
211 parent.asPath(tmpPath.get()); | 211 parent.asPath(tmpPath.get()); |
212 } | 212 } |
213 SkASSERT(parent.fStyle.strokeRec().needToApply()); | 213 SkASSERT(parent.fStyle.strokeRec().needToApply()); |
214 SkAssertResult(parent.fStyle.strokeRec().applyToPath(fPath.get(), *srcFo
rStrokeRec)); | 214 SkAssertResult(parent.fStyle.strokeRec().applyToPath(fPath.get(), *srcFo
rStrokeRec)); |
215 fStyle.resetToInitStyle(SkStrokeRec::kFill_InitStyle); | 215 fStyle.resetToInitStyle(SkStrokeRec::kFill_InitStyle); |
216 } | 216 } |
217 this->attemptToReduceFromPath(); | 217 this->attemptToReduceFromPath(); |
218 this->setInheritedKey(*parentForKey, apply); | 218 this->setInheritedKey(*parentForKey, apply); |
219 } | 219 } |
OLD | NEW |