| 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 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 977 return true; | 977 return true; |
| 978 } | 978 } |
| 979 | 979 |
| 980 /////////////////////////////////////////////////////////////////////////////// | 980 /////////////////////////////////////////////////////////////////////////////// |
| 981 | 981 |
| 982 #include "SkCanvas.h" | 982 #include "SkCanvas.h" |
| 983 #include "SkPaint.h" | 983 #include "SkPaint.h" |
| 984 | 984 |
| 985 #ifdef SK_SUPPORT_LEGACY_COPYTO_CONFIG | 985 #ifdef SK_SUPPORT_LEGACY_COPYTO_CONFIG |
| 986 bool SkBitmap::copyTo(SkBitmap* dst, Config c, Allocator* allocator) const { | 986 bool SkBitmap::copyTo(SkBitmap* dst, Config c, Allocator* allocator) const { |
| 987 return this->copyTo(dst, SkBitmapConfigToSkColorType(c), allocator); | 987 return this->copyTo(dst, SkBitmapConfigToColorType(c), allocator); |
| 988 } | 988 } |
| 989 | 989 |
| 990 bool SkBitmap::canCopyTo(Config newConfig) const { | 990 bool SkBitmap::canCopyTo(Config newConfig) const { |
| 991 return this->canCopyTo(SkBitmapConfigToSkColorType(c)); | 991 return this->canCopyTo(SkBitmapConfigToColorType(newConfig)); |
| 992 } | 992 } |
| 993 #endif | 993 #endif |
| 994 | 994 |
| 995 bool SkBitmap::canCopyTo(SkColorType dstColorType) const { | 995 bool SkBitmap::canCopyTo(SkColorType dstColorType) const { |
| 996 if (this->colorType() == kUnknown_SkColorType) { | 996 if (this->colorType() == kUnknown_SkColorType) { |
| 997 return false; | 997 return false; |
| 998 } | 998 } |
| 999 | 999 |
| 1000 bool sameConfigs = (this->colorType() == dstColorType); | 1000 bool sameConfigs = (this->colorType() == dstColorType); |
| 1001 switch (dstColorType) { | 1001 switch (dstColorType) { |
| (...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1735 /////////////////////////////////////////////////////////////////////////////// | 1735 /////////////////////////////////////////////////////////////////////////////// |
| 1736 | 1736 |
| 1737 #ifdef SK_DEBUG | 1737 #ifdef SK_DEBUG |
| 1738 void SkImageInfo::validate() const { | 1738 void SkImageInfo::validate() const { |
| 1739 SkASSERT(fWidth >= 0); | 1739 SkASSERT(fWidth >= 0); |
| 1740 SkASSERT(fHeight >= 0); | 1740 SkASSERT(fHeight >= 0); |
| 1741 SkASSERT(SkColorTypeIsValid(fColorType)); | 1741 SkASSERT(SkColorTypeIsValid(fColorType)); |
| 1742 SkASSERT(SkAlphaTypeIsValid(fAlphaType)); | 1742 SkASSERT(SkAlphaTypeIsValid(fAlphaType)); |
| 1743 } | 1743 } |
| 1744 #endif | 1744 #endif |
| OLD | NEW |