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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 buffer[i + 2] = pixel[0]; | 115 buffer[i + 2] = pixel[0]; |
116 buffer[i + 3] = pixel[3]; | 116 buffer[i + 3] = pixel[3]; |
117 } | 117 } |
118 return; | 118 return; |
119 case gfx::BufferFormat::ATC: | 119 case gfx::BufferFormat::ATC: |
120 case gfx::BufferFormat::ATCIA: | 120 case gfx::BufferFormat::ATCIA: |
121 case gfx::BufferFormat::BGRX_8888: | 121 case gfx::BufferFormat::BGRX_8888: |
122 case gfx::BufferFormat::DXT1: | 122 case gfx::BufferFormat::DXT1: |
123 case gfx::BufferFormat::DXT5: | 123 case gfx::BufferFormat::DXT5: |
124 case gfx::BufferFormat::ETC1: | 124 case gfx::BufferFormat::ETC1: |
| 125 case gfx::BufferFormat::RG_88: |
125 case gfx::BufferFormat::RGBX_8888: | 126 case gfx::BufferFormat::RGBX_8888: |
126 case gfx::BufferFormat::UYVY_422: | 127 case gfx::BufferFormat::UYVY_422: |
127 case gfx::BufferFormat::YVU_420: | 128 case gfx::BufferFormat::YVU_420: |
128 case gfx::BufferFormat::YUV_420_BIPLANAR: | 129 case gfx::BufferFormat::YUV_420_BIPLANAR: |
129 NOTREACHED(); | 130 NOTREACHED(); |
130 return; | 131 return; |
131 } | 132 } |
132 | 133 |
133 NOTREACHED(); | 134 NOTREACHED(); |
134 } | 135 } |
135 | 136 |
136 GLenum InternalFormat(gfx::BufferFormat format) { | 137 GLenum InternalFormat(gfx::BufferFormat format) { |
137 switch (format) { | 138 switch (format) { |
138 case gfx::BufferFormat::R_8: | 139 case gfx::BufferFormat::R_8: |
139 return GL_RED; | 140 return GL_RED; |
| 141 case gfx::BufferFormat::RG_88: |
| 142 return GL_RG; |
140 case gfx::BufferFormat::BGR_565: | 143 case gfx::BufferFormat::BGR_565: |
141 return GL_RGB; | 144 return GL_RGB; |
142 case gfx::BufferFormat::RGBA_4444: | 145 case gfx::BufferFormat::RGBA_4444: |
143 case gfx::BufferFormat::RGBA_8888: | 146 case gfx::BufferFormat::RGBA_8888: |
144 return GL_RGBA; | 147 return GL_RGBA; |
145 case gfx::BufferFormat::BGRA_8888: | 148 case gfx::BufferFormat::BGRA_8888: |
146 return GL_BGRA_EXT; | 149 return GL_BGRA_EXT; |
147 case gfx::BufferFormat::ATC: | 150 case gfx::BufferFormat::ATC: |
148 case gfx::BufferFormat::ATCIA: | 151 case gfx::BufferFormat::ATCIA: |
149 case gfx::BufferFormat::BGRX_8888: | 152 case gfx::BufferFormat::BGRX_8888: |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 INSTANTIATE_TEST_CASE_P(GpuMemoryBufferTests, | 252 INSTANTIATE_TEST_CASE_P(GpuMemoryBufferTests, |
250 GpuMemoryBufferTest, | 253 GpuMemoryBufferTest, |
251 ::testing::Values(gfx::BufferFormat::R_8, | 254 ::testing::Values(gfx::BufferFormat::R_8, |
252 gfx::BufferFormat::BGR_565, | 255 gfx::BufferFormat::BGR_565, |
253 gfx::BufferFormat::RGBA_4444, | 256 gfx::BufferFormat::RGBA_4444, |
254 gfx::BufferFormat::RGBA_8888, | 257 gfx::BufferFormat::RGBA_8888, |
255 gfx::BufferFormat::BGRA_8888)); | 258 gfx::BufferFormat::BGRA_8888)); |
256 | 259 |
257 } // namespace gles2 | 260 } // namespace gles2 |
258 } // namespace gpu | 261 } // namespace gpu |
OLD | NEW |