| 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 "SkOnce.h" | 9 #include "SkOnce.h" |
| 10 #include "SkPath.h" | 10 #include "SkPath.h" |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 SkASSERT(static_cast<ptrdiff_t>(fFreeSpace) >= 0); | 325 SkASSERT(static_cast<ptrdiff_t>(fFreeSpace) >= 0); |
| 326 SkASSERT(reinterpret_cast<intptr_t>(fVerbs) - reinterpret_cast<intptr_t>(fPo
ints) >= 0); | 326 SkASSERT(reinterpret_cast<intptr_t>(fVerbs) - reinterpret_cast<intptr_t>(fPo
ints) >= 0); |
| 327 SkASSERT((NULL == fPoints) == (NULL == fVerbs)); | 327 SkASSERT((NULL == fPoints) == (NULL == fVerbs)); |
| 328 SkASSERT(!(NULL == fPoints && 0 != fFreeSpace)); | 328 SkASSERT(!(NULL == fPoints && 0 != fFreeSpace)); |
| 329 SkASSERT(!(NULL == fPoints && 0 != fFreeSpace)); | 329 SkASSERT(!(NULL == fPoints && 0 != fFreeSpace)); |
| 330 SkASSERT(!(NULL == fPoints && fPointCnt)); | 330 SkASSERT(!(NULL == fPoints && fPointCnt)); |
| 331 SkASSERT(!(NULL == fVerbs && fVerbCnt)); | 331 SkASSERT(!(NULL == fVerbs && fVerbCnt)); |
| 332 SkASSERT(this->currSize() == | 332 SkASSERT(this->currSize() == |
| 333 fFreeSpace + sizeof(SkPoint) * fPointCnt + sizeof(uint8_t) * fVe
rbCnt); | 333 fFreeSpace + sizeof(SkPoint) * fPointCnt + sizeof(uint8_t) * fVe
rbCnt); |
| 334 | 334 |
| 335 #ifdef SK_DEBUG | |
| 336 if (!fBoundsIsDirty && !fBounds.isEmpty()) { | 335 if (!fBoundsIsDirty && !fBounds.isEmpty()) { |
| 337 bool isFinite = true; | 336 bool isFinite = true; |
| 338 for (int i = 0; i < fPointCnt; ++i) { | 337 for (int i = 0; i < fPointCnt; ++i) { |
| 339 SkASSERT(fBounds.fLeft - fPoints[i].fX < SK_ScalarNearlyZero && | 338 SkASSERT(!fPoints[i].isFinite() || ( |
| 339 fBounds.fLeft - fPoints[i].fX < SK_ScalarNearlyZero && |
| 340 fPoints[i].fX - fBounds.fRight < SK_ScalarNearlyZero && | 340 fPoints[i].fX - fBounds.fRight < SK_ScalarNearlyZero && |
| 341 fBounds.fTop - fPoints[i].fY < SK_ScalarNearlyZero && | 341 fBounds.fTop - fPoints[i].fY < SK_ScalarNearlyZero && |
| 342 fPoints[i].fY - fBounds.fBottom < SK_ScalarNearlyZero); | 342 fPoints[i].fY - fBounds.fBottom < SK_ScalarNearlyZero)); |
| 343 if (!fPoints[i].isFinite()) { | 343 if (!fPoints[i].isFinite()) { |
| 344 isFinite = false; | 344 isFinite = false; |
| 345 } | 345 } |
| 346 } | 346 } |
| 347 SkASSERT(SkToBool(fIsFinite) == isFinite); | 347 SkASSERT(SkToBool(fIsFinite) == isFinite); |
| 348 } | 348 } |
| 349 #endif | |
| 350 } | 349 } |
| 351 #endif | 350 #endif |
| OLD | NEW |