Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3175)

Unified Diff: gpu/command_buffer/common/gpu_memory_buffer_support.cc

Issue 2689453002: Introduce gfx::BufferFormat::YUYV_422
Patch Set: rebase to ToT Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/gpu/gpu_internals_ui.cc ('k') | gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 481f0b21c90232d1491176d27e298192c0445b67..b0590621fe8a3290f9cd9e4b657fe5c7f76d20db 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)
+ // Ozone supports YUYV NativePixmap.
+ return gfx::BufferFormat::YUYV_422;
+#endif
default:
NOTREACHED();
return gfx::BufferFormat::RGBA_8888;
@@ -67,6 +73,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:
@@ -100,6 +107,7 @@ bool IsImageFromGpuMemoryBufferFormatSupported(
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:
@@ -149,6 +157,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;
}
« no previous file with comments | « content/browser/gpu/gpu_internals_ui.cc ('k') | gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698