store SkAlphaType inside SkBitmap, on road to support unpremul
BUG=
R=bsalomon@google.com, scroggo@google.com
Review URL: https://codereview.chromium.org/25275004
git-svn-id: http://skia.googlecode.com/svn/trunk@11877 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/image/SkImagePriv.cpp b/src/image/SkImagePriv.cpp
index f707543..eeeb9d8 100644
--- a/src/image/SkImagePriv.cpp
+++ b/src/image/SkImagePriv.cpp
@@ -9,45 +9,16 @@
#include "SkCanvas.h"
#include "SkPicture.h"
-SkBitmap::Config SkImageInfoToBitmapConfig(const SkImage::Info& info,
- bool* isOpaque) {
+SkBitmap::Config SkImageInfoToBitmapConfig(const SkImage::Info& info) {
switch (info.fColorType) {
case SkImage::kAlpha_8_ColorType:
- switch (info.fAlphaType) {
- case kIgnore_SkAlphaType:
- // makes no sense
- return SkBitmap::kNo_Config;
-
- case kOpaque_SkAlphaType:
- *isOpaque = true;
- return SkBitmap::kA8_Config;
-
- case kPremul_SkAlphaType:
- case kUnpremul_SkAlphaType:
- *isOpaque = false;
- return SkBitmap::kA8_Config;
- }
- break;
+ return SkBitmap::kA8_Config;
case SkImage::kRGB_565_ColorType:
- // we ignore fAlpahType, though some would not make sense
- *isOpaque = true;
return SkBitmap::kRGB_565_Config;
case SkImage::kPMColor_ColorType:
- switch (info.fAlphaType) {
- case kIgnore_SkAlphaType:
- case kUnpremul_SkAlphaType:
- // not supported yet
- return SkBitmap::kNo_Config;
- case kOpaque_SkAlphaType:
- *isOpaque = true;
- return SkBitmap::kARGB_8888_Config;
- case kPremul_SkAlphaType:
- *isOpaque = false;
- return SkBitmap::kARGB_8888_Config;
- }
- break;
+ return SkBitmap::kARGB_8888_Config;
default:
// break for unsupported colortypes