summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/tests/gl_manager.cc
diff options
context:
space:
mode:
authordcastagna <dcastagna@chromium.org>2015-04-08 13:52:56 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-08 20:53:26 +0000
commit51f60b27d0a7c8f1d39674fec24f73e9b55f04e6 (patch)
tree6f0d74c878e12c750fc01f5168234ea8b1f7fa0b /gpu/command_buffer/tests/gl_manager.cc
parent1abe5b4643edb113d9ce3ac58c69d40967d74cc5 (diff)
downloadchromium_src-51f60b27d0a7c8f1d39674fec24f73e9b55f04e6.zip
chromium_src-51f60b27d0a7c8f1d39674fec24f73e9b55f04e6.tar.gz
chromium_src-51f60b27d0a7c8f1d39674fec24f73e9b55f04e6.tar.bz2
Add R_8 GPU memory buffers format.
GpuMemoryBuffer::Format::R_8 should be used to represent textures with only one channel, the associated image should have GL_R8/GL_R8_EXT as internal format. With this CL the only implementation of GpuMemoryBuffer that supports R_8 is GLImageMemory, it expects a 4 bytes row alignment (4 is the default value for GL_PACK_ALIGNMENT). BUG= Review URL: https://codereview.chromium.org/1051503003 Cr-Commit-Position: refs/heads/master@{#324281}
Diffstat (limited to 'gpu/command_buffer/tests/gl_manager.cc')
-rw-r--r--gpu/command_buffer/tests/gl_manager.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/gpu/command_buffer/tests/gl_manager.cc b/gpu/command_buffer/tests/gl_manager.cc
index 3a3d7e9..2b6d06d 100644
--- a/gpu/command_buffer/tests/gl_manager.cc
+++ b/gpu/command_buffer/tests/gl_manager.cc
@@ -46,6 +46,7 @@ size_t NumberOfPlanesForGpuMemoryBufferFormat(
case gfx::GpuMemoryBuffer::Format::DXT1:
case gfx::GpuMemoryBuffer::Format::DXT5:
case gfx::GpuMemoryBuffer::Format::ETC1:
+ case gfx::GpuMemoryBuffer::Format::R_8:
case gfx::GpuMemoryBuffer::Format::RGBA_8888:
case gfx::GpuMemoryBuffer::Format::RGBX_8888:
case gfx::GpuMemoryBuffer::Format::BGRA_8888:
@@ -64,6 +65,7 @@ size_t SubsamplingFactor(gfx::GpuMemoryBuffer::Format format, int plane) {
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::RGBX_8888:
case gfx::GpuMemoryBuffer::BGRA_8888:
@@ -92,6 +94,8 @@ size_t StrideInBytes(size_t width,
DCHECK_EQ(plane, 0);
DCHECK_EQ(width % 2, 0U);
return width / 2;
+ case gfx::GpuMemoryBuffer::R_8:
+ return (width + 3) & ~0x3;
case gfx::GpuMemoryBuffer::RGBA_8888:
case gfx::GpuMemoryBuffer::BGRA_8888:
DCHECK_EQ(plane, 0);