OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/gl/gl_utils.h" |
| 6 |
| 7 #include "ui/gl/gl_bindings.h" |
| 8 |
| 9 namespace gl { |
| 10 |
| 11 GLenum GetTextureFormatFrom(gfx::BufferFormat format) { |
| 12 switch (format) { |
| 13 case gfx::BufferFormat::ATC: |
| 14 return GL_ATC_RGB_AMD; |
| 15 case gfx::BufferFormat::ATCIA: |
| 16 return GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD; |
| 17 case gfx::BufferFormat::DXT1: |
| 18 return GL_COMPRESSED_RGB_S3TC_DXT1_EXT; |
| 19 case gfx::BufferFormat::DXT5: |
| 20 return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; |
| 21 case gfx::BufferFormat::ETC1: |
| 22 return GL_ETC1_RGB8_OES; |
| 23 case gfx::BufferFormat::R_8: |
| 24 return GL_RED; |
| 25 case gfx::BufferFormat::RGBA_4444: |
| 26 case gfx::BufferFormat::RGBA_8888: |
| 27 return GL_RGBA; |
| 28 case gfx::BufferFormat::BGRA_8888: |
| 29 return GL_BGRA_EXT; |
| 30 case gfx::BufferFormat::RGBX_8888: |
| 31 case gfx::BufferFormat::BGRX_8888: |
| 32 return GL_RGB; |
| 33 case gfx::BufferFormat::YUV_420: |
| 34 case gfx::BufferFormat::YUV_420_BIPLANAR: |
| 35 case gfx::BufferFormat::UYVY_422: |
| 36 NOTREACHED(); |
| 37 return 0; |
| 38 } |
| 39 |
| 40 NOTREACHED(); |
| 41 return 0; |
| 42 } |
| 43 |
| 44 } // namespace ui |
OLD | NEW |