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 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
990 | 990 |
991 bool SkBitmap::canCopyTo(SkColorType dstColorType) const { | 991 bool SkBitmap::canCopyTo(SkColorType dstColorType) const { |
992 if (this->colorType() == kUnknown_SkColorType) { | 992 if (this->colorType() == kUnknown_SkColorType) { |
993 return false; | 993 return false; |
994 } | 994 } |
995 | 995 |
996 bool sameConfigs = (this->colorType() == dstColorType); | 996 bool sameConfigs = (this->colorType() == dstColorType); |
997 switch (dstColorType) { | 997 switch (dstColorType) { |
998 case kAlpha_8_SkColorType: | 998 case kAlpha_8_SkColorType: |
999 case kRGB_565_SkColorType: | 999 case kRGB_565_SkColorType: |
1000 case kN32_SkColorType: | 1000 case kRGBA_8888_SkColorType: |
| 1001 case kBGRA_8888_SkColorType: |
1001 break; | 1002 break; |
1002 case kIndex_8_SkColorType: | 1003 case kIndex_8_SkColorType: |
1003 if (!sameConfigs) { | 1004 if (!sameConfigs) { |
1004 return false; | 1005 return false; |
1005 } | 1006 } |
1006 break; | 1007 break; |
1007 case kARGB_4444_SkColorType: | 1008 case kARGB_4444_SkColorType: |
1008 return sameConfigs || kN32_SkColorType == this->colorType(); | 1009 return sameConfigs || kN32_SkColorType == this->colorType(); |
1009 default: | 1010 default: |
1010 return false; | 1011 return false; |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1718 /////////////////////////////////////////////////////////////////////////////// | 1719 /////////////////////////////////////////////////////////////////////////////// |
1719 | 1720 |
1720 #ifdef SK_DEBUG | 1721 #ifdef SK_DEBUG |
1721 void SkImageInfo::validate() const { | 1722 void SkImageInfo::validate() const { |
1722 SkASSERT(fWidth >= 0); | 1723 SkASSERT(fWidth >= 0); |
1723 SkASSERT(fHeight >= 0); | 1724 SkASSERT(fHeight >= 0); |
1724 SkASSERT(SkColorTypeIsValid(fColorType)); | 1725 SkASSERT(SkColorTypeIsValid(fColorType)); |
1725 SkASSERT(SkAlphaTypeIsValid(fAlphaType)); | 1726 SkASSERT(SkAlphaTypeIsValid(fAlphaType)); |
1726 } | 1727 } |
1727 #endif | 1728 #endif |
OLD | NEW |