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

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

Issue 732643002: Don't pass null to memcmp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: simplify check Created 6 years, 1 month 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 | « no previous file | tests/PathTest.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 2013 Google Inc. 2 * Copyright 2013 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 "SkBuffer.h" 8 #include "SkBuffer.h"
9 #include "SkLazyPtr.h" 9 #include "SkLazyPtr.h"
10 #include "SkPath.h" 10 #include "SkPath.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 #ifdef SK_RELEASE 186 #ifdef SK_RELEASE
187 if (genIDMatch) { 187 if (genIDMatch) {
188 return true; 188 return true;
189 } 189 }
190 #endif 190 #endif
191 if (fPointCnt != ref.fPointCnt || 191 if (fPointCnt != ref.fPointCnt ||
192 fVerbCnt != ref.fVerbCnt) { 192 fVerbCnt != ref.fVerbCnt) {
193 SkASSERT(!genIDMatch); 193 SkASSERT(!genIDMatch);
194 return false; 194 return false;
195 } 195 }
196 if (0 == ref.fVerbCnt) {
197 SkASSERT(0 == ref.fPointCnt);
198 return true;
199 }
200 SkASSERT(this->verbsMemBegin() && ref.verbsMemBegin());
196 if (0 != memcmp(this->verbsMemBegin(), 201 if (0 != memcmp(this->verbsMemBegin(),
197 ref.verbsMemBegin(), 202 ref.verbsMemBegin(),
198 ref.fVerbCnt * sizeof(uint8_t))) { 203 ref.fVerbCnt * sizeof(uint8_t))) {
199 SkASSERT(!genIDMatch); 204 SkASSERT(!genIDMatch);
200 return false; 205 return false;
201 } 206 }
207 SkASSERT(this->points() && ref.points());
202 if (0 != memcmp(this->points(), 208 if (0 != memcmp(this->points(),
203 ref.points(), 209 ref.points(),
204 ref.fPointCnt * sizeof(SkPoint))) { 210 ref.fPointCnt * sizeof(SkPoint))) {
205 SkASSERT(!genIDMatch); 211 SkASSERT(!genIDMatch);
206 return false; 212 return false;
207 } 213 }
208 if (fConicWeights != ref.fConicWeights) { 214 if (fConicWeights != ref.fConicWeights) {
209 SkASSERT(!genIDMatch); 215 SkASSERT(!genIDMatch);
210 return false; 216 return false;
211 } 217 }
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 break; 489 break;
484 default: 490 default:
485 SkDEBUGFAIL("Unknown Verb"); 491 SkDEBUGFAIL("Unknown Verb");
486 break; 492 break;
487 } 493 }
488 } 494 }
489 SkASSERT(mask == fSegmentMask); 495 SkASSERT(mask == fSegmentMask);
490 #endif // SK_DEBUG_PATH 496 #endif // SK_DEBUG_PATH
491 } 497 }
492 #endif 498 #endif
OLDNEW
« no previous file with comments | « no previous file | tests/PathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698