diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-11-12 16:11:07 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-11-12 16:11:07 +0000 |
commit | 23be7a58d9d69ae0a06788c2d798f2f92baea29c (patch) | |
tree | 949787e19fd52b86d2d447e963f1ecd0ea1c1abd /src/image | |
parent | 5401cd019b5a355bdc20f0846e50a641f45e03c2 (diff) |
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
Diffstat (limited to 'src/image')
-rw-r--r-- | src/image/SkImagePriv.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/image/SkImagePriv.cpp b/src/image/SkImagePriv.cpp index a79f8dba65..0eb6478083 100644 --- a/src/image/SkImagePriv.cpp +++ b/src/image/SkImagePriv.cpp @@ -20,6 +20,9 @@ SkBitmap::Config SkImageInfoToBitmapConfig(const SkImageInfo& info) { 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 @@ int SkImageBytesPerPixel(SkColorType ct) { 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 @@ bool SkBitmapToImageInfo(const SkBitmap& bm, SkImageInfo* info) { 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; |