| 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");
|
|
|