Chromium Code Reviews| Index: cc/resources/resource_format.cc |
| diff --git a/cc/resources/resource_format.cc b/cc/resources/resource_format.cc |
| index ec553d8acbc9b062795f1880f11dffca620dc862..b419277f005596a4a3c5d3f33123177eedffc35c 100644 |
| --- a/cc/resources/resource_format.cc |
| +++ b/cc/resources/resource_format.cc |
| @@ -29,6 +29,29 @@ SkColorType ResourceFormatToSkColorType(ResourceFormat format) { |
| return kN32_SkColorType; |
| } |
| +SkColorType ResourceFormatToClosestSkColorType(ResourceFormat format) { |
|
vmpstr
2016/03/28 23:55:52
The only difference between this function and the
ericrk
2016/03/29 23:11:29
I think we can just drop the above one and use thi
|
| + // Use kN32_SkColorType if there is no corresponding SkColorType. |
| + switch (format) { |
| + case RGBA_4444: |
| + return kARGB_4444_SkColorType; |
| + case RGBA_8888: |
| + case BGRA_8888: |
| + return kN32_SkColorType; |
| + case ALPHA_8: |
| + return kAlpha_8_SkColorType; |
| + case RGB_565: |
| + return kRGB_565_SkColorType; |
| + case LUMINANCE_8: |
| + return kGray_8_SkColorType; |
| + case ETC1: |
| + case RED_8: |
| + case LUMINANCE_F16: |
| + return kN32_SkColorType; |
| + } |
| + NOTREACHED(); |
| + return kN32_SkColorType; |
| +} |
| + |
| int BitsPerPixel(ResourceFormat format) { |
| switch (format) { |
| case BGRA_8888: |