| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/command_buffer/service/vertex_attrib_manager.h" | 5 #include "gpu/command_buffer/service/vertex_attrib_manager.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "gpu/command_buffer/common/gl_mock.h" | 8 #include "gpu/command_buffer/common/gl_mock.h" |
| 9 #include "gpu/command_buffer/service/feature_info.h" | 9 #include "gpu/command_buffer/service/feature_info.h" |
| 10 #include "gpu/command_buffer/service/test_helper.h" | 10 #include "gpu/command_buffer/service/test_helper.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 manager_->GetVertexAttribInfo(ii); | 70 manager_->GetVertexAttribInfo(ii); |
| 71 ASSERT_TRUE(info != NULL); | 71 ASSERT_TRUE(info != NULL); |
| 72 EXPECT_EQ(ii, info->index()); | 72 EXPECT_EQ(ii, info->index()); |
| 73 EXPECT_TRUE(info->buffer() == NULL); | 73 EXPECT_TRUE(info->buffer() == NULL); |
| 74 EXPECT_EQ(0, info->offset()); | 74 EXPECT_EQ(0, info->offset()); |
| 75 EXPECT_EQ(4, info->size()); | 75 EXPECT_EQ(4, info->size()); |
| 76 EXPECT_EQ(static_cast<GLenum>(GL_FLOAT), info->type()); | 76 EXPECT_EQ(static_cast<GLenum>(GL_FLOAT), info->type()); |
| 77 EXPECT_EQ(GL_FALSE, info->normalized()); | 77 EXPECT_EQ(GL_FALSE, info->normalized()); |
| 78 EXPECT_EQ(0, info->gl_stride()); | 78 EXPECT_EQ(0, info->gl_stride()); |
| 79 EXPECT_FALSE(info->enabled()); | 79 EXPECT_FALSE(info->enabled()); |
| 80 EXPECT_EQ(0.0f, info->value().v[0]); | |
| 81 EXPECT_EQ(0.0f, info->value().v[1]); | |
| 82 EXPECT_EQ(0.0f, info->value().v[2]); | |
| 83 EXPECT_EQ(1.0f, info->value().v[3]); | |
| 84 manager_->Enable(ii, true); | 80 manager_->Enable(ii, true); |
| 85 EXPECT_TRUE(info->enabled()); | 81 EXPECT_TRUE(info->enabled()); |
| 86 } | 82 } |
| 87 } | 83 } |
| 88 | 84 |
| 89 TEST_F(VertexAttribManagerTest, Enable) { | 85 TEST_F(VertexAttribManagerTest, Enable) { |
| 90 const VertexAttribManager::VertexAttribInfoList& infos = | 86 const VertexAttribManager::VertexAttribInfoList& infos = |
| 91 manager_->GetEnabledVertexAttribInfos(); | 87 manager_->GetEnabledVertexAttribInfos(); |
| 92 | 88 |
| 93 VertexAttribManager::VertexAttribInfo* info1 = | 89 VertexAttribManager::VertexAttribInfo* info1 = |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 // The VertexAttribManager must be destroyed before the BufferManager | 219 // The VertexAttribManager must be destroyed before the BufferManager |
| 224 // so it releases its buffers. | 220 // so it releases its buffers. |
| 225 manager_ = NULL; | 221 manager_ = NULL; |
| 226 buffer_manager.Destroy(false); | 222 buffer_manager.Destroy(false); |
| 227 } | 223 } |
| 228 | 224 |
| 229 } // namespace gles2 | 225 } // namespace gles2 |
| 230 } // namespace gpu | 226 } // namespace gpu |
| 231 | 227 |
| 232 | 228 |
| OLD | NEW |