Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(846)

Unified Diff: src/image/SkImagePriv.cpp

Issue 68853003: add colortable enum to SkImage to ease interop between it and SkBitmap::Config (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkImage.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImagePriv.cpp
diff --git a/src/image/SkImagePriv.cpp b/src/image/SkImagePriv.cpp
index a79f8dba651c12be66c7a58acb4ef4f50729ebb8..0eb6478083c1fd3cf594a32ad6d6c46c2b1072db 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;
« no previous file with comments | « include/core/SkImage.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698