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

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

Issue 1248253003: Add better support for RGBA_4444 textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add trace event Created 5 years, 4 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 9d4e659d02caee7b94fcaaeccbe9d2cb753883be..a5c76b94c45dfef6f4f600ff28e2630796a30494 100644
--- a/gpu/command_buffer/service/image_factory.cc
+++ b/gpu/command_buffer/service/image_factory.cc
@@ -63,7 +63,24 @@ gfx::BufferUsage ImageFactory::ImageUsageToGpuMemoryBufferUsage(
bool ImageFactory::IsImageFormatCompatibleWithGpuMemoryBufferFormat(
unsigned internalformat,
gfx::BufferFormat format) {
- return ImageFormatToGpuMemoryBufferFormat(internalformat) == format;
+ switch (format) {
+ case gfx::BufferFormat::ATC:
+ case gfx::BufferFormat::ATCIA:
+ case gfx::BufferFormat::BGRA_8888:
+ case gfx::BufferFormat::DXT1:
+ case gfx::BufferFormat::DXT5:
+ case gfx::BufferFormat::ETC1:
+ case gfx::BufferFormat::R_8:
+ case gfx::BufferFormat::RGBA_8888:
+ case gfx::BufferFormat::RGBX_8888:
+ case gfx::BufferFormat::YUV_420:
+ return ImageFormatToGpuMemoryBufferFormat(internalformat) == format;
+ case gfx::BufferFormat::RGBA_4444:
+ return internalformat == GL_RGBA;
+ }
+
+ NOTREACHED();
+ return false;
}
// static

Powered by Google App Engine
This is Rietveld 408576698