| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 } | 172 } |
| 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 SkASSERT(&that != NULL); | |
| 183 | |
| 184 if (this != &that) { | 182 if (this != &that) { |
| 185 fPathRef.swap(&that.fPathRef); | 183 fPathRef.swap(&that.fPathRef); |
| 186 SkTSwap<int>(fLastMoveToIndex, that.fLastMoveToIndex); | 184 SkTSwap<int>(fLastMoveToIndex, that.fLastMoveToIndex); |
| 187 SkTSwap<uint8_t>(fFillType, that.fFillType); | 185 SkTSwap<uint8_t>(fFillType, that.fFillType); |
| 188 SkTSwap<uint8_t>(fConvexity, that.fConvexity); | 186 SkTSwap<uint8_t>(fConvexity, that.fConvexity); |
| 189 SkTSwap<uint8_t>(fDirection, that.fDirection); | 187 SkTSwap<uint8_t>(fDirection, that.fDirection); |
| 190 SkTSwap<SkBool8>(fIsVolatile, that.fIsVolatile); | 188 SkTSwap<SkBool8>(fIsVolatile, that.fIsVolatile); |
| 191 } | 189 } |
| 192 } | 190 } |
| 193 | 191 |
| (...skipping 2598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2792 switch (this->getFillType()) { | 2790 switch (this->getFillType()) { |
| 2793 case SkPath::kEvenOdd_FillType: | 2791 case SkPath::kEvenOdd_FillType: |
| 2794 case SkPath::kInverseEvenOdd_FillType: | 2792 case SkPath::kInverseEvenOdd_FillType: |
| 2795 w &= 1; | 2793 w &= 1; |
| 2796 break; | 2794 break; |
| 2797 default: | 2795 default: |
| 2798 break; | 2796 break; |
| 2799 } | 2797 } |
| 2800 return SkToBool(w); | 2798 return SkToBool(w); |
| 2801 } | 2799 } |
| OLD | NEW |