OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <GLES2/gl2.h> | 5 #include <GLES2/gl2.h> |
6 #include <GLES2/gl2chromium.h> | 6 #include <GLES2/gl2chromium.h> |
7 #include <GLES2/gl2ext.h> | 7 #include <GLES2/gl2ext.h> |
8 #include <GLES2/gl2extchromium.h> | 8 #include <GLES2/gl2extchromium.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 half_float_buffer[i + 3] = half_float_pixel[3]; | 132 half_float_buffer[i + 3] = half_float_pixel[3]; |
133 } | 133 } |
134 return; | 134 return; |
135 } | 135 } |
136 case gfx::BufferFormat::ATC: | 136 case gfx::BufferFormat::ATC: |
137 case gfx::BufferFormat::ATCIA: | 137 case gfx::BufferFormat::ATCIA: |
138 case gfx::BufferFormat::BGRX_8888: | 138 case gfx::BufferFormat::BGRX_8888: |
139 case gfx::BufferFormat::DXT1: | 139 case gfx::BufferFormat::DXT1: |
140 case gfx::BufferFormat::DXT5: | 140 case gfx::BufferFormat::DXT5: |
141 case gfx::BufferFormat::ETC1: | 141 case gfx::BufferFormat::ETC1: |
| 142 case gfx::BufferFormat::R_16: |
142 case gfx::BufferFormat::RG_88: | 143 case gfx::BufferFormat::RG_88: |
143 case gfx::BufferFormat::RGBX_8888: | 144 case gfx::BufferFormat::RGBX_8888: |
144 case gfx::BufferFormat::UYVY_422: | 145 case gfx::BufferFormat::UYVY_422: |
145 case gfx::BufferFormat::YVU_420: | 146 case gfx::BufferFormat::YVU_420: |
146 case gfx::BufferFormat::YUV_420_BIPLANAR: | 147 case gfx::BufferFormat::YUV_420_BIPLANAR: |
147 NOTREACHED(); | 148 NOTREACHED(); |
148 return; | 149 return; |
149 } | 150 } |
150 | 151 |
151 NOTREACHED(); | 152 NOTREACHED(); |
152 } | 153 } |
153 | 154 |
154 GLenum InternalFormat(gfx::BufferFormat format) { | 155 GLenum InternalFormat(gfx::BufferFormat format) { |
155 switch (format) { | 156 switch (format) { |
156 case gfx::BufferFormat::R_8: | 157 case gfx::BufferFormat::R_8: |
157 return GL_RED; | 158 return GL_RED; |
| 159 case gfx::BufferFormat::R_16: |
| 160 return GL_R16_EXT; |
158 case gfx::BufferFormat::RG_88: | 161 case gfx::BufferFormat::RG_88: |
159 return GL_RG; | 162 return GL_RG; |
160 case gfx::BufferFormat::BGR_565: | 163 case gfx::BufferFormat::BGR_565: |
161 return GL_RGB; | 164 return GL_RGB; |
162 case gfx::BufferFormat::RGBA_4444: | 165 case gfx::BufferFormat::RGBA_4444: |
163 case gfx::BufferFormat::RGBA_8888: | 166 case gfx::BufferFormat::RGBA_8888: |
164 return GL_RGBA; | 167 return GL_RGBA; |
165 case gfx::BufferFormat::BGRA_8888: | 168 case gfx::BufferFormat::BGRA_8888: |
166 return GL_BGRA_EXT; | 169 return GL_BGRA_EXT; |
167 case gfx::BufferFormat::RGBA_F16: | 170 case gfx::BufferFormat::RGBA_F16: |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 GpuMemoryBufferTest, | 275 GpuMemoryBufferTest, |
273 ::testing::Values(gfx::BufferFormat::R_8, | 276 ::testing::Values(gfx::BufferFormat::R_8, |
274 gfx::BufferFormat::BGR_565, | 277 gfx::BufferFormat::BGR_565, |
275 gfx::BufferFormat::RGBA_4444, | 278 gfx::BufferFormat::RGBA_4444, |
276 gfx::BufferFormat::RGBA_8888, | 279 gfx::BufferFormat::RGBA_8888, |
277 gfx::BufferFormat::BGRA_8888, | 280 gfx::BufferFormat::BGRA_8888, |
278 gfx::BufferFormat::RGBA_F16)); | 281 gfx::BufferFormat::RGBA_F16)); |
279 | 282 |
280 } // namespace gles2 | 283 } // namespace gles2 |
281 } // namespace gpu | 284 } // namespace gpu |
OLD | NEW |