| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "gpu/command_buffer/service/buffer_manager.h" | 9 #include "gpu/command_buffer/service/buffer_manager.h" |
| 10 #include "gpu/command_buffer/service/error_state_mock.h" | 10 #include "gpu/command_buffer/service/error_state_mock.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 MockErrorState error_state; | 140 MockErrorState error_state; |
| 141 BufferManager buffer_manager(NULL, NULL); | 141 BufferManager buffer_manager(NULL, NULL); |
| 142 buffer_manager.CreateBuffer(1, 2); | 142 buffer_manager.CreateBuffer(1, 2); |
| 143 Buffer* buffer = buffer_manager.GetBuffer(1); | 143 Buffer* buffer = buffer_manager.GetBuffer(1); |
| 144 ASSERT_TRUE(buffer != NULL); | 144 ASSERT_TRUE(buffer != NULL); |
| 145 | 145 |
| 146 VertexAttrib* attrib = manager_->GetVertexAttrib(1); | 146 VertexAttrib* attrib = manager_->GetVertexAttrib(1); |
| 147 | 147 |
| 148 EXPECT_TRUE(attrib->CanAccess(0)); | 148 EXPECT_TRUE(attrib->CanAccess(0)); |
| 149 manager_->Enable(1, true); | 149 manager_->Enable(1, true); |
| 150 EXPECT_FALSE(attrib->CanAccess(0)); | |
| 151 | 150 |
| 152 manager_->SetAttribInfo(1, buffer, 4, GL_FLOAT, GL_FALSE, 0, 16, 0, GL_FALSE); | 151 manager_->SetAttribInfo(1, buffer, 4, GL_FLOAT, GL_FALSE, 0, 16, 0, GL_FALSE); |
| 153 EXPECT_FALSE(attrib->CanAccess(0)); | 152 EXPECT_FALSE(attrib->CanAccess(0)); |
| 154 | 153 |
| 155 EXPECT_TRUE(buffer_manager.SetTarget(buffer, kTarget)); | 154 EXPECT_TRUE(buffer_manager.SetTarget(buffer, kTarget)); |
| 156 TestHelper::DoBufferData( | 155 TestHelper::DoBufferData( |
| 157 gl_.get(), &error_state, &buffer_manager, buffer, | 156 gl_.get(), &error_state, &buffer_manager, buffer, |
| 158 kTarget, 15, GL_STATIC_DRAW, NULL, GL_NO_ERROR); | 157 kTarget, 15, GL_STATIC_DRAW, NULL, GL_NO_ERROR); |
| 159 | 158 |
| 160 EXPECT_FALSE(attrib->CanAccess(0)); | 159 EXPECT_FALSE(attrib->CanAccess(0)); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 manager_ = NULL; | 220 manager_ = NULL; |
| 222 buffer_manager.MarkContextLost(); | 221 buffer_manager.MarkContextLost(); |
| 223 buffer_manager.Destroy(); | 222 buffer_manager.Destroy(); |
| 224 } | 223 } |
| 225 | 224 |
| 226 // TODO(gman): Test ValidateBindings | 225 // TODO(gman): Test ValidateBindings |
| 227 // TODO(gman): Test ValidateBindings with client side arrays. | 226 // TODO(gman): Test ValidateBindings with client side arrays. |
| 228 | 227 |
| 229 } // namespace gles2 | 228 } // namespace gles2 |
| 230 } // namespace gpu | 229 } // namespace gpu |
| 231 | |
| 232 | |
| OLD | NEW |