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

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

Issue 1832923002: Clean up calls to CreateGpuMemoryBufferImageCHROMIUM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test failure. Created 4 years, 9 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/client/gles2_implementation.cc
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 8cb9716e7e3efc4c9f5e2c68174b8a607219868c..96896b8239323a3ad1d799ef046d220b7e3a73a7 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -5923,8 +5923,8 @@ void GLES2Implementation::WaitSyncTokenCHROMIUM(const GLbyte* sync_token) {
namespace {
-bool ValidImageFormat(GLenum internalformat,
- const Capabilities& capabilities) {
+bool CreateImageValidInternalFormat(GLenum internalformat,
+ const Capabilities& capabilities) {
switch (internalformat) {
case GL_ATC_RGB_AMD:
case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD:
@@ -5947,6 +5947,16 @@ bool ValidImageFormat(GLenum internalformat,
}
}
+bool CreateGpuMemoryBufferValidInternalFormat(GLenum internalformat) {
+ switch (internalformat) {
+ case GL_RGB:
+ case GL_RGBA:
+ return true;
+ default:
+ return false;
+ }
+}
+
bool ValidImageUsage(GLenum usage) {
return usage == GL_READ_WRITE_CHROMIUM;
}
@@ -5967,7 +5977,7 @@ GLuint GLES2Implementation::CreateImageCHROMIUMHelper(ClientBuffer buffer,
return 0;
}
- if (!ValidImageFormat(internalformat, capabilities_)) {
+ if (!CreateImageValidInternalFormat(internalformat, capabilities_)) {
SetGLError(GL_INVALID_VALUE, "glCreateImageCHROMIUM", "invalid format");
return 0;
}
@@ -6033,7 +6043,7 @@ GLuint GLES2Implementation::CreateGpuMemoryBufferImageCHROMIUMHelper(
return 0;
}
- if (!ValidImageFormat(internalformat, capabilities_)) {
+ if (!CreateGpuMemoryBufferValidInternalFormat(internalformat)) {
SetGLError(GL_INVALID_VALUE,
"glCreateGpuMemoryBufferImageCHROMIUM",
"invalid format");
« no previous file with comments | « content/browser/compositor/gpu_process_transport_factory.cc ('k') | gpu/command_buffer/service/image_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698