| 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 #include <stddef.h> | 13 #include <stddef.h> |
| 14 #include <stdint.h> | 14 #include <stdint.h> |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "gpu/command_buffer/client/client_test_helper.h" | 16 #include "gpu/command_buffer/client/client_test_helper.h" |
| 17 #include "gpu/command_buffer/client/gles2_cmd_helper.h" | 17 #include "gpu/command_buffer/client/gles2_cmd_helper.h" |
| 18 #include "gpu/command_buffer/client/program_info_manager.h" | 18 #include "gpu/command_buffer/client/program_info_manager.h" |
| 19 #include "gpu/command_buffer/client/query_tracker.h" | 19 #include "gpu/command_buffer/client/query_tracker.h" |
| 20 #include "gpu/command_buffer/client/ring_buffer.h" | 20 #include "gpu/command_buffer/client/ring_buffer.h" |
| 21 #include "gpu/command_buffer/client/shared_memory_limits.h" |
| 21 #include "gpu/command_buffer/client/transfer_buffer.h" | 22 #include "gpu/command_buffer/client/transfer_buffer.h" |
| 22 #include "gpu/command_buffer/common/command_buffer.h" | 23 #include "gpu/command_buffer/common/command_buffer.h" |
| 23 #include "gpu/command_buffer/common/sync_token.h" | 24 #include "gpu/command_buffer/common/sync_token.h" |
| 24 #include "testing/gmock/include/gmock/gmock.h" | 25 #include "testing/gmock/include/gmock/gmock.h" |
| 25 #include "testing/gtest/include/gtest/gtest.h" | 26 #include "testing/gtest/include/gtest/gtest.h" |
| 26 | 27 |
| 27 #if !defined(GLES2_SUPPORT_CLIENT_SIDE_ARRAYS) | 28 #if !defined(GLES2_SUPPORT_CLIENT_SIDE_ARRAYS) |
| 28 #define GLES2_SUPPORT_CLIENT_SIDE_ARRAYS | 29 #define GLES2_SUPPORT_CLIENT_SIDE_ARRAYS |
| 29 #endif | 30 #endif |
| 30 | 31 |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 bind_generates_resource_client, | 491 bind_generates_resource_client, |
| 491 lose_context_when_out_of_memory, | 492 lose_context_when_out_of_memory, |
| 492 support_client_side_arrays, | 493 support_client_side_arrays, |
| 493 gpu_control_.get())); | 494 gpu_control_.get())); |
| 494 } | 495 } |
| 495 | 496 |
| 496 // The client should be set to something non-null. | 497 // The client should be set to something non-null. |
| 497 EXPECT_CALL(*gpu_control_, SetGpuControlClient(gl_.get())).Times(1); | 498 EXPECT_CALL(*gpu_control_, SetGpuControlClient(gl_.get())).Times(1); |
| 498 | 499 |
| 499 if (!gl_->Initialize(kTransferBufferSize, kTransferBufferSize, | 500 if (!gl_->Initialize(kTransferBufferSize, kTransferBufferSize, |
| 500 kTransferBufferSize, GLES2Implementation::kNoLimit)) | 501 kTransferBufferSize, SharedMemoryLimits::kNoLimit)) |
| 501 return false; | 502 return false; |
| 502 | 503 |
| 503 helper_->CommandBufferHelper::Finish(); | 504 helper_->CommandBufferHelper::Finish(); |
| 504 ::testing::Mock::VerifyAndClearExpectations(gl_.get()); | 505 ::testing::Mock::VerifyAndClearExpectations(gl_.get()); |
| 505 | 506 |
| 506 scoped_refptr<Buffer> ring_buffer = helper_->get_ring_buffer(); | 507 scoped_refptr<Buffer> ring_buffer = helper_->get_ring_buffer(); |
| 507 commands_ = static_cast<CommandBufferEntry*>(ring_buffer->memory()) + | 508 commands_ = static_cast<CommandBufferEntry*>(ring_buffer->memory()) + |
| 508 command_buffer()->GetPutOffset(); | 509 command_buffer()->GetPutOffset(); |
| 509 ClearCommands(); | 510 ClearCommands(); |
| 510 EXPECT_TRUE(transfer_buffer_->InSync()); | 511 EXPECT_TRUE(transfer_buffer_->InSync()); |
| (...skipping 3991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4502 ContextInitOptions init_options; | 4503 ContextInitOptions init_options; |
| 4503 init_options.transfer_buffer_initialize_fail = true; | 4504 init_options.transfer_buffer_initialize_fail = true; |
| 4504 EXPECT_FALSE(Initialize(init_options)); | 4505 EXPECT_FALSE(Initialize(init_options)); |
| 4505 } | 4506 } |
| 4506 | 4507 |
| 4507 #include "base/macros.h" | 4508 #include "base/macros.h" |
| 4508 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" | 4509 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" |
| 4509 | 4510 |
| 4510 } // namespace gles2 | 4511 } // namespace gles2 |
| 4511 } // namespace gpu | 4512 } // namespace gpu |
| OLD | NEW |