Index: tools/sk_tool_utils.cpp |
diff --git a/tools/sk_tool_utils.cpp b/tools/sk_tool_utils.cpp |
index 11973886949baf9542c9baa900bc7ad68bd88858..d13b0d81f8e2561fdd01cf1b0cae5d38a04f7b2f 100644 |
--- a/tools/sk_tool_utils.cpp |
+++ b/tools/sk_tool_utils.cpp |
@@ -2,6 +2,21 @@ |
namespace sk_tool_utils { |
+const char* colortype_name(SkColorType ct) { |
+ switch (ct) { |
+ case kUnknown_SkColorType: return "Unknown"; |
+ case kAlpha_8_SkColorType: return "Alpha_8"; |
+ case kIndex_8_SkColorType: return "Index_8"; |
+ case kARGB_4444_SkColorType: return "ARGB_4444"; |
+ case kRGB_565_SkColorType: return "RGB_565"; |
+ case kRGBA_8888_SkColorType: return "RGBA_8888"; |
+ case kBGRA_8888_SkColorType: return "BGRA_8888"; |
+ default: |
+ SkASSERT(false); |
+ return "unexpected colortype"; |
+ } |
+} |
+ |
void config8888_to_imagetypes(SkCanvas::Config8888 config, SkColorType* ct, SkAlphaType* at) { |
switch (config) { |
case SkCanvas::kNative_Premul_Config8888: |