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

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

Issue 8515023: Allow deleted resources to be used (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | « gpu/command_buffer/service/vertex_attrib_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/vertex_attrib_manager_unittest.cc
diff --git a/gpu/command_buffer/service/vertex_attrib_manager_unittest.cc b/gpu/command_buffer/service/vertex_attrib_manager_unittest.cc
index 49c18838591036fa05ce7c4123b2ae827b551f5e..ab51f83adbacd70caa37a56570b7fc56ae58c2de 100644
--- a/gpu/command_buffer/service/vertex_attrib_manager_unittest.cc
+++ b/gpu/command_buffer/service/vertex_attrib_manager_unittest.cc
@@ -174,6 +174,40 @@ TEST_F(VertexAttribManagerTest, CanAccess) {
buffer_manager.Destroy(false);
}
+TEST_F(VertexAttribManagerTest, Unbind) {
+ BufferManager buffer_manager;
+ buffer_manager.CreateBufferInfo(1, 2);
+ buffer_manager.CreateBufferInfo(3, 4);
+ BufferManager::BufferInfo* buffer1 = buffer_manager.GetBufferInfo(1);
+ BufferManager::BufferInfo* buffer2 = buffer_manager.GetBufferInfo(3);
+ ASSERT_TRUE(buffer1 != NULL);
+ ASSERT_TRUE(buffer2 != NULL);
+
+ VertexAttribManager::VertexAttribInfo* info1 =
+ manager_.GetVertexAttribInfo(1);
+ VertexAttribManager::VertexAttribInfo* info3 =
+ manager_.GetVertexAttribInfo(3);
+
+ // Attach to 2 buffers.
+ manager_.SetAttribInfo(1, buffer1, 3, GL_SHORT, GL_TRUE, 32, 32, 4);
+ manager_.SetAttribInfo(3, buffer1, 3, GL_SHORT, GL_TRUE, 32, 32, 4);
+ // Check they were attached.
+ EXPECT_EQ(buffer1, info1->buffer());
+ EXPECT_EQ(buffer1, info3->buffer());
+ // Unbind unattached buffer.
+ manager_.Unbind(buffer2);
+ // Should be no-op.
+ EXPECT_EQ(buffer1, info1->buffer());
+ EXPECT_EQ(buffer1, info3->buffer());
+ // Unbind buffer.
+ manager_.Unbind(buffer1);
+ // Check they were detached
+ EXPECT_TRUE(NULL == info1->buffer());
+ EXPECT_TRUE(NULL == info3->buffer());
+
+ buffer_manager.Destroy(false);
+}
+
} // namespace gles2
} // namespace gpu
« no previous file with comments | « gpu/command_buffer/service/vertex_attrib_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698