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

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

Issue 1110353003: Fix build warning: reference cannot be bound to dereferenced null pointer in well-defined C++ code;… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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/core/SkPaint.cpp ('k') | src/core/SkStroke.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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « src/core/SkPaint.cpp ('k') | src/core/SkStroke.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698