Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 (ref.fVerbCnt == 0 && ref.fPointCnt == 0) { | |
|
reed1
2014/11/14 17:09:41
is it enough to just check fVerbCnt (and if it is
mtklein
2014/11/14 17:13:20
Yes (until we add pointless verbs :P). Done.
| |
| 197 return true; | |
| 198 } | |
| 199 SkASSERT(this->verbsMemBegin() && ref.verbsMemBegin()); | |
| 196 if (0 != memcmp(this->verbsMemBegin(), | 200 if (0 != memcmp(this->verbsMemBegin(), |
| 197 ref.verbsMemBegin(), | 201 ref.verbsMemBegin(), |
| 198 ref.fVerbCnt * sizeof(uint8_t))) { | 202 ref.fVerbCnt * sizeof(uint8_t))) { |
| 199 SkASSERT(!genIDMatch); | 203 SkASSERT(!genIDMatch); |
| 200 return false; | 204 return false; |
| 201 } | 205 } |
| 206 SkASSERT(this->points() && ref.points()); | |
| 202 if (0 != memcmp(this->points(), | 207 if (0 != memcmp(this->points(), |
| 203 ref.points(), | 208 ref.points(), |
| 204 ref.fPointCnt * sizeof(SkPoint))) { | 209 ref.fPointCnt * sizeof(SkPoint))) { |
| 205 SkASSERT(!genIDMatch); | 210 SkASSERT(!genIDMatch); |
| 206 return false; | 211 return false; |
| 207 } | 212 } |
| 208 if (fConicWeights != ref.fConicWeights) { | 213 if (fConicWeights != ref.fConicWeights) { |
| 209 SkASSERT(!genIDMatch); | 214 SkASSERT(!genIDMatch); |
| 210 return false; | 215 return false; |
| 211 } | 216 } |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 483 break; | 488 break; |
| 484 default: | 489 default: |
| 485 SkDEBUGFAIL("Unknown Verb"); | 490 SkDEBUGFAIL("Unknown Verb"); |
| 486 break; | 491 break; |
| 487 } | 492 } |
| 488 } | 493 } |
| 489 SkASSERT(mask == fSegmentMask); | 494 SkASSERT(mask == fSegmentMask); |
| 490 #endif // SK_DEBUG_PATH | 495 #endif // SK_DEBUG_PATH |
| 491 } | 496 } |
| 492 #endif | 497 #endif |
| OLD | NEW |