| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ui/gl/gl_image_io_surface.h" | 5 #include "ui/gl/gl_image_io_surface.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/mac/bind_objc_block.h" | 10 #include "base/mac/bind_objc_block.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 case gfx::BufferFormat::RG_88: | 56 case gfx::BufferFormat::RG_88: |
| 57 case gfx::BufferFormat::ATC: | 57 case gfx::BufferFormat::ATC: |
| 58 case gfx::BufferFormat::ATCIA: | 58 case gfx::BufferFormat::ATCIA: |
| 59 case gfx::BufferFormat::DXT1: | 59 case gfx::BufferFormat::DXT1: |
| 60 case gfx::BufferFormat::DXT5: | 60 case gfx::BufferFormat::DXT5: |
| 61 case gfx::BufferFormat::ETC1: | 61 case gfx::BufferFormat::ETC1: |
| 62 case gfx::BufferFormat::BGR_565: | 62 case gfx::BufferFormat::BGR_565: |
| 63 case gfx::BufferFormat::RGBA_4444: | 63 case gfx::BufferFormat::RGBA_4444: |
| 64 case gfx::BufferFormat::RGBX_8888: | 64 case gfx::BufferFormat::RGBX_8888: |
| 65 case gfx::BufferFormat::YVU_420: | 65 case gfx::BufferFormat::YVU_420: |
| 66 case gfx::BufferFormat::YUYV_422: |
| 66 return false; | 67 return false; |
| 67 } | 68 } |
| 68 | 69 |
| 69 NOTREACHED(); | 70 NOTREACHED(); |
| 70 return false; | 71 return false; |
| 71 } | 72 } |
| 72 | 73 |
| 73 GLenum TextureFormat(gfx::BufferFormat format) { | 74 GLenum TextureFormat(gfx::BufferFormat format) { |
| 74 switch (format) { | 75 switch (format) { |
| 75 case gfx::BufferFormat::R_8: | 76 case gfx::BufferFormat::R_8: |
| (...skipping 10 matching lines...) Expand all Loading... |
| 86 return GL_RGB_YCBCR_420V_CHROMIUM; | 87 return GL_RGB_YCBCR_420V_CHROMIUM; |
| 87 case gfx::BufferFormat::ATC: | 88 case gfx::BufferFormat::ATC: |
| 88 case gfx::BufferFormat::ATCIA: | 89 case gfx::BufferFormat::ATCIA: |
| 89 case gfx::BufferFormat::DXT1: | 90 case gfx::BufferFormat::DXT1: |
| 90 case gfx::BufferFormat::DXT5: | 91 case gfx::BufferFormat::DXT5: |
| 91 case gfx::BufferFormat::ETC1: | 92 case gfx::BufferFormat::ETC1: |
| 92 case gfx::BufferFormat::BGR_565: | 93 case gfx::BufferFormat::BGR_565: |
| 93 case gfx::BufferFormat::RGBA_4444: | 94 case gfx::BufferFormat::RGBA_4444: |
| 94 case gfx::BufferFormat::RGBX_8888: | 95 case gfx::BufferFormat::RGBX_8888: |
| 95 case gfx::BufferFormat::YVU_420: | 96 case gfx::BufferFormat::YVU_420: |
| 97 case gfx::BufferFormat::YUYV_422: |
| 96 NOTREACHED(); | 98 NOTREACHED(); |
| 97 return 0; | 99 return 0; |
| 98 } | 100 } |
| 99 | 101 |
| 100 NOTREACHED(); | 102 NOTREACHED(); |
| 101 return 0; | 103 return 0; |
| 102 } | 104 } |
| 103 | 105 |
| 104 GLenum DataFormat(gfx::BufferFormat format) { | 106 GLenum DataFormat(gfx::BufferFormat format) { |
| 105 switch (format) { | 107 switch (format) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 116 case gfx::BufferFormat::ATC: | 118 case gfx::BufferFormat::ATC: |
| 117 case gfx::BufferFormat::ATCIA: | 119 case gfx::BufferFormat::ATCIA: |
| 118 case gfx::BufferFormat::DXT1: | 120 case gfx::BufferFormat::DXT1: |
| 119 case gfx::BufferFormat::DXT5: | 121 case gfx::BufferFormat::DXT5: |
| 120 case gfx::BufferFormat::ETC1: | 122 case gfx::BufferFormat::ETC1: |
| 121 case gfx::BufferFormat::BGR_565: | 123 case gfx::BufferFormat::BGR_565: |
| 122 case gfx::BufferFormat::RGBA_4444: | 124 case gfx::BufferFormat::RGBA_4444: |
| 123 case gfx::BufferFormat::RGBX_8888: | 125 case gfx::BufferFormat::RGBX_8888: |
| 124 case gfx::BufferFormat::YVU_420: | 126 case gfx::BufferFormat::YVU_420: |
| 125 case gfx::BufferFormat::YUV_420_BIPLANAR: | 127 case gfx::BufferFormat::YUV_420_BIPLANAR: |
| 128 case gfx::BufferFormat::YUYV_422: |
| 126 NOTREACHED(); | 129 NOTREACHED(); |
| 127 return 0; | 130 return 0; |
| 128 } | 131 } |
| 129 | 132 |
| 130 NOTREACHED(); | 133 NOTREACHED(); |
| 131 return 0; | 134 return 0; |
| 132 } | 135 } |
| 133 | 136 |
| 134 GLenum DataType(gfx::BufferFormat format) { | 137 GLenum DataType(gfx::BufferFormat format) { |
| 135 switch (format) { | 138 switch (format) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 146 case gfx::BufferFormat::ATC: | 149 case gfx::BufferFormat::ATC: |
| 147 case gfx::BufferFormat::ATCIA: | 150 case gfx::BufferFormat::ATCIA: |
| 148 case gfx::BufferFormat::DXT1: | 151 case gfx::BufferFormat::DXT1: |
| 149 case gfx::BufferFormat::DXT5: | 152 case gfx::BufferFormat::DXT5: |
| 150 case gfx::BufferFormat::ETC1: | 153 case gfx::BufferFormat::ETC1: |
| 151 case gfx::BufferFormat::BGR_565: | 154 case gfx::BufferFormat::BGR_565: |
| 152 case gfx::BufferFormat::RGBA_4444: | 155 case gfx::BufferFormat::RGBA_4444: |
| 153 case gfx::BufferFormat::RGBX_8888: | 156 case gfx::BufferFormat::RGBX_8888: |
| 154 case gfx::BufferFormat::YVU_420: | 157 case gfx::BufferFormat::YVU_420: |
| 155 case gfx::BufferFormat::YUV_420_BIPLANAR: | 158 case gfx::BufferFormat::YUV_420_BIPLANAR: |
| 159 case gfx::BufferFormat::YUYV_422: |
| 156 NOTREACHED(); | 160 NOTREACHED(); |
| 157 return 0; | 161 return 0; |
| 158 } | 162 } |
| 159 | 163 |
| 160 NOTREACHED(); | 164 NOTREACHED(); |
| 161 return 0; | 165 return 0; |
| 162 } | 166 } |
| 163 | 167 |
| 164 // When an IOSurface is bound to a texture with internalformat "GL_RGB", many | 168 // When an IOSurface is bound to a texture with internalformat "GL_RGB", many |
| 165 // OpenGL operations are broken. Therefore, never allow an IOSurface to be bound | 169 // OpenGL operations are broken. Therefore, never allow an IOSurface to be bound |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 } | 399 } |
| 396 | 400 |
| 397 // static | 401 // static |
| 398 GLImageIOSurface* GLImageIOSurface::FromGLImage(GLImage* image) { | 402 GLImageIOSurface* GLImageIOSurface::FromGLImage(GLImage* image) { |
| 399 if (!image || image->GetType() != Type::IOSURFACE) | 403 if (!image || image->GetType() != Type::IOSURFACE) |
| 400 return nullptr; | 404 return nullptr; |
| 401 return static_cast<GLImageIOSurface*>(image); | 405 return static_cast<GLImageIOSurface*>(image); |
| 402 } | 406 } |
| 403 | 407 |
| 404 } // namespace gl | 408 } // namespace gl |
| OLD | NEW |