OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "cc/resources/resource_format_utils.h" |
| 6 |
| 7 namespace cc { |
| 8 |
| 9 SkColorType ResourceFormatToClosestSkColorType(ResourceFormat format) { |
| 10 // Use kN32_SkColorType if there is no corresponding SkColorType. |
| 11 switch (format) { |
| 12 case RGBA_4444: |
| 13 return kARGB_4444_SkColorType; |
| 14 case RGBA_8888: |
| 15 case BGRA_8888: |
| 16 return kN32_SkColorType; |
| 17 case ALPHA_8: |
| 18 return kAlpha_8_SkColorType; |
| 19 case RGB_565: |
| 20 return kRGB_565_SkColorType; |
| 21 case LUMINANCE_8: |
| 22 return kGray_8_SkColorType; |
| 23 case ETC1: |
| 24 case RED_8: |
| 25 case LUMINANCE_F16: |
| 26 return kN32_SkColorType; |
| 27 } |
| 28 NOTREACHED(); |
| 29 return kN32_SkColorType; |
| 30 } |
| 31 |
| 32 } // namespace cc |
OLD | NEW |