summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc2
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc23
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc6
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h1
4 files changed, 31 insertions, 1 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 80ca209..9a5cb1a 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -9631,7 +9631,7 @@ void GLES2DecoderImpl::DeleteVertexArraysOESHelper(
GetVertexAttribManager(client_ids[ii]);
if (vao && !vao->IsDeleted()) {
if (state_.vertex_attrib_manager.get() == vao) {
- state_.vertex_attrib_manager = default_vertex_attrib_manager_;
+ DoBindVertexArrayOES(0);
}
RemoveVertexAttribManager(client_ids[ii]);
}
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
index 016bfab..19b7292 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
@@ -7706,6 +7706,20 @@ class GLES2DecoderVertexArraysOESTest : public GLES2DecoderWithShaderTest {
ExecuteImmediateCmd(cmd, sizeof(temp)));
}
+ void DeleteBoundVertexArraysOESImmediateValidArgs() {
+ BindVertexArrayOESValidArgs();
+
+ AddExpectationsForDeleteBoundVertexArraysOES();
+ DeleteVertexArraysOESImmediate& cmd =
+ *GetImmediateAs<DeleteVertexArraysOESImmediate>();
+ cmd.Init(1, &client_vertexarray_id_);
+ EXPECT_EQ(error::kNoError,
+ ExecuteImmediateCmd(cmd, sizeof(client_vertexarray_id_)));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ EXPECT_TRUE(GetVertexArrayInfo(client_vertexarray_id_) == NULL);
+ vertex_array_deleted_manually_ = true;
+ }
+
void IsVertexArrayOESValidArgs() {
IsVertexArrayOES cmd;
cmd.Init(client_vertexarray_id_, shared_memory_id_, shared_memory_offset_);
@@ -7824,6 +7838,15 @@ TEST_F(GLES2DecoderEmulatedVertexArraysOESTest,
DeleteVertexArraysOESImmediateInvalidArgs();
}
+TEST_F(GLES2DecoderVertexArraysOESTest,
+ DeleteBoundVertexArraysOESImmediateValidArgs) {
+ DeleteBoundVertexArraysOESImmediateValidArgs();
+}
+TEST_F(GLES2DecoderEmulatedVertexArraysOESTest,
+ DeleteBoundVertexArraysOESImmediateValidArgs) {
+ DeleteBoundVertexArraysOESImmediateValidArgs();
+}
+
TEST_F(GLES2DecoderVertexArraysOESTest, IsVertexArrayOESValidArgs) {
IsVertexArrayOESValidArgs();
}
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
index eb4eb9c..f644c89 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
@@ -987,6 +987,12 @@ void GLES2DecoderTestBase::AddExpectationsForDeleteVertexArraysOES(){
}
}
+void GLES2DecoderTestBase::AddExpectationsForDeleteBoundVertexArraysOES() {
+ // Expectations are the same as a delete, followed by binding VAO 0.
+ AddExpectationsForDeleteVertexArraysOES();
+ AddExpectationsForBindVertexArrayOES();
+}
+
void GLES2DecoderTestBase::AddExpectationsForBindVertexArrayOES() {
if (group_->feature_info()->feature_flags().native_vertex_array_object) {
EXPECT_CALL(*gl_, BindVertexArrayOES(_))
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
index 24a960e..52e7211 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
@@ -354,6 +354,7 @@ class GLES2DecoderTestBase : public testing::Test {
void AddExpectationsForGenVertexArraysOES();
void AddExpectationsForDeleteVertexArraysOES();
+ void AddExpectationsForDeleteBoundVertexArraysOES();
void AddExpectationsForBindVertexArrayOES();
void AddExpectationsForRestoreAttribState(GLuint attrib);