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)); |
150 | 151 |
151 manager_->SetAttribInfo(1, buffer, 4, GL_FLOAT, GL_FALSE, 0, 16, 0, GL_FALSE); | 152 manager_->SetAttribInfo(1, buffer, 4, GL_FLOAT, GL_FALSE, 0, 16, 0, GL_FALSE); |
152 EXPECT_FALSE(attrib->CanAccess(0)); | 153 EXPECT_FALSE(attrib->CanAccess(0)); |
153 | 154 |
154 EXPECT_TRUE(buffer_manager.SetTarget(buffer, kTarget)); | 155 EXPECT_TRUE(buffer_manager.SetTarget(buffer, kTarget)); |
155 TestHelper::DoBufferData( | 156 TestHelper::DoBufferData( |
156 gl_.get(), &error_state, &buffer_manager, buffer, | 157 gl_.get(), &error_state, &buffer_manager, buffer, |
157 kTarget, 15, GL_STATIC_DRAW, NULL, GL_NO_ERROR); | 158 kTarget, 15, GL_STATIC_DRAW, NULL, GL_NO_ERROR); |
158 | 159 |
159 EXPECT_FALSE(attrib->CanAccess(0)); | 160 EXPECT_FALSE(attrib->CanAccess(0)); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 manager_ = NULL; | 221 manager_ = NULL; |
221 buffer_manager.MarkContextLost(); | 222 buffer_manager.MarkContextLost(); |
222 buffer_manager.Destroy(); | 223 buffer_manager.Destroy(); |
223 } | 224 } |
224 | 225 |
225 // TODO(gman): Test ValidateBindings | 226 // TODO(gman): Test ValidateBindings |
226 // TODO(gman): Test ValidateBindings with client side arrays. | 227 // TODO(gman): Test ValidateBindings with client side arrays. |
227 | 228 |
228 } // namespace gles2 | 229 } // namespace gles2 |
229 } // namespace gpu | 230 } // namespace gpu |
| 231 |
| 232 |
OLD | NEW |