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

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: Remove GL_R8 in TextureManager::ValidateTextureParameters. 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
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 a80d17c8ddbff0dd25c3bd1dead32e54c8963942..e81522b3f938a17942fe6923ae7908ca8cee6fa4 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:
return true;
@@ -100,6 +104,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:

Powered by Google App Engine
This is Rietveld 408576698