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

Unified Diff: gpu/command_buffer/service/image_factory.cc

Issue 1051503003: Add R_8 GPU memory buffers format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merged on master. Created 5 years, 8 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 | « gpu/command_buffer/service/feature_info.cc ('k') | gpu/command_buffer/service/in_process_command_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/image_factory.cc
diff --git a/gpu/command_buffer/service/image_factory.cc b/gpu/command_buffer/service/image_factory.cc
index f09cfb89058990588c0dee2f1a872b69bfc498cb..74994ff11859ae9c3f5dd44bd1090cca09d6cc3c 100644
--- a/gpu/command_buffer/service/image_factory.cc
+++ b/gpu/command_buffer/service/image_factory.cc
@@ -19,6 +19,8 @@ ImageFactory::~ImageFactory() {
gfx::GpuMemoryBuffer::Format ImageFactory::ImageFormatToGpuMemoryBufferFormat(
unsigned internalformat) {
switch (internalformat) {
+ case GL_R8:
+ return gfx::GpuMemoryBuffer::R_8;
case GL_RGB:
return gfx::GpuMemoryBuffer::RGBX_8888;
case GL_RGBA:
@@ -78,6 +80,8 @@ bool ImageFactory::IsGpuMemoryBufferFormatSupported(
return capabilities.texture_format_dxt5;
case gfx::GpuMemoryBuffer::ETC1:
return capabilities.texture_format_etc1;
+ case gfx::GpuMemoryBuffer::R_8:
+ return capabilities.texture_rg;
case gfx::GpuMemoryBuffer::RGBA_8888:
case gfx::GpuMemoryBuffer::RGBX_8888:
case gfx::GpuMemoryBuffer::YUV_420:
@@ -101,6 +105,7 @@ bool ImageFactory::IsImageSizeValidForGpuMemoryBufferFormat(
// Compressed images must have a width and height that's evenly divisible
// by the block size.
return size.width() % 4 == 0 && size.height() % 4 == 0;
+ case gfx::GpuMemoryBuffer::R_8:
case gfx::GpuMemoryBuffer::RGBA_8888:
case gfx::GpuMemoryBuffer::BGRA_8888:
case gfx::GpuMemoryBuffer::RGBX_8888:
« no previous file with comments | « gpu/command_buffer/service/feature_info.cc ('k') | gpu/command_buffer/service/in_process_command_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698