Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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.h" | 5 #include "cc/resources/resource_format.h" |
| 6 | 6 |
| 7 #include "third_party/khronos/GLES2/gl2.h" | 7 #include "third_party/khronos/GLES2/gl2.h" |
| 8 #include "third_party/khronos/GLES2/gl2ext.h" | 8 #include "third_party/khronos/GLES2/gl2ext.h" |
| 9 | 9 |
| 10 namespace cc { | 10 namespace cc { |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 case RGB_565: | 22 case RGB_565: |
| 23 case RED_8: | 23 case RED_8: |
| 24 case LUMINANCE_F16: | 24 case LUMINANCE_F16: |
| 25 NOTREACHED(); | 25 NOTREACHED(); |
| 26 break; | 26 break; |
| 27 } | 27 } |
| 28 NOTREACHED(); | 28 NOTREACHED(); |
| 29 return kN32_SkColorType; | 29 return kN32_SkColorType; |
| 30 } | 30 } |
| 31 | 31 |
| 32 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
| |
| 33 // Use kN32_SkColorType if there is no corresponding SkColorType. | |
| 34 switch (format) { | |
| 35 case RGBA_4444: | |
| 36 return kARGB_4444_SkColorType; | |
| 37 case RGBA_8888: | |
| 38 case BGRA_8888: | |
| 39 return kN32_SkColorType; | |
| 40 case ALPHA_8: | |
| 41 return kAlpha_8_SkColorType; | |
| 42 case RGB_565: | |
| 43 return kRGB_565_SkColorType; | |
| 44 case LUMINANCE_8: | |
| 45 return kGray_8_SkColorType; | |
| 46 case ETC1: | |
| 47 case RED_8: | |
| 48 case LUMINANCE_F16: | |
| 49 return kN32_SkColorType; | |
| 50 } | |
| 51 NOTREACHED(); | |
| 52 return kN32_SkColorType; | |
| 53 } | |
| 54 | |
| 32 int BitsPerPixel(ResourceFormat format) { | 55 int BitsPerPixel(ResourceFormat format) { |
| 33 switch (format) { | 56 switch (format) { |
| 34 case BGRA_8888: | 57 case BGRA_8888: |
| 35 case RGBA_8888: | 58 case RGBA_8888: |
| 36 return 32; | 59 return 32; |
| 37 case RGBA_4444: | 60 case RGBA_4444: |
| 38 case RGB_565: | 61 case RGB_565: |
| 39 case LUMINANCE_F16: | 62 case LUMINANCE_F16: |
| 40 return 16; | 63 return 16; |
| 41 case ALPHA_8: | 64 case ALPHA_8: |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 129 case ETC1: | 152 case ETC1: |
| 130 case RED_8: | 153 case RED_8: |
| 131 case LUMINANCE_F16: | 154 case LUMINANCE_F16: |
| 132 return false; | 155 return false; |
| 133 } | 156 } |
| 134 NOTREACHED(); | 157 NOTREACHED(); |
| 135 return false; | 158 return false; |
| 136 } | 159 } |
| 137 | 160 |
| 138 } // namespace cc | 161 } // namespace cc |
| OLD | NEW |