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

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

Issue 1376633002: Disallow gl[Compressed]Tex[Sub]Image2D for GL_TEXTURE_RECTANGLE_ARB (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unittests Created 5 years, 3 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 | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index fcde53815207ee0a2ee02dbbf4a5dce39507b0f1..2bff1db59a32f43fec9cfc4563c47d25deb7a39b 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -10090,6 +10090,14 @@ error::Error GLES2DecoderImpl::DoCompressedTexImage2D(
"glCompressedTexImage2D", target, "target");
return error::kNoError;
}
+ // TODO(ccameron): Add a separate texture from |texture_target| for
+ // [Compressed]Tex[Sub]Image2D and related functions.
+ // http://crbug.com/536854
+ if (target == GL_TEXTURE_RECTANGLE_ARB) {
+ LOCAL_SET_GL_ERROR_INVALID_ENUM(
+ "glCompressedTexImage2D", target, "target");
+ return error::kNoError;
+ }
if (!validators_->compressed_texture_format.IsValid(
internal_format)) {
LOCAL_SET_GL_ERROR_INVALID_ENUM(
@@ -10236,6 +10244,14 @@ error::Error GLES2DecoderImpl::HandleCompressedTexSubImage2DBucket(
GL_INVALID_ENUM, "glCompressedTexSubImage2D", "target");
return error::kNoError;
}
+ // TODO(ccameron): Add a separate texture from |texture_target| for
+ // [Compressed]Tex[Sub]Image2D and related functions.
+ // http://crbug.com/536854
+ if (target == GL_TEXTURE_RECTANGLE_ARB) {
+ LOCAL_SET_GL_ERROR(
+ GL_INVALID_ENUM, "glCompressedTexSubImage2D", "target");
+ return error::kNoError;
+ }
if (!validators_->compressed_texture_format.IsValid(format)) {
LOCAL_SET_GL_ERROR_INVALID_ENUM(
"glCompressedTexSubImage2D", format, "format");
@@ -10989,6 +11005,13 @@ bool GLES2DecoderImpl::ValidateTexSubImage2D(
LOCAL_SET_GL_ERROR_INVALID_ENUM(function_name, target, "target");
return false;
}
+ // TODO(ccameron): Add a separate texture from |texture_target| for
+ // [Compressed]Tex[Sub]Image2D and related functions.
+ // http://crbug.com/536854
+ if (target == GL_TEXTURE_RECTANGLE_ARB) {
+ LOCAL_SET_GL_ERROR_INVALID_ENUM(function_name, target, "target");
+ return false;
+ }
if (width < 0) {
LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "width < 0");
return false;
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698