add colortable enum to SkImage to ease interop between it and SkBitmap::Config
BUG=
R=halcanary@google.com, scroggo@google.com
Review URL: https://codereview.chromium.org/68853003
git-svn-id: http://skia.googlecode.com/svn/trunk@12245 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/image/SkImagePriv.cpp b/src/image/SkImagePriv.cpp
index a79f8db..0eb6478 100644
--- a/src/image/SkImagePriv.cpp
+++ b/src/image/SkImagePriv.cpp
@@ -20,6 +20,9 @@
case kPMColor_SkColorType:
return SkBitmap::kARGB_8888_Config;
+ case kIndex8_SkColorType:
+ return SkBitmap::kIndex8_Config;
+
default:
// break for unsupported colortypes
break;
@@ -34,6 +37,7 @@
4, // kRGBA_8888_SkColorType
4, // kBGRA_8888_SkColorType
4, // kPMColor_SkColorType
+ 1, // kIndex8_SkColorType
};
SkASSERT((size_t)ct < SK_ARRAY_COUNT(gColorTypeBytesPerPixel));
@@ -45,7 +49,11 @@
case SkBitmap::kA8_Config:
info->fColorType = kAlpha_8_SkColorType;
break;
-
+
+ case SkBitmap::kIndex8_Config:
+ info->fColorType = kIndex8_SkColorType;
+ break;
+
case SkBitmap::kRGB_565_Config:
info->fColorType = kRGB_565_SkColorType;
break;