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

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

Issue 2121043002: 16 bpp video stream capture, render and WebGL usage - Realsense R200 & SR300 support. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tests: cc, skcanvas_video_renderer, wrtcrecorder... Fake capture supports Y16. Created 4 years, 3 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
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 eebfbbfb8afca18fa565dcadb2a9e1eaf9ac039f..f2d50a5496ef07c5bd91c6da8e0364b8653edecb 100644
--- a/gpu/command_buffer/common/gpu_memory_buffer_support.cc
+++ b/gpu/command_buffer/common/gpu_memory_buffer_support.cc
@@ -18,6 +18,8 @@ gfx::BufferFormat BufferFormatForInternalFormat(unsigned internalformat) {
switch (internalformat) {
case GL_RED_EXT:
return gfx::BufferFormat::R_8;
+ case GL_RG_EXT:
+ return gfx::BufferFormat::RG_88;
case GL_RGB:
return gfx::BufferFormat::BGRX_8888;
case GL_RGBA:
@@ -72,6 +74,7 @@ bool IsImageFormatCompatibleWithGpuMemoryBufferFormat(
case gfx::BufferFormat::DXT5:
case gfx::BufferFormat::ETC1:
case gfx::BufferFormat::R_8:
+ case gfx::BufferFormat::RG_88:
case gfx::BufferFormat::RGBA_8888:
case gfx::BufferFormat::YVU_420:
case gfx::BufferFormat::YUV_420_BIPLANAR:
@@ -104,6 +107,7 @@ bool IsGpuMemoryBufferFormatSupported(gfx::BufferFormat format,
case gfx::BufferFormat::ETC1:
return capabilities.texture_format_etc1;
case gfx::BufferFormat::R_8:
+ case gfx::BufferFormat::RG_88:
return capabilities.texture_rg;
case gfx::BufferFormat::UYVY_422:
return capabilities.image_ycbcr_422;
@@ -133,6 +137,7 @@ bool IsImageSizeValidForGpuMemoryBufferFormat(const gfx::Size& size,
// by the block size.
return size.width() % 4 == 0 && size.height() % 4 == 0;
case gfx::BufferFormat::R_8:
+ case gfx::BufferFormat::RG_88:
case gfx::BufferFormat::BGR_565:
case gfx::BufferFormat::RGBA_4444:
case gfx::BufferFormat::RGBA_8888:

Powered by Google App Engine
This is Rietveld 408576698