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

Unified Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 1128933006: Update GL_CHROMIUM_image with support for compressed formats. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Validate format against supported extensions. Created 5 years, 7 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/GLES2/extensions/CHROMIUM/CHROMIUM_image.txt ('k') | ui/gl/gl_image_memory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/gles2_implementation.cc
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 1c8045d75bd8269809b1690837a016d494ee94e7..34bdec9ae9cf19fbb7f3b38412b5e1757e146126 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -5198,8 +5198,18 @@ void GLES2Implementation::RetireSyncPointCHROMIUM(GLuint sync_point) {
namespace {
-bool ValidImageFormat(GLenum internalformat) {
+bool ValidImageFormat(GLenum internalformat,
+ const Capabilities& capabilities) {
switch (internalformat) {
+ case GL_ATC_RGB_AMD:
+ case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD:
+ return capabilities.texture_format_atc;
+ case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
+ return capabilities.texture_format_dxt1;
+ case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
+ return capabilities.texture_format_dxt5;
+ case GL_ETC1_RGB8_OES:
+ return capabilities.texture_format_etc1;
case GL_R8:
case GL_RGB:
case GL_RGBA:
@@ -5236,7 +5246,7 @@ GLuint GLES2Implementation::CreateImageCHROMIUMHelper(ClientBuffer buffer,
return 0;
}
- if (!ValidImageFormat(internalformat)) {
+ if (!ValidImageFormat(internalformat, capabilities_)) {
SetGLError(GL_INVALID_VALUE, "glCreateImageCHROMIUM", "invalid format");
return 0;
}
@@ -5298,7 +5308,7 @@ GLuint GLES2Implementation::CreateGpuMemoryBufferImageCHROMIUMHelper(
return 0;
}
- if (!ValidImageFormat(internalformat)) {
+ if (!ValidImageFormat(internalformat, capabilities_)) {
SetGLError(GL_INVALID_VALUE,
"glCreateGpuMemoryBufferImageCHROMIUM",
"invalid format");
« no previous file with comments | « gpu/GLES2/extensions/CHROMIUM/CHROMIUM_image.txt ('k') | ui/gl/gl_image_memory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698