| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "gpu/command_buffer/common/gpu_memory_buffer_support.h" | 5 #include "gpu/command_buffer/common/gpu_memory_buffer_support.h" |
| 6 | 6 |
| 7 #include <GLES2/gl2.h> | 7 #include <GLES2/gl2.h> |
| 8 #include <GLES2/gl2extchromium.h> | 8 #include <GLES2/gl2extchromium.h> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 return capabilities.texture_rg; | 107 return capabilities.texture_rg; |
| 108 case gfx::BufferFormat::UYVY_422: | 108 case gfx::BufferFormat::UYVY_422: |
| 109 return capabilities.image_ycbcr_422; | 109 return capabilities.image_ycbcr_422; |
| 110 case gfx::BufferFormat::BGR_565: | 110 case gfx::BufferFormat::BGR_565: |
| 111 case gfx::BufferFormat::RGBA_4444: | 111 case gfx::BufferFormat::RGBA_4444: |
| 112 case gfx::BufferFormat::RGBA_8888: | 112 case gfx::BufferFormat::RGBA_8888: |
| 113 case gfx::BufferFormat::RGBX_8888: | 113 case gfx::BufferFormat::RGBX_8888: |
| 114 case gfx::BufferFormat::YVU_420: | 114 case gfx::BufferFormat::YVU_420: |
| 115 return true; | 115 return true; |
| 116 case gfx::BufferFormat::YUV_420_BIPLANAR: | 116 case gfx::BufferFormat::YUV_420_BIPLANAR: |
| 117 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) |
| 118 // TODO(dcastagna): Determine ycbcr_420v_image on CrOS at runtime |
| 119 // querying minigbm. crbug.com/646148 |
| 120 return true; |
| 121 #else |
| 117 return capabilities.image_ycbcr_420v; | 122 return capabilities.image_ycbcr_420v; |
| 123 #endif |
| 118 } | 124 } |
| 119 | 125 |
| 120 NOTREACHED(); | 126 NOTREACHED(); |
| 121 return false; | 127 return false; |
| 122 } | 128 } |
| 123 | 129 |
| 124 bool IsImageSizeValidForGpuMemoryBufferFormat(const gfx::Size& size, | 130 bool IsImageSizeValidForGpuMemoryBufferFormat(const gfx::Size& size, |
| 125 gfx::BufferFormat format) { | 131 gfx::BufferFormat format) { |
| 126 switch (format) { | 132 switch (format) { |
| 127 case gfx::BufferFormat::ATC: | 133 case gfx::BufferFormat::ATC: |
| (...skipping 18 matching lines...) Expand all Loading... |
| 146 return size.width() % 2 == 0 && size.height() % 2 == 0; | 152 return size.width() % 2 == 0 && size.height() % 2 == 0; |
| 147 case gfx::BufferFormat::UYVY_422: | 153 case gfx::BufferFormat::UYVY_422: |
| 148 return size.width() % 2 == 0; | 154 return size.width() % 2 == 0; |
| 149 } | 155 } |
| 150 | 156 |
| 151 NOTREACHED(); | 157 NOTREACHED(); |
| 152 return false; | 158 return false; |
| 153 } | 159 } |
| 154 | 160 |
| 155 } // namespace gpu | 161 } // namespace gpu |
| OLD | NEW |