OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/resources/resource_format_utils.h" | 5 #include "cc/resources/resource_format_utils.h" |
6 | 6 |
7 namespace cc { | 7 namespace cc { |
8 | 8 |
9 SkColorType ResourceFormatToClosestSkColorType(ResourceFormat format) { | 9 SkColorType ResourceFormatToClosestSkColorType(ResourceFormat format) { |
10 // Use kN32_SkColorType if there is no corresponding SkColorType. | 10 // Use kN32_SkColorType if there is no corresponding SkColorType. |
11 switch (format) { | 11 switch (format) { |
12 case RGBA_4444: | 12 case RGBA_4444: |
13 return kARGB_4444_SkColorType; | 13 return kARGB_4444_SkColorType; |
14 case RGBA_8888: | 14 case RGBA_8888: |
15 case BGRA_8888: | 15 case BGRA_8888: |
16 return kN32_SkColorType; | 16 return kN32_SkColorType; |
17 case ALPHA_8: | 17 case ALPHA_8: |
18 return kAlpha_8_SkColorType; | 18 return kAlpha_8_SkColorType; |
19 case RGB_565: | 19 case RGB_565: |
20 return kRGB_565_SkColorType; | 20 return kRGB_565_SkColorType; |
21 case LUMINANCE_8: | 21 case LUMINANCE_8: |
22 return kGray_8_SkColorType; | 22 return kGray_8_SkColorType; |
23 case ETC1: | 23 case ETC1: |
24 case RED_8: | 24 case RED_8: |
| 25 case RG_88: |
25 case LUMINANCE_F16: | 26 case LUMINANCE_F16: |
26 return kN32_SkColorType; | 27 return kN32_SkColorType; |
27 } | 28 } |
28 NOTREACHED(); | 29 NOTREACHED(); |
29 return kN32_SkColorType; | 30 return kN32_SkColorType; |
30 } | 31 } |
31 | 32 |
32 } // namespace cc | 33 } // namespace cc |
OLD | NEW |