Update SkBitmap::validate to respect Android flag.

Without this change, an SkBitmap with hardware mip will assert in
validate.

R=djsollen@google.com

Review URL: https://codereview.chromium.org/16870002

git-svn-id: http://skia.googlecode.com/svn/trunk@9614 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
scroggo@google.com 2013-06-14 15:55:56 +00:00
parent 24d6454cb8
commit 8e990eb440

View File

@ -1625,7 +1625,11 @@ SkBitmap::RLEPixels::~RLEPixels() {
void SkBitmap::validate() const {
SkASSERT(fConfig < kConfigCount);
SkASSERT(fRowBytes >= (unsigned)ComputeRowBytes((Config)fConfig, fWidth));
SkASSERT(fFlags <= (kImageIsOpaque_Flag | kImageIsVolatile_Flag | kImageIsImmutable_Flag));
uint8_t allFlags = kImageIsOpaque_Flag | kImageIsVolatile_Flag | kImageIsImmutable_Flag;
#ifdef SK_BUILD_FOR_ANDROID
allFlags |= kHasHardwareMipMap_Flag;
#endif
SkASSERT(fFlags <= allFlags);
SkASSERT(fPixelLockCount >= 0);
SkASSERT(NULL == fColorTable || (unsigned)fColorTable->getRefCnt() < 10000);
SkASSERT((uint8_t)ComputeBytesPerPixel((Config)fConfig) == fBytesPerPixel);