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

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

Issue 1131273005: Fine tune vertex attrib commands handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: working Created 5 years, 7 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 | « 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 b82858e5edd10deaa34fdce38b488b23aac03885..81ad6cd2940b2633b1b7aab1600e8903cde2de2a 100644
--- a/gpu/command_buffer/service/vertex_attrib_manager_unittest.cc
+++ b/gpu/command_buffer/service/vertex_attrib_manager_unittest.cc
@@ -105,7 +105,7 @@ TEST_F(VertexAttribManagerTest, SetAttribInfo) {
VertexAttrib* attrib = manager_->GetVertexAttrib(1);
- manager_->SetAttribInfo(1, buffer, 3, GL_SHORT, GL_TRUE, 32, 32, 4);
+ manager_->SetAttribInfo(1, buffer, 3, GL_SHORT, GL_TRUE, 32, 32, 4, GL_TRUE);
EXPECT_EQ(buffer, attrib->buffer());
EXPECT_EQ(4, attrib->offset());
@@ -113,6 +113,7 @@ TEST_F(VertexAttribManagerTest, SetAttribInfo) {
EXPECT_EQ(static_cast<GLenum>(GL_SHORT), attrib->type());
EXPECT_EQ(GL_TRUE, attrib->normalized());
EXPECT_EQ(32, attrib->gl_stride());
+ EXPECT_EQ(GL_TRUE, attrib->integer());
// The VertexAttribManager must be destroyed before the BufferManager
// so it releases its buffers.
@@ -122,13 +123,13 @@ TEST_F(VertexAttribManagerTest, SetAttribInfo) {
TEST_F(VertexAttribManagerTest, HaveFixedAttribs) {
EXPECT_FALSE(manager_->HaveFixedAttribs());
- manager_->SetAttribInfo(1, NULL, 4, GL_FIXED, GL_FALSE, 0, 16, 0);
+ manager_->SetAttribInfo(1, NULL, 4, GL_FIXED, GL_FALSE, 0, 16, 0, GL_FALSE);
EXPECT_TRUE(manager_->HaveFixedAttribs());
- manager_->SetAttribInfo(3, NULL, 4, GL_FIXED, GL_FALSE, 0, 16, 0);
+ manager_->SetAttribInfo(3, NULL, 4, GL_FIXED, GL_FALSE, 0, 16, 0, GL_FALSE);
EXPECT_TRUE(manager_->HaveFixedAttribs());
- manager_->SetAttribInfo(1, NULL, 4, GL_FLOAT, GL_FALSE, 0, 16, 0);
+ manager_->SetAttribInfo(1, NULL, 4, GL_FLOAT, GL_FALSE, 0, 16, 0, GL_FALSE);
EXPECT_TRUE(manager_->HaveFixedAttribs());
- manager_->SetAttribInfo(3, NULL, 4, GL_FLOAT, GL_FALSE, 0, 16, 0);
+ manager_->SetAttribInfo(3, NULL, 4, GL_FLOAT, GL_FALSE, 0, 16, 0, GL_FALSE);
EXPECT_FALSE(manager_->HaveFixedAttribs());
}
@@ -145,7 +146,7 @@ TEST_F(VertexAttribManagerTest, CanAccess) {
manager_->Enable(1, true);
EXPECT_FALSE(attrib->CanAccess(0));
- manager_->SetAttribInfo(1, buffer, 4, GL_FLOAT, GL_FALSE, 0, 16, 0);
+ manager_->SetAttribInfo(1, buffer, 4, GL_FLOAT, GL_FALSE, 0, 16, 0, GL_FALSE);
EXPECT_FALSE(attrib->CanAccess(0));
EXPECT_TRUE(buffer_manager.SetTarget(buffer, GL_ARRAY_BUFFER));
@@ -160,7 +161,7 @@ TEST_F(VertexAttribManagerTest, CanAccess) {
EXPECT_TRUE(attrib->CanAccess(0));
EXPECT_FALSE(attrib->CanAccess(1));
- manager_->SetAttribInfo(1, buffer, 4, GL_FLOAT, GL_FALSE, 0, 16, 1);
+ manager_->SetAttribInfo(1, buffer, 4, GL_FLOAT, GL_FALSE, 0, 16, 1, GL_FALSE);
EXPECT_FALSE(attrib->CanAccess(0));
TestHelper::DoBufferData(
@@ -168,9 +169,9 @@ TEST_F(VertexAttribManagerTest, CanAccess) {
NULL, GL_NO_ERROR);
EXPECT_TRUE(attrib->CanAccess(0));
EXPECT_FALSE(attrib->CanAccess(1));
- manager_->SetAttribInfo(1, buffer, 4, GL_FLOAT, GL_FALSE, 0, 16, 0);
+ manager_->SetAttribInfo(1, buffer, 4, GL_FLOAT, GL_FALSE, 0, 16, 0, GL_FALSE);
EXPECT_TRUE(attrib->CanAccess(1));
- manager_->SetAttribInfo(1, buffer, 4, GL_FLOAT, GL_FALSE, 0, 20, 0);
+ manager_->SetAttribInfo(1, buffer, 4, GL_FLOAT, GL_FALSE, 0, 20, 0, GL_FALSE);
EXPECT_TRUE(attrib->CanAccess(0));
EXPECT_FALSE(attrib->CanAccess(1));
@@ -193,8 +194,10 @@ TEST_F(VertexAttribManagerTest, Unbind) {
VertexAttrib* attrib3 = manager_->GetVertexAttrib(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);
+ manager_->SetAttribInfo(
+ 1, buffer1, 3, GL_SHORT, GL_TRUE, 32, 32, 4, GL_FALSE);
+ manager_->SetAttribInfo(
+ 3, buffer1, 3, GL_SHORT, GL_TRUE, 32, 32, 4, GL_FALSE);
// Check they were attached.
EXPECT_EQ(buffer1, attrib1->buffer());
EXPECT_EQ(buffer1, attrib3->buffer());
« 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