Chromium Code Reviews| Index: gpu/command_buffer/common/gpu_memory_buffer_support.cc |
| diff --git a/gpu/command_buffer/common/gpu_memory_buffer_support.cc b/gpu/command_buffer/common/gpu_memory_buffer_support.cc |
| index 68237a08fd255e6ffc020f530493d662ffad0290..2b9d22ad3b0b699279fe4026163511904e837c0d 100644 |
| --- a/gpu/command_buffer/common/gpu_memory_buffer_support.cc |
| +++ b/gpu/command_buffer/common/gpu_memory_buffer_support.cc |
| @@ -41,7 +41,13 @@ gfx::BufferFormat BufferFormatForInternalFormat(unsigned internalformat) { |
| case GL_RGB_YCBCR_420V_CHROMIUM: |
| return gfx::BufferFormat::YUV_420_BIPLANAR; |
| case GL_RGB_YCBCR_422_CHROMIUM: |
| +#if defined(OS_MACOSX) |
| + // Mac supports UYVY IOSurface. |
| return gfx::BufferFormat::UYVY_422; |
| +#elif defined(OS_CHROMEOS) |
| + // Mesa EGL supports not UYVY but YUYV image. |
|
marcheu1
2017/01/21 00:25:18
ditto
dshwang
2017/01/23 23:13:42
Done.
|
| + return gfx::BufferFormat::YUYV_422; |
| +#endif |
| default: |
| NOTREACHED(); |
| return gfx::BufferFormat::RGBA_8888; |
| @@ -79,6 +85,7 @@ bool IsImageFormatCompatibleWithGpuMemoryBufferFormat( |
| case gfx::BufferFormat::YVU_420: |
| case gfx::BufferFormat::YUV_420_BIPLANAR: |
| case gfx::BufferFormat::UYVY_422: |
| + case gfx::BufferFormat::YUYV_422: |
| return format == BufferFormatForInternalFormat(internalformat); |
| case gfx::BufferFormat::BGR_565: |
| case gfx::BufferFormat::RGBX_8888: |
| @@ -110,6 +117,7 @@ bool IsGpuMemoryBufferFormatSupported(gfx::BufferFormat format, |
| case gfx::BufferFormat::RG_88: |
| return capabilities.texture_rg; |
| case gfx::BufferFormat::UYVY_422: |
| + case gfx::BufferFormat::YUYV_422: |
| return capabilities.image_ycbcr_422; |
| case gfx::BufferFormat::BGR_565: |
| case gfx::BufferFormat::RGBA_4444: |
| @@ -156,6 +164,7 @@ bool IsImageSizeValidForGpuMemoryBufferFormat(const gfx::Size& size, |
| // U and V planes are subsampled by a factor of 2. |
| return size.width() % 2 == 0 && size.height() % 2 == 0; |
| case gfx::BufferFormat::UYVY_422: |
| + case gfx::BufferFormat::YUYV_422: |
| return size.width() % 2 == 0; |
| } |