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 // Tests for GLES2Implementation. | 5 // Tests for GLES2Implementation. |
6 | 6 |
7 #include "gpu/command_buffer/client/gles2_implementation.h" | 7 #include "gpu/command_buffer/client/gles2_implementation.h" |
8 | 8 |
9 #include <GLES2/gl2.h> | 9 #include <GLES2/gl2.h> |
10 #include <GLES2/gl2ext.h> | 10 #include <GLES2/gl2ext.h> |
11 #include <GLES2/gl2extchromium.h> | 11 #include <GLES2/gl2extchromium.h> |
12 #include <GLES3/gl3.h> | 12 #include <GLES3/gl3.h> |
13 | 13 |
14 #include <stddef.h> | 14 #include <stddef.h> |
15 #include <stdint.h> | 15 #include <stdint.h> |
16 | 16 |
17 #include <memory> | 17 #include <memory> |
18 | 18 |
19 #include "base/compiler_specific.h" | 19 #include "base/compiler_specific.h" |
20 #include "gpu/command_buffer/client/client_test_helper.h" | 20 #include "gpu/command_buffer/client/client_test_helper.h" |
21 #include "gpu/command_buffer/client/gles2_cmd_helper.h" | 21 #include "gpu/command_buffer/client/gles2_cmd_helper.h" |
22 #include "gpu/command_buffer/client/program_info_manager.h" | 22 #include "gpu/command_buffer/client/program_info_manager.h" |
23 #include "gpu/command_buffer/client/query_tracker.h" | 23 #include "gpu/command_buffer/client/query_tracker.h" |
24 #include "gpu/command_buffer/client/ring_buffer.h" | 24 #include "gpu/command_buffer/client/ring_buffer.h" |
| 25 #include "gpu/command_buffer/client/shared_memory_limits.h" |
25 #include "gpu/command_buffer/client/transfer_buffer.h" | 26 #include "gpu/command_buffer/client/transfer_buffer.h" |
26 #include "gpu/command_buffer/common/command_buffer.h" | 27 #include "gpu/command_buffer/common/command_buffer.h" |
27 #include "gpu/command_buffer/common/sync_token.h" | 28 #include "gpu/command_buffer/common/sync_token.h" |
28 #include "testing/gmock/include/gmock/gmock.h" | 29 #include "testing/gmock/include/gmock/gmock.h" |
29 #include "testing/gtest/include/gtest/gtest.h" | 30 #include "testing/gtest/include/gtest/gtest.h" |
30 | 31 |
31 #if !defined(GLES2_SUPPORT_CLIENT_SIDE_ARRAYS) | 32 #if !defined(GLES2_SUPPORT_CLIENT_SIDE_ARRAYS) |
32 #define GLES2_SUPPORT_CLIENT_SIDE_ARRAYS | 33 #define GLES2_SUPPORT_CLIENT_SIDE_ARRAYS |
33 #endif | 34 #endif |
34 | 35 |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 bind_generates_resource_client, | 495 bind_generates_resource_client, |
495 lose_context_when_out_of_memory, | 496 lose_context_when_out_of_memory, |
496 support_client_side_arrays, | 497 support_client_side_arrays, |
497 gpu_control_.get())); | 498 gpu_control_.get())); |
498 } | 499 } |
499 | 500 |
500 // The client should be set to something non-null. | 501 // The client should be set to something non-null. |
501 EXPECT_CALL(*gpu_control_, SetGpuControlClient(gl_.get())).Times(1); | 502 EXPECT_CALL(*gpu_control_, SetGpuControlClient(gl_.get())).Times(1); |
502 | 503 |
503 if (!gl_->Initialize(kTransferBufferSize, kTransferBufferSize, | 504 if (!gl_->Initialize(kTransferBufferSize, kTransferBufferSize, |
504 kTransferBufferSize, GLES2Implementation::kNoLimit)) | 505 kTransferBufferSize, SharedMemoryLimits::kNoLimit)) |
505 return false; | 506 return false; |
506 | 507 |
507 helper_->CommandBufferHelper::Finish(); | 508 helper_->CommandBufferHelper::Finish(); |
508 ::testing::Mock::VerifyAndClearExpectations(gl_.get()); | 509 ::testing::Mock::VerifyAndClearExpectations(gl_.get()); |
509 | 510 |
510 scoped_refptr<Buffer> ring_buffer = helper_->get_ring_buffer(); | 511 scoped_refptr<Buffer> ring_buffer = helper_->get_ring_buffer(); |
511 commands_ = static_cast<CommandBufferEntry*>(ring_buffer->memory()) + | 512 commands_ = static_cast<CommandBufferEntry*>(ring_buffer->memory()) + |
512 command_buffer()->GetPutOffset(); | 513 command_buffer()->GetPutOffset(); |
513 ClearCommands(); | 514 ClearCommands(); |
514 EXPECT_TRUE(transfer_buffer_->InSync()); | 515 EXPECT_TRUE(transfer_buffer_->InSync()); |
(...skipping 3993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4508 ContextInitOptions init_options; | 4509 ContextInitOptions init_options; |
4509 init_options.transfer_buffer_initialize_fail = true; | 4510 init_options.transfer_buffer_initialize_fail = true; |
4510 EXPECT_FALSE(Initialize(init_options)); | 4511 EXPECT_FALSE(Initialize(init_options)); |
4511 } | 4512 } |
4512 | 4513 |
4513 #include "base/macros.h" | 4514 #include "base/macros.h" |
4514 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" | 4515 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" |
4515 | 4516 |
4516 } // namespace gles2 | 4517 } // namespace gles2 |
4517 } // namespace gpu | 4518 } // namespace gpu |
OLD | NEW |