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

Side by Side Diff: src/core/SkPath.cpp

Issue 1370803002: Base SkAutoTUnref on skstd::unique_ptr. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 5 years, 2 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 | « include/core/SkRefCnt.h ('k') | src/effects/SkGpuBlurUtils.cpp » ('j') | 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 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
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
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 }
OLDNEW
« no previous file with comments | « include/core/SkRefCnt.h ('k') | src/effects/SkGpuBlurUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698