promote SkImage::AlphaType to SkAlphaType
BUG=
R=bsalomon@google.com
Review URL: https://codereview.chromium.org/24130009
git-svn-id: http://skia.googlecode.com/svn/trunk@11421 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/image/SkImagePriv.cpp b/src/image/SkImagePriv.cpp
index 9454272..1e72236 100644
--- a/src/image/SkImagePriv.cpp
+++ b/src/image/SkImagePriv.cpp
@@ -14,16 +14,16 @@
switch (info.fColorType) {
case SkImage::kAlpha_8_ColorType:
switch (info.fAlphaType) {
- case SkImage::kIgnore_AlphaType:
+ case kIgnore_SkAlphaType:
// makes no sense
return SkBitmap::kNo_Config;
- case SkImage::kOpaque_AlphaType:
+ case kOpaque_SkAlphaType:
*isOpaque = true;
return SkBitmap::kA8_Config;
- case SkImage::kPremul_AlphaType:
- case SkImage::kUnpremul_AlphaType:
+ case kPremul_SkAlphaType:
+ case kUnpremul_SkAlphaType:
*isOpaque = false;
return SkBitmap::kA8_Config;
}
@@ -34,27 +34,25 @@
*isOpaque = true;
return SkBitmap::kRGB_565_Config;
- case SkImage::kRGBA_8888_ColorType:
- case SkImage::kBGRA_8888_ColorType:
- // not supported yet
- return SkBitmap::kNo_Config;
-
case SkImage::kPMColor_ColorType:
switch (info.fAlphaType) {
- case SkImage::kIgnore_AlphaType:
- case SkImage::kUnpremul_AlphaType:
+ case kIgnore_SkAlphaType:
+ case kUnpremul_SkAlphaType:
// not supported yet
return SkBitmap::kNo_Config;
- case SkImage::kOpaque_AlphaType:
+ case kOpaque_SkAlphaType:
*isOpaque = true;
return SkBitmap::kARGB_8888_Config;
- case SkImage::kPremul_AlphaType:
+ case kPremul_SkAlphaType:
*isOpaque = false;
return SkBitmap::kARGB_8888_Config;
}
break;
+
+ default:
+ // break for unsupported colortypes
+ break;
}
- SkDEBUGFAIL("how did we get here");
return SkBitmap::kNo_Config;
}
@@ -91,8 +89,8 @@
info->fWidth = bm.width();
info->fHeight = bm.height();
- info->fAlphaType = bm.isOpaque() ? SkImage::kOpaque_AlphaType :
- SkImage::kPremul_AlphaType;
+ info->fAlphaType = bm.isOpaque() ? kOpaque_SkAlphaType :
+ kPremul_SkAlphaType;
return true;
}