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

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

Issue 16870002: Update SkBitmap::validate to respect Android flag. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 6 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 /* 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 1607 matching lines...) Expand 10 before | Expand all | Expand 10 after
1618 SkBitmap::RLEPixels::~RLEPixels() { 1618 SkBitmap::RLEPixels::~RLEPixels() {
1619 sk_free(fYPtrs); 1619 sk_free(fYPtrs);
1620 } 1620 }
1621 1621
1622 /////////////////////////////////////////////////////////////////////////////// 1622 ///////////////////////////////////////////////////////////////////////////////
1623 1623
1624 #ifdef SK_DEBUG 1624 #ifdef SK_DEBUG
1625 void SkBitmap::validate() const { 1625 void SkBitmap::validate() const {
1626 SkASSERT(fConfig < kConfigCount); 1626 SkASSERT(fConfig < kConfigCount);
1627 SkASSERT(fRowBytes >= (unsigned)ComputeRowBytes((Config)fConfig, fWidth)); 1627 SkASSERT(fRowBytes >= (unsigned)ComputeRowBytes((Config)fConfig, fWidth));
1628 SkASSERT(fFlags <= (kImageIsOpaque_Flag | kImageIsVolatile_Flag | kImageIsIm mutable_Flag)); 1628 uint8_t allFlags = kImageIsOpaque_Flag | kImageIsVolatile_Flag | kImageIsImm utable_Flag;
1629 #ifdef SK_BUILD_FOR_ANDROID
1630 allFlags |= kHasHardwareMipMap_Flag;
1631 #endif
1632 SkASSERT(fFlags <= allFlags);
1629 SkASSERT(fPixelLockCount >= 0); 1633 SkASSERT(fPixelLockCount >= 0);
1630 SkASSERT(NULL == fColorTable || (unsigned)fColorTable->getRefCnt() < 10000); 1634 SkASSERT(NULL == fColorTable || (unsigned)fColorTable->getRefCnt() < 10000);
1631 SkASSERT((uint8_t)ComputeBytesPerPixel((Config)fConfig) == fBytesPerPixel); 1635 SkASSERT((uint8_t)ComputeBytesPerPixel((Config)fConfig) == fBytesPerPixel);
1632 1636
1633 #if 0 // these asserts are not thread-correct, so disable for now 1637 #if 0 // these asserts are not thread-correct, so disable for now
1634 if (fPixelRef) { 1638 if (fPixelRef) {
1635 if (fPixelLockCount > 0) { 1639 if (fPixelLockCount > 0) {
1636 SkASSERT(fPixelRef->isLocked()); 1640 SkASSERT(fPixelRef->isLocked());
1637 } else { 1641 } else {
1638 SkASSERT(NULL == fPixels); 1642 SkASSERT(NULL == fPixels);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1675 if (NULL != uri) { 1679 if (NULL != uri) {
1676 str->appendf(" uri:\"%s\"", uri); 1680 str->appendf(" uri:\"%s\"", uri);
1677 } else { 1681 } else {
1678 str->appendf(" pixelref:%p", pr); 1682 str->appendf(" pixelref:%p", pr);
1679 } 1683 }
1680 } 1684 }
1681 1685
1682 str->append(")"); 1686 str->append(")");
1683 } 1687 }
1684 #endif 1688 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698