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

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

Issue 2920793005: gpu: support R16 GPUMemoryBuffer (Closed)
Patch Set: Add bug number to TODO. Created 3 years, 6 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 481f0b21c90232d1491176d27e298192c0445b67..2c96f1dfd7ba82fad5b3f56d57a14236f93a3b48 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_R16_EXT:
+ return gfx::BufferFormat::R_16;
case GL_RG_EXT:
return gfx::BufferFormat::RG_88;
case GL_RGB:
@@ -62,6 +64,7 @@ bool IsImageFormatCompatibleWithGpuMemoryBufferFormat(
case gfx::BufferFormat::DXT5:
case gfx::BufferFormat::ETC1:
case gfx::BufferFormat::R_8:
+ case gfx::BufferFormat::R_16:
case gfx::BufferFormat::RG_88:
case gfx::BufferFormat::RGBA_8888:
case gfx::BufferFormat::YVU_420:
@@ -96,6 +99,8 @@ bool IsImageFromGpuMemoryBufferFormatSupported(
return capabilities.texture_format_dxt5;
case gfx::BufferFormat::ETC1:
return capabilities.texture_format_etc1;
+ case gfx::BufferFormat::R_16:
+ return capabilities.texture_norm16;
case gfx::BufferFormat::R_8:
case gfx::BufferFormat::RG_88:
return capabilities.texture_rg;
@@ -135,6 +140,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::R_16:
case gfx::BufferFormat::RG_88:
case gfx::BufferFormat::BGR_565:
case gfx::BufferFormat::RGBA_4444:
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.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