| 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::RGBX_8888: | 115 case gfx::BufferFormat::RGBX_8888: |
| 116 case gfx::BufferFormat::YUV_420: | 116 case gfx::BufferFormat::YUV_420: |
| 117 case gfx::BufferFormat::YUV_420_BIPLANAR: |
| 117 NOTREACHED(); | 118 NOTREACHED(); |
| 118 return; | 119 return; |
| 119 } | 120 } |
| 120 | 121 |
| 121 NOTREACHED(); | 122 NOTREACHED(); |
| 122 } | 123 } |
| 123 | 124 |
| 124 GLenum InternalFormat(gfx::BufferFormat format) { | 125 GLenum InternalFormat(gfx::BufferFormat format) { |
| 125 switch (format) { | 126 switch (format) { |
| 126 case gfx::BufferFormat::R_8: | 127 case gfx::BufferFormat::R_8: |
| 127 return GL_R8; | 128 return GL_R8; |
| 128 case gfx::BufferFormat::RGBA_4444: | 129 case gfx::BufferFormat::RGBA_4444: |
| 129 case gfx::BufferFormat::RGBA_8888: | 130 case gfx::BufferFormat::RGBA_8888: |
| 130 return GL_RGBA; | 131 return GL_RGBA; |
| 131 case gfx::BufferFormat::BGRA_8888: | 132 case gfx::BufferFormat::BGRA_8888: |
| 132 return GL_BGRA_EXT; | 133 return GL_BGRA_EXT; |
| 133 case gfx::BufferFormat::ATC: | 134 case gfx::BufferFormat::ATC: |
| 134 case gfx::BufferFormat::ATCIA: | 135 case gfx::BufferFormat::ATCIA: |
| 135 case gfx::BufferFormat::DXT1: | 136 case gfx::BufferFormat::DXT1: |
| 136 case gfx::BufferFormat::DXT5: | 137 case gfx::BufferFormat::DXT5: |
| 137 case gfx::BufferFormat::ETC1: | 138 case gfx::BufferFormat::ETC1: |
| 138 case gfx::BufferFormat::RGBX_8888: | 139 case gfx::BufferFormat::RGBX_8888: |
| 139 case gfx::BufferFormat::YUV_420: | 140 case gfx::BufferFormat::YUV_420: |
| 141 case gfx::BufferFormat::YUV_420_BIPLANAR: |
| 140 NOTREACHED(); | 142 NOTREACHED(); |
| 141 return 0; | 143 return 0; |
| 142 } | 144 } |
| 143 | 145 |
| 144 NOTREACHED(); | 146 NOTREACHED(); |
| 145 return 0; | 147 return 0; |
| 146 } | 148 } |
| 147 | 149 |
| 148 } // namespace | 150 } // namespace |
| 149 | 151 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 235 |
| 234 INSTANTIATE_TEST_CASE_P(GpuMemoryBufferTests, | 236 INSTANTIATE_TEST_CASE_P(GpuMemoryBufferTests, |
| 235 GpuMemoryBufferTest, | 237 GpuMemoryBufferTest, |
| 236 ::testing::Values(gfx::BufferFormat::R_8, | 238 ::testing::Values(gfx::BufferFormat::R_8, |
| 237 gfx::BufferFormat::RGBA_4444, | 239 gfx::BufferFormat::RGBA_4444, |
| 238 gfx::BufferFormat::RGBA_8888, | 240 gfx::BufferFormat::RGBA_8888, |
| 239 gfx::BufferFormat::BGRA_8888)); | 241 gfx::BufferFormat::BGRA_8888)); |
| 240 | 242 |
| 241 } // namespace gles2 | 243 } // namespace gles2 |
| 242 } // namespace gpu | 244 } // namespace gpu |
| OLD | NEW |