| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef CodecBenchPriv_DEFINED | 8 #ifndef CodecBenchPriv_DEFINED |
| 9 #define CodecBenchPriv_DEFINED | 9 #define CodecBenchPriv_DEFINED |
| 10 | 10 |
| 11 #include "SkImageInfo.h" | 11 #include "SkImageInfo.h" |
| 12 | 12 |
| 13 inline const char* color_type_to_str(SkColorType colorType) { | 13 inline const char* color_type_to_str(SkColorType colorType) { |
| 14 switch (colorType) { | 14 switch (colorType) { |
| 15 case kN32_SkColorType: | 15 case kN32_SkColorType: |
| 16 return "N32"; | 16 return "N32"; |
| 17 case kRGB_565_SkColorType: | 17 case kRGB_565_SkColorType: |
| 18 return "565"; | 18 return "565"; |
| 19 case kGray_8_SkColorType: | 19 case kGray_8_SkColorType: |
| 20 return "Gray8"; | 20 return "Gray8"; |
| 21 case kIndex_8_SkColorType: | 21 case kIndex_8_SkColorType: |
| 22 return "Index8"; | 22 return "Index8"; |
| 23 case kAlpha_8_SkColorType: | 23 case kAlpha_8_SkColorType: |
| 24 return "Alpha8"; | 24 return "Alpha8"; |
| 25 default: | 25 default: |
| 26 return "Unknown"; | 26 return "Unknown"; |
| 27 } | 27 } |
| 28 } | 28 } |
| 29 | 29 |
| 30 inline const char* alpha_type_to_str(SkAlphaType alphaType) { |
| 31 switch (alphaType) { |
| 32 case kOpaque_SkAlphaType: |
| 33 return ""; |
| 34 case kPremul_SkAlphaType: |
| 35 return "Premul"; |
| 36 case kUnpremul_SkAlphaType: |
| 37 return "Unpremul"; |
| 38 default: |
| 39 SkASSERT(false); |
| 40 return "Unknown"; |
| 41 } |
| 42 } |
| 43 |
| 30 #endif // CodecBenchPriv_DEFINED | 44 #endif // CodecBenchPriv_DEFINED |
| OLD | NEW |