OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2008 The Android Open Source Project | 3 * Copyright 2008 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 SkASSERT(fInfo.validRowBytes(fRowBytes)); | 1316 SkASSERT(fInfo.validRowBytes(fRowBytes)); |
1317 uint8_t allFlags = kImageIsVolatile_Flag; | 1317 uint8_t allFlags = kImageIsVolatile_Flag; |
1318 #ifdef SK_BUILD_FOR_ANDROID | 1318 #ifdef SK_BUILD_FOR_ANDROID |
1319 allFlags |= kHasHardwareMipMap_Flag; | 1319 allFlags |= kHasHardwareMipMap_Flag; |
1320 #endif | 1320 #endif |
1321 SkASSERT((~allFlags & fFlags) == 0); | 1321 SkASSERT((~allFlags & fFlags) == 0); |
1322 SkASSERT(fPixelLockCount >= 0); | 1322 SkASSERT(fPixelLockCount >= 0); |
1323 | 1323 |
1324 if (fPixels) { | 1324 if (fPixels) { |
1325 SkASSERT(fPixelRef); | 1325 SkASSERT(fPixelRef); |
| 1326 SkASSERT(fPixelLockCount > 0); |
1326 SkASSERT(fPixelRef->isLocked()); | 1327 SkASSERT(fPixelRef->isLocked()); |
1327 SkASSERT(fPixelRef->rowBytes() == fRowBytes); | 1328 SkASSERT(fPixelRef->rowBytes() == fRowBytes); |
1328 SkASSERT(fPixelRefOrigin.fX >= 0); | 1329 SkASSERT(fPixelRefOrigin.fX >= 0); |
1329 SkASSERT(fPixelRefOrigin.fY >= 0); | 1330 SkASSERT(fPixelRefOrigin.fY >= 0); |
1330 SkASSERT(fPixelRef->info().width() >= (int)this->width() + fPixelRefOrig
in.fX); | 1331 SkASSERT(fPixelRef->info().width() >= (int)this->width() + fPixelRefOrig
in.fX); |
1331 SkASSERT(fPixelRef->info().height() >= (int)this->height() + fPixelRefOr
igin.fY); | 1332 SkASSERT(fPixelRef->info().height() >= (int)this->height() + fPixelRefOr
igin.fY); |
1332 SkASSERT(fPixelRef->rowBytes() >= fInfo.minRowBytes()); | 1333 SkASSERT(fPixelRef->rowBytes() >= fInfo.minRowBytes()); |
1333 } else { | 1334 } else { |
1334 SkASSERT(NULL == fColorTable); | 1335 SkASSERT(NULL == fColorTable); |
1335 } | 1336 } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1379 /////////////////////////////////////////////////////////////////////////////// | 1380 /////////////////////////////////////////////////////////////////////////////// |
1380 | 1381 |
1381 #ifdef SK_DEBUG | 1382 #ifdef SK_DEBUG |
1382 void SkImageInfo::validate() const { | 1383 void SkImageInfo::validate() const { |
1383 SkASSERT(fWidth >= 0); | 1384 SkASSERT(fWidth >= 0); |
1384 SkASSERT(fHeight >= 0); | 1385 SkASSERT(fHeight >= 0); |
1385 SkASSERT(SkColorTypeIsValid(fColorType)); | 1386 SkASSERT(SkColorTypeIsValid(fColorType)); |
1386 SkASSERT(SkAlphaTypeIsValid(fAlphaType)); | 1387 SkASSERT(SkAlphaTypeIsValid(fAlphaType)); |
1387 } | 1388 } |
1388 #endif | 1389 #endif |
OLD | NEW |