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 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1594 allFlags |= kHasHardwareMipMap_Flag; | 1594 allFlags |= kHasHardwareMipMap_Flag; |
1595 #endif | 1595 #endif |
1596 SkASSERT(fFlags <= allFlags); | 1596 SkASSERT(fFlags <= allFlags); |
1597 SkASSERT(fPixelLockCount >= 0); | 1597 SkASSERT(fPixelLockCount >= 0); |
1598 SkASSERT((uint8_t)ComputeBytesPerPixel((Config)fConfig) == fBytesPerPixel); | 1598 SkASSERT((uint8_t)ComputeBytesPerPixel((Config)fConfig) == fBytesPerPixel); |
1599 | 1599 |
1600 if (fPixels) { | 1600 if (fPixels) { |
1601 SkASSERT(fPixelRef); | 1601 SkASSERT(fPixelRef); |
1602 SkASSERT(fPixelLockCount > 0); | 1602 SkASSERT(fPixelLockCount > 0); |
1603 SkASSERT(fPixelRef->isLocked()); | 1603 SkASSERT(fPixelRef->isLocked()); |
| 1604 #if !defined(SK_SUPPORT_LEGACY_ONLOCKPIXELS) |
1604 SkASSERT(fPixelRef->rowBytes() == fRowBytes); | 1605 SkASSERT(fPixelRef->rowBytes() == fRowBytes); |
| 1606 #endif |
1605 SkASSERT(fPixelRefOrigin.fX >= 0); | 1607 SkASSERT(fPixelRefOrigin.fX >= 0); |
1606 SkASSERT(fPixelRefOrigin.fY >= 0); | 1608 SkASSERT(fPixelRefOrigin.fY >= 0); |
1607 SkASSERT(fPixelRef->info().fWidth >= (int)fWidth + fPixelRefOrigin.fX); | 1609 SkASSERT(fPixelRef->info().fWidth >= (int)fWidth + fPixelRefOrigin.fX); |
1608 SkASSERT(fPixelRef->info().fHeight >= (int)fHeight + fPixelRefOrigin.fY)
; | 1610 SkASSERT(fPixelRef->info().fHeight >= (int)fHeight + fPixelRefOrigin.fY)
; |
| 1611 #if !defined(SK_SUPPORT_LEGACY_ONLOCKPIXELS) |
1609 SkASSERT(fPixelRef->rowBytes() >= fWidth * fBytesPerPixel); | 1612 SkASSERT(fPixelRef->rowBytes() >= fWidth * fBytesPerPixel); |
| 1613 #endif |
1610 } else { | 1614 } else { |
1611 SkASSERT(NULL == fColorTable); | 1615 SkASSERT(NULL == fColorTable); |
1612 } | 1616 } |
1613 } | 1617 } |
1614 #endif | 1618 #endif |
1615 | 1619 |
1616 #ifdef SK_DEVELOPER | 1620 #ifdef SK_DEVELOPER |
1617 void SkBitmap::toString(SkString* str) const { | 1621 void SkBitmap::toString(SkString* str) const { |
1618 | 1622 |
1619 static const char* gConfigNames[kConfigCount] = { | 1623 static const char* gConfigNames[kConfigCount] = { |
(...skipping 25 matching lines...) Expand all Loading... |
1645 if (NULL != uri) { | 1649 if (NULL != uri) { |
1646 str->appendf(" uri:\"%s\"", uri); | 1650 str->appendf(" uri:\"%s\"", uri); |
1647 } else { | 1651 } else { |
1648 str->appendf(" pixelref:%p", pr); | 1652 str->appendf(" pixelref:%p", pr); |
1649 } | 1653 } |
1650 } | 1654 } |
1651 | 1655 |
1652 str->append(")"); | 1656 str->append(")"); |
1653 } | 1657 } |
1654 #endif | 1658 #endif |
OLD | NEW |