| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 static_assert(arraysize(format_gl_data_format) == (RESOURCE_FORMAT_MAX + 1), | 80 static_assert(arraysize(format_gl_data_format) == (RESOURCE_FORMAT_MAX + 1), |
| 81 "format_gl_data_format does not handle all cases."); | 81 "format_gl_data_format does not handle all cases."); |
| 82 | 82 |
| 83 return format_gl_data_format[format]; | 83 return format_gl_data_format[format]; |
| 84 } | 84 } |
| 85 | 85 |
| 86 GLenum GLInternalFormat(ResourceFormat format) { | 86 GLenum GLInternalFormat(ResourceFormat format) { |
| 87 return GLDataFormat(format); | 87 return GLDataFormat(format); |
| 88 } | 88 } |
| 89 | 89 |
| 90 gfx::BufferFormat BufferFormat(ResourceFormat format) { | |
| 91 switch (format) { | |
| 92 case RGBA_8888: | |
| 93 return gfx::BufferFormat::RGBA_8888; | |
| 94 case BGRA_8888: | |
| 95 return gfx::BufferFormat::BGRA_8888; | |
| 96 case RGBA_4444: | |
| 97 return gfx::BufferFormat::RGBA_4444; | |
| 98 case ALPHA_8: | |
| 99 case LUMINANCE_8: | |
| 100 case RGB_565: | |
| 101 case ETC1: | |
| 102 case RED_8: | |
| 103 break; | |
| 104 } | |
| 105 NOTREACHED(); | |
| 106 return gfx::BufferFormat::RGBA_8888; | |
| 107 } | |
| 108 | |
| 109 } // namespace cc | 90 } // namespace cc |
| OLD | NEW |