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/client/vertex_array_object_manager.h" | 5 #include "gpu/command_buffer/client/vertex_array_object_manager.h" |
6 | 6 |
7 #include <GLES2/gl2ext.h> | 7 #include <GLES2/gl2ext.h> |
8 #include <GLES3/gl3.h> | 8 #include <GLES3/gl3.h> |
| 9 |
9 #include <stddef.h> | 10 #include <stddef.h> |
10 #include <stdint.h> | 11 #include <stdint.h> |
| 12 |
| 13 #include <memory> |
| 14 |
11 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
12 | 16 |
13 namespace gpu { | 17 namespace gpu { |
14 namespace gles2 { | 18 namespace gles2 { |
15 | 19 |
16 class VertexArrayObjectManagerTest : public testing::Test { | 20 class VertexArrayObjectManagerTest : public testing::Test { |
17 protected: | 21 protected: |
18 static const GLuint kMaxAttribs = 4; | 22 static const GLuint kMaxAttribs = 4; |
19 static const GLuint kClientSideArrayBuffer = 0x1234; | 23 static const GLuint kClientSideArrayBuffer = 0x1234; |
20 static const GLuint kClientSideElementArrayBuffer = 0x1235; | 24 static const GLuint kClientSideElementArrayBuffer = 0x1235; |
21 static const bool kSupportClientSideArrays = true; | 25 static const bool kSupportClientSideArrays = true; |
22 | 26 |
23 void SetUp() override { | 27 void SetUp() override { |
24 manager_.reset(new VertexArrayObjectManager( | 28 manager_.reset(new VertexArrayObjectManager( |
25 kMaxAttribs, | 29 kMaxAttribs, |
26 kClientSideArrayBuffer, | 30 kClientSideArrayBuffer, |
27 kClientSideElementArrayBuffer, | 31 kClientSideElementArrayBuffer, |
28 kSupportClientSideArrays)); | 32 kSupportClientSideArrays)); |
29 } | 33 } |
30 void TearDown() override {} | 34 void TearDown() override {} |
31 | 35 |
32 scoped_ptr<VertexArrayObjectManager> manager_; | 36 std::unique_ptr<VertexArrayObjectManager> manager_; |
33 }; | 37 }; |
34 | 38 |
35 // GCC requires these declarations, but MSVC requires they not be present | 39 // GCC requires these declarations, but MSVC requires they not be present |
36 #ifndef _MSC_VER | 40 #ifndef _MSC_VER |
37 const GLuint VertexArrayObjectManagerTest::kMaxAttribs; | 41 const GLuint VertexArrayObjectManagerTest::kMaxAttribs; |
38 const GLuint VertexArrayObjectManagerTest::kClientSideArrayBuffer; | 42 const GLuint VertexArrayObjectManagerTest::kClientSideArrayBuffer; |
39 const GLuint VertexArrayObjectManagerTest::kClientSideElementArrayBuffer; | 43 const GLuint VertexArrayObjectManagerTest::kClientSideElementArrayBuffer; |
40 #endif | 44 #endif |
41 | 45 |
42 TEST_F(VertexArrayObjectManagerTest, Basic) { | 46 TEST_F(VertexArrayObjectManagerTest, Basic) { |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 EXPECT_TRUE(manager_->IsReservedId(kClientSideArrayBuffer)); | 268 EXPECT_TRUE(manager_->IsReservedId(kClientSideArrayBuffer)); |
265 EXPECT_TRUE(manager_->IsReservedId(kClientSideElementArrayBuffer)); | 269 EXPECT_TRUE(manager_->IsReservedId(kClientSideElementArrayBuffer)); |
266 EXPECT_FALSE(manager_->IsReservedId(0)); | 270 EXPECT_FALSE(manager_->IsReservedId(0)); |
267 EXPECT_FALSE(manager_->IsReservedId(1)); | 271 EXPECT_FALSE(manager_->IsReservedId(1)); |
268 EXPECT_FALSE(manager_->IsReservedId(2)); | 272 EXPECT_FALSE(manager_->IsReservedId(2)); |
269 } | 273 } |
270 | 274 |
271 } // namespace gles2 | 275 } // namespace gles2 |
272 } // namespace gpu | 276 } // namespace gpu |
273 | 277 |
OLD | NEW |