OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 "SkBuffer.h" | 8 #include "SkBuffer.h" |
9 #include "SkErrorInternals.h" | 9 #include "SkErrorInternals.h" |
10 #include "SkGeometry.h" | 10 #include "SkGeometry.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 bool operator==(const SkPath& a, const SkPath& b) { | 174 bool operator==(const SkPath& a, const SkPath& b) { |
175 // note: don't need to look at isConvex or bounds, since just comparing the | 175 // note: don't need to look at isConvex or bounds, since just comparing the |
176 // raw data is sufficient. | 176 // raw data is sufficient. |
177 return &a == &b || | 177 return &a == &b || |
178 (a.fFillType == b.fFillType && *a.fPathRef.get() == *b.fPathRef.get()); | 178 (a.fFillType == b.fFillType && *a.fPathRef.get() == *b.fPathRef.get()); |
179 } | 179 } |
180 | 180 |
181 void SkPath::swap(SkPath& that) { | 181 void SkPath::swap(SkPath& that) { |
182 if (this != &that) { | 182 if (this != &that) { |
183 fPathRef.swap(&that.fPathRef); | 183 fPathRef.swap(that.fPathRef); |
184 SkTSwap<int>(fLastMoveToIndex, that.fLastMoveToIndex); | 184 SkTSwap<int>(fLastMoveToIndex, that.fLastMoveToIndex); |
185 SkTSwap<uint8_t>(fFillType, that.fFillType); | 185 SkTSwap<uint8_t>(fFillType, that.fFillType); |
186 SkTSwap<uint8_t>(fConvexity, that.fConvexity); | 186 SkTSwap<uint8_t>(fConvexity, that.fConvexity); |
187 // Simulate SkTSwap<uint8_t>(fFirstDirection, that.fFirstDirection); | 187 // Simulate SkTSwap<uint8_t>(fFirstDirection, that.fFirstDirection); |
188 uint8_t temp = fFirstDirection; | 188 uint8_t temp = fFirstDirection; |
189 fFirstDirection.store(that.fFirstDirection.load()); | 189 fFirstDirection.store(that.fFirstDirection.load()); |
190 that.fFirstDirection.store(temp); | 190 that.fFirstDirection.store(temp); |
191 SkTSwap<SkBool8>(fIsVolatile, that.fIsVolatile); | 191 SkTSwap<SkBool8>(fIsVolatile, that.fIsVolatile); |
192 } | 192 } |
193 } | 193 } |
(...skipping 2619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2813 switch (this->getFillType()) { | 2813 switch (this->getFillType()) { |
2814 case SkPath::kEvenOdd_FillType: | 2814 case SkPath::kEvenOdd_FillType: |
2815 case SkPath::kInverseEvenOdd_FillType: | 2815 case SkPath::kInverseEvenOdd_FillType: |
2816 w &= 1; | 2816 w &= 1; |
2817 break; | 2817 break; |
2818 default: | 2818 default: |
2819 break; | 2819 break; |
2820 } | 2820 } |
2821 return SkToBool(w); | 2821 return SkToBool(w); |
2822 } | 2822 } |
OLD | NEW |