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