diff options
-rw-r--r-- | include/core/SkCanvas.h | 2 | ||||
-rw-r--r-- | include/core/SkImageInfo.h | 17 | ||||
-rw-r--r-- | src/core/SkBitmap.cpp | 4 | ||||
-rw-r--r-- | src/core/SkBitmapDevice.cpp | 2 | ||||
-rw-r--r-- | src/core/SkConfig8888.cpp | 4 | ||||
-rw-r--r-- | src/core/SkImageInfo.cpp | 4 | ||||
-rw-r--r-- | src/utils/mac/SkCreateCGImageRef.cpp | 6 |
7 files changed, 16 insertions, 23 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index a57f4cd943..74bf909c21 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -64,7 +64,7 @@ public: * 1. invalid ImageInfo (e.g. negative dimensions) * 2. unsupported ImageInfo for a canvas * - kUnknown_SkColorType, kIndex_8_SkColorType - * - kIgnore_SkAlphaType + * - kUnknown_SkAlphaType * - this list is not complete, so others may also be unsupported * * Note: it is valid to request a supported ImageInfo, but with zero diff --git a/include/core/SkImageInfo.h b/include/core/SkImageInfo.h index f928416fe7..d915c09255 100644 --- a/include/core/SkImageInfo.h +++ b/include/core/SkImageInfo.h @@ -19,12 +19,7 @@ class SkWriteBuffer; * Describes how to interpret the alpha compoent of a pixel. */ enum SkAlphaType { - /** - * All pixels should be treated as opaque, regardless of the value stored - * in their alpha field. Used for legacy images that wrote 0 or garbarge - * in their alpha field, but intended the RGB to be treated as opaque. - */ - kIgnore_SkAlphaType, + kUnknown_SkAlphaType, /** * All pixels are stored as opaque. This differs slightly from kIgnore in @@ -53,11 +48,7 @@ enum SkAlphaType { }; static inline bool SkAlphaTypeIsOpaque(SkAlphaType at) { - SK_COMPILE_ASSERT(kIgnore_SkAlphaType < kOpaque_SkAlphaType, bad_alphatype_order); - SK_COMPILE_ASSERT(kPremul_SkAlphaType > kOpaque_SkAlphaType, bad_alphatype_order); - SK_COMPILE_ASSERT(kUnpremul_SkAlphaType > kOpaque_SkAlphaType, bad_alphatype_order); - - return (unsigned)at <= kOpaque_SkAlphaType; + return kOpaque_SkAlphaType == at; } static inline bool SkAlphaTypeIsValid(unsigned value) { @@ -161,7 +152,7 @@ public: : fWidth(0) , fHeight(0) , fColorType(kUnknown_SkColorType) - , fAlphaType(kIgnore_SkAlphaType) + , fAlphaType(kUnknown_SkAlphaType) , fProfileType(kLinear_SkColorProfileType) {} @@ -200,7 +191,7 @@ public: } static SkImageInfo MakeUnknown(int width, int height) { - return SkImageInfo(width, height, kUnknown_SkColorType, kIgnore_SkAlphaType, + return SkImageInfo(width, height, kUnknown_SkColorType, kUnknown_SkAlphaType, kLinear_SkColorProfileType); } diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp index e77bbbd4e5..0b586cb081 100644 --- a/src/core/SkBitmap.cpp +++ b/src/core/SkBitmap.cpp @@ -182,8 +182,8 @@ SkPixelRef* SkBitmap::setPixelRef(SkPixelRef* pr, int dx, int dy) { SkASSERT(fInfo.height() <= prInfo.height()); SkASSERT(fInfo.colorType() == prInfo.colorType()); switch (prInfo.alphaType()) { - case kIgnore_SkAlphaType: - SkASSERT(fInfo.alphaType() == kIgnore_SkAlphaType); + case kUnknown_SkAlphaType: + SkASSERT(fInfo.alphaType() == kUnknown_SkAlphaType); break; case kOpaque_SkAlphaType: case kPremul_SkAlphaType: diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp index e545baea93..37cbff50e2 100644 --- a/src/core/SkBitmapDevice.cpp +++ b/src/core/SkBitmapDevice.cpp @@ -25,7 +25,7 @@ static bool valid_for_bitmap_device(const SkImageInfo& info, // TODO: can we stop supporting kUnknown in SkBitmkapDevice? if (kUnknown_SkColorType == info.colorType()) { if (newAlphaType) { - *newAlphaType = kIgnore_SkAlphaType; + *newAlphaType = kUnknown_SkAlphaType; } return true; } diff --git a/src/core/SkConfig8888.cpp b/src/core/SkConfig8888.cpp index 8b47a20633..85e208f287 100644 --- a/src/core/SkConfig8888.cpp +++ b/src/core/SkConfig8888.cpp @@ -54,8 +54,8 @@ static bool is_32bit_colortype(SkColorType ct) { } static AlphaVerb compute_AlphaVerb(SkAlphaType src, SkAlphaType dst) { - SkASSERT(kIgnore_SkAlphaType != src); - SkASSERT(kIgnore_SkAlphaType != dst); + SkASSERT(kUnknown_SkAlphaType != src); + SkASSERT(kUnknown_SkAlphaType != dst); if (kOpaque_SkAlphaType == src || kOpaque_SkAlphaType == dst || src == dst) { return kNothing_AlphaVerb; diff --git a/src/core/SkImageInfo.cpp b/src/core/SkImageInfo.cpp index 146a3aeed8..0e8b0b1292 100644 --- a/src/core/SkImageInfo.cpp +++ b/src/core/SkImageInfo.cpp @@ -50,7 +50,7 @@ bool SkColorTypeValidateAlphaType(SkColorType colorType, SkAlphaType alphaType, SkAlphaType* canonical) { switch (colorType) { case kUnknown_SkColorType: - alphaType = kIgnore_SkAlphaType; + alphaType = kUnknown_SkAlphaType; break; case kAlpha_8_SkColorType: if (kUnpremul_SkAlphaType == alphaType) { @@ -61,7 +61,7 @@ bool SkColorTypeValidateAlphaType(SkColorType colorType, SkAlphaType alphaType, case kARGB_4444_SkColorType: case kRGBA_8888_SkColorType: case kBGRA_8888_SkColorType: - if (kIgnore_SkAlphaType == alphaType) { + if (kUnknown_SkAlphaType == alphaType) { return false; } break; diff --git a/src/utils/mac/SkCreateCGImageRef.cpp b/src/utils/mac/SkCreateCGImageRef.cpp index 51a5ed9c03..4675d7185e 100644 --- a/src/utils/mac/SkCreateCGImageRef.cpp +++ b/src/utils/mac/SkCreateCGImageRef.cpp @@ -12,8 +12,9 @@ static CGBitmapInfo ComputeCGAlphaInfo_RGBA(SkAlphaType at) { CGBitmapInfo info = kCGBitmapByteOrder32Big; switch (at) { + case kUnknown_SkAlphaType: + break; case kOpaque_SkAlphaType: - case kIgnore_SkAlphaType: info |= kCGImageAlphaNoneSkipLast; break; case kPremul_SkAlphaType: @@ -29,8 +30,9 @@ static CGBitmapInfo ComputeCGAlphaInfo_RGBA(SkAlphaType at) { static CGBitmapInfo ComputeCGAlphaInfo_BGRA(SkAlphaType at) { CGBitmapInfo info = kCGBitmapByteOrder32Little; switch (at) { + case kUnknown_SkAlphaType: + break; case kOpaque_SkAlphaType: - case kIgnore_SkAlphaType: info |= kCGImageAlphaNoneSkipFirst; break; case kPremul_SkAlphaType: |