summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorzmo@google.com <zmo@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-30 17:55:15 +0000
committerzmo@google.com <zmo@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-30 17:55:15 +0000
commitf4eac070a7dcab18fca457e66adaf43dc71af31c (patch)
treecdf73c74dc76c471463f021aa4107f8506950829 /gpu
parenta3560d4ad6461568cfbfd151027c4558676fbb11 (diff)
downloadchromium_src-f4eac070a7dcab18fca457e66adaf43dc71af31c.zip
chromium_src-f4eac070a7dcab18fca457e66adaf43dc71af31c.tar.gz
chromium_src-f4eac070a7dcab18fca457e66adaf43dc71af31c.tar.bz2
Revert 129879 - Revert 129819 - Add CHECK on non-generated ids in command buffer.
For Chrome and WebGL we require that all ids are generated. This is especially important for the threaded compositor as it may be using ids that are getting deleted and those ids will get auto-reused on bind. BUG=121139 TEST=ran webgl conformance tests Review URL: http://codereview.chromium.org/9903029 TBR=gman@chromium.org Review URL: https://chromiumcodereview.appspot.com/9956023 TBR=zmo@google.com Review URL: https://chromiumcodereview.appspot.com/9968018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129886 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc23
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc12
2 files changed, 16 insertions, 19 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 95aedaa..90fc797 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -3131,8 +3131,8 @@ void GLES2DecoderImpl::DoBindBuffer(GLenum target, GLuint client_id) {
info = GetBufferInfo(client_id);
if (!info) {
if (!group_->bind_generates_resource()) {
- SetGLError(GL_INVALID_VALUE,
- "glBindBuffer: id not generated by glGenBuffers");
+ LOG(ERROR) << "glBindBuffer: id not generated by glGenBuffers";
+ current_decoder_error_ = error::kGenericError;
return;
}
@@ -3226,9 +3226,10 @@ void GLES2DecoderImpl::DoBindFramebuffer(GLenum target, GLuint client_id) {
info = GetFramebufferInfo(client_id);
if (!info) {
if (!group_->bind_generates_resource()) {
- SetGLError(GL_INVALID_VALUE,
- "glBindFramebuffer: id not generated by glGenFramebuffers");
- return;
+ LOG(ERROR)
+ << "glBindFramebuffer: id not generated by glGenFramebuffers";
+ current_decoder_error_ = error::kGenericError;
+ return;
}
// It's a new id so make a framebuffer info for it.
@@ -3269,9 +3270,9 @@ void GLES2DecoderImpl::DoBindRenderbuffer(GLenum target, GLuint client_id) {
info = GetRenderbufferInfo(client_id);
if (!info) {
if (!group_->bind_generates_resource()) {
- SetGLError(
- GL_INVALID_VALUE,
- "glBindRenderbuffer: id not generated by glGenRenderbuffers");
+ LOG(ERROR)
+ << "glBindRenderbuffer: id not generated by glGenRenderbuffers";
+ current_decoder_error_ = error::kGenericError;
return;
}
@@ -3298,9 +3299,9 @@ void GLES2DecoderImpl::DoBindTexture(GLenum target, GLuint client_id) {
info = GetTextureInfo(client_id);
if (!info) {
if (!group_->bind_generates_resource()) {
- SetGLError(GL_INVALID_VALUE,
- "glBindTexture: id not generated by glGenTextures");
- return;
+ LOG(ERROR) << "glBindTexture: id not generated by glGenTextures";
+ current_decoder_error_ = error::kGenericError;
+ return;
}
// It's a new id so make a texture info for it.
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
index ca1d5c6..16246f5 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
@@ -5199,23 +5199,19 @@ TEST_F(GLES2DecoderManualInitTest, BindGeneratesResourceFalse) {
BindTexture cmd1;
cmd1.Init(GL_TEXTURE_2D, kInvalidClientId);
- EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1));
- EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
+ EXPECT_NE(error::kNoError, ExecuteCmd(cmd1));
BindBuffer cmd2;
cmd2.Init(GL_ARRAY_BUFFER, kInvalidClientId);
- EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
- EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
+ EXPECT_NE(error::kNoError, ExecuteCmd(cmd2));
BindFramebuffer cmd3;
cmd3.Init(GL_FRAMEBUFFER, kInvalidClientId);
- EXPECT_EQ(error::kNoError, ExecuteCmd(cmd3));
- EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
+ EXPECT_NE(error::kNoError, ExecuteCmd(cmd3));
BindRenderbuffer cmd4;
cmd4.Init(GL_RENDERBUFFER, kInvalidClientId);
- EXPECT_EQ(error::kNoError, ExecuteCmd(cmd4));
- EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
+ EXPECT_NE(error::kNoError, ExecuteCmd(cmd4));
}
TEST_F(GLES2DecoderManualInitTest, CreateStreamTextureCHROMIUM) {