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

Unified Diff: ui/gl/gl_image_linux_dma_buffer.cc

Issue 1051503003: Add R_8 GPU memory buffers format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix validation problem in StrideInBytes. Deals with GL_RED/GL_LUMINANCE. Created 5 years, 9 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: ui/gl/gl_image_linux_dma_buffer.cc
diff --git a/ui/gl/gl_image_linux_dma_buffer.cc b/ui/gl/gl_image_linux_dma_buffer.cc
index 04ad06bd438433b270c60b804509a088d08e0a44..7fbd6c498aad97654529d531d473747107775dda 100644
--- a/ui/gl/gl_image_linux_dma_buffer.cc
+++ b/ui/gl/gl_image_linux_dma_buffer.cc
@@ -37,6 +37,7 @@ bool ValidFormat(unsigned internalformat, gfx::GpuMemoryBuffer::Format format) {
case gfx::GpuMemoryBuffer::DXT1:
case gfx::GpuMemoryBuffer::DXT5:
case gfx::GpuMemoryBuffer::ETC1:
+ case gfx::GpuMemoryBuffer::R_8:
case gfx::GpuMemoryBuffer::RGBA_8888:
case gfx::GpuMemoryBuffer::BGRA_8888:
return false;
@@ -52,12 +53,16 @@ bool ValidFormat(unsigned internalformat, gfx::GpuMemoryBuffer::Format format) {
case gfx::GpuMemoryBuffer::DXT1:
case gfx::GpuMemoryBuffer::DXT5:
case gfx::GpuMemoryBuffer::ETC1:
+ case gfx::GpuMemoryBuffer::R_8:
case gfx::GpuMemoryBuffer::RGBX_8888:
case gfx::GpuMemoryBuffer::RGBA_8888:
return false;
}
NOTREACHED();
return false;
+ case GL_LUMINANCE:
+ case GL_R8:
+ return format == gfx::GpuMemoryBuffer::R_8;
reveman 2015/04/01 13:14:33 this is not really true yet, is it?
Daniele Castagna 2015/04/01 21:58:34 Done.
default:
return false;
}
@@ -74,6 +79,7 @@ EGLint FourCC(gfx::GpuMemoryBuffer::Format format) {
case gfx::GpuMemoryBuffer::DXT1:
case gfx::GpuMemoryBuffer::DXT5:
case gfx::GpuMemoryBuffer::ETC1:
+ case gfx::GpuMemoryBuffer::R_8:
case gfx::GpuMemoryBuffer::RGBA_8888:
NOTREACHED();
return 0;

Powered by Google App Engine
This is Rietveld 408576698