| 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 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 buffer[i + 3] = pixel[3]; | 107 buffer[i + 3] = pixel[3]; |
| 108 } | 108 } |
| 109 return; | 109 return; |
| 110 case gfx::BufferFormat::ATC: | 110 case gfx::BufferFormat::ATC: |
| 111 case gfx::BufferFormat::ATCIA: | 111 case gfx::BufferFormat::ATCIA: |
| 112 case gfx::BufferFormat::DXT1: | 112 case gfx::BufferFormat::DXT1: |
| 113 case gfx::BufferFormat::DXT5: | 113 case gfx::BufferFormat::DXT5: |
| 114 case gfx::BufferFormat::ETC1: | 114 case gfx::BufferFormat::ETC1: |
| 115 case gfx::BufferFormat::BGRX_8888: | 115 case gfx::BufferFormat::BGRX_8888: |
| 116 case gfx::BufferFormat::YUV_420: | 116 case gfx::BufferFormat::YUV_420: |
| 117 case gfx::BufferFormat::YUV_420_BIPLANAR: |
| 117 case gfx::BufferFormat::UYVY_422: | 118 case gfx::BufferFormat::UYVY_422: |
| 118 NOTREACHED(); | 119 NOTREACHED(); |
| 119 return; | 120 return; |
| 120 } | 121 } |
| 121 | 122 |
| 122 NOTREACHED(); | 123 NOTREACHED(); |
| 123 } | 124 } |
| 124 | 125 |
| 125 GLenum InternalFormat(gfx::BufferFormat format) { | 126 GLenum InternalFormat(gfx::BufferFormat format) { |
| 126 switch (format) { | 127 switch (format) { |
| 127 case gfx::BufferFormat::R_8: | 128 case gfx::BufferFormat::R_8: |
| 128 return GL_R8; | 129 return GL_R8; |
| 129 case gfx::BufferFormat::RGBA_4444: | 130 case gfx::BufferFormat::RGBA_4444: |
| 130 case gfx::BufferFormat::RGBA_8888: | 131 case gfx::BufferFormat::RGBA_8888: |
| 131 return GL_RGBA; | 132 return GL_RGBA; |
| 132 case gfx::BufferFormat::BGRA_8888: | 133 case gfx::BufferFormat::BGRA_8888: |
| 133 return GL_BGRA_EXT; | 134 return GL_BGRA_EXT; |
| 134 case gfx::BufferFormat::ATC: | 135 case gfx::BufferFormat::ATC: |
| 135 case gfx::BufferFormat::ATCIA: | 136 case gfx::BufferFormat::ATCIA: |
| 136 case gfx::BufferFormat::DXT1: | 137 case gfx::BufferFormat::DXT1: |
| 137 case gfx::BufferFormat::DXT5: | 138 case gfx::BufferFormat::DXT5: |
| 138 case gfx::BufferFormat::ETC1: | 139 case gfx::BufferFormat::ETC1: |
| 139 case gfx::BufferFormat::BGRX_8888: | 140 case gfx::BufferFormat::BGRX_8888: |
| 140 case gfx::BufferFormat::YUV_420: | 141 case gfx::BufferFormat::YUV_420: |
| 142 case gfx::BufferFormat::YUV_420_BIPLANAR: |
| 141 case gfx::BufferFormat::UYVY_422: | 143 case gfx::BufferFormat::UYVY_422: |
| 142 NOTREACHED(); | 144 NOTREACHED(); |
| 143 return 0; | 145 return 0; |
| 144 } | 146 } |
| 145 | 147 |
| 146 NOTREACHED(); | 148 NOTREACHED(); |
| 147 return 0; | 149 return 0; |
| 148 } | 150 } |
| 149 | 151 |
| 150 } // namespace | 152 } // namespace |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 237 |
| 236 INSTANTIATE_TEST_CASE_P(GpuMemoryBufferTests, | 238 INSTANTIATE_TEST_CASE_P(GpuMemoryBufferTests, |
| 237 GpuMemoryBufferTest, | 239 GpuMemoryBufferTest, |
| 238 ::testing::Values(gfx::BufferFormat::R_8, | 240 ::testing::Values(gfx::BufferFormat::R_8, |
| 239 gfx::BufferFormat::RGBA_4444, | 241 gfx::BufferFormat::RGBA_4444, |
| 240 gfx::BufferFormat::RGBA_8888, | 242 gfx::BufferFormat::RGBA_8888, |
| 241 gfx::BufferFormat::BGRA_8888)); | 243 gfx::BufferFormat::BGRA_8888)); |
| 242 | 244 |
| 243 } // namespace gles2 | 245 } // namespace gles2 |
| 244 } // namespace gpu | 246 } // namespace gpu |
| OLD | NEW |