| 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/gles2_cmd_decoder_unittest_base.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 GLuint client_id, GLuint service_id) { | 648 GLuint client_id, GLuint service_id) { |
| 649 EXPECT_CALL(*gl_, FenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0)) | 649 EXPECT_CALL(*gl_, FenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0)) |
| 650 .Times(1) | 650 .Times(1) |
| 651 .WillOnce(Return(reinterpret_cast<GLsync>(service_id))) | 651 .WillOnce(Return(reinterpret_cast<GLsync>(service_id))) |
| 652 .RetiresOnSaturation(); | 652 .RetiresOnSaturation(); |
| 653 cmds::FenceSync cmd; | 653 cmds::FenceSync cmd; |
| 654 cmd.Init(client_id); | 654 cmd.Init(client_id); |
| 655 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 655 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 656 } | 656 } |
| 657 | 657 |
| 658 void GLES2DecoderTestBase::DoCreateSampler( |
| 659 GLuint client_id, GLuint service_id) { |
| 660 EXPECT_CALL(*gl_, GenSamplers(1, _)) |
| 661 .WillOnce(SetArgPointee<1>(service_id)); |
| 662 cmds::GenSamplersImmediate* cmd = |
| 663 GetImmediateAs<cmds::GenSamplersImmediate>(); |
| 664 GLuint temp = client_id; |
| 665 cmd->Init(1, &temp); |
| 666 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(*cmd, sizeof(temp))); |
| 667 } |
| 668 |
| 669 void GLES2DecoderTestBase::DoBindSampler( |
| 670 GLuint unit, GLuint client_id, GLuint service_id) { |
| 671 EXPECT_CALL(*gl_, BindSampler(unit, service_id)) |
| 672 .Times(1) |
| 673 .RetiresOnSaturation(); |
| 674 cmds::BindSampler cmd; |
| 675 cmd.Init(unit, client_id); |
| 676 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 677 } |
| 678 |
| 679 void GLES2DecoderTestBase::DoDeleteSampler( |
| 680 GLuint client_id, GLuint service_id) { |
| 681 EXPECT_CALL(*gl_, DeleteSamplers(1, Pointee(service_id))) |
| 682 .Times(1) |
| 683 .RetiresOnSaturation(); |
| 684 GenHelper<cmds::DeleteSamplersImmediate>(client_id); |
| 685 } |
| 686 |
| 687 void GLES2DecoderTestBase::DoCreateTransformFeedback( |
| 688 GLuint client_id, GLuint service_id) { |
| 689 EXPECT_CALL(*gl_, GenTransformFeedbacks(1, _)) |
| 690 .WillOnce(SetArgPointee<1>(service_id)); |
| 691 cmds::GenTransformFeedbacksImmediate* cmd = |
| 692 GetImmediateAs<cmds::GenTransformFeedbacksImmediate>(); |
| 693 GLuint temp = client_id; |
| 694 cmd->Init(1, &temp); |
| 695 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(*cmd, sizeof(temp))); |
| 696 } |
| 697 |
| 698 void GLES2DecoderTestBase::DoBindTransformFeedback( |
| 699 GLenum target, GLuint client_id, GLuint service_id) { |
| 700 EXPECT_CALL(*gl_, BindTransformFeedback(target, service_id)) |
| 701 .Times(1) |
| 702 .RetiresOnSaturation(); |
| 703 cmds::BindTransformFeedback cmd; |
| 704 cmd.Init(target, client_id); |
| 705 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 706 } |
| 707 |
| 708 void GLES2DecoderTestBase::DoDeleteTransformFeedback( |
| 709 GLuint client_id, GLuint service_id) { |
| 710 EXPECT_CALL(*gl_, DeleteTransformFeedbacks(1, Pointee(service_id))) |
| 711 .Times(1) |
| 712 .RetiresOnSaturation(); |
| 713 GenHelper<cmds::DeleteTransformFeedbacksImmediate>(client_id); |
| 714 } |
| 715 |
| 658 void GLES2DecoderTestBase::SetBucketData( | 716 void GLES2DecoderTestBase::SetBucketData( |
| 659 uint32_t bucket_id, const void* data, uint32_t data_size) { | 717 uint32_t bucket_id, const void* data, uint32_t data_size) { |
| 660 DCHECK(data || data_size == 0); | 718 DCHECK(data || data_size == 0); |
| 661 cmd::SetBucketSize cmd1; | 719 cmd::SetBucketSize cmd1; |
| 662 cmd1.Init(bucket_id, data_size); | 720 cmd1.Init(bucket_id, data_size); |
| 663 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1)); | 721 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1)); |
| 664 if (data) { | 722 if (data) { |
| 665 memcpy(shared_memory_address_, data, data_size); | 723 memcpy(shared_memory_address_, data, data_size); |
| 666 cmd::SetBucketData cmd2; | 724 cmd::SetBucketData cmd2; |
| 667 cmd2.Init(bucket_id, 0, data_size, kSharedMemoryId, kSharedMemoryOffset); | 725 cmd2.Init(bucket_id, 0, data_size, kSharedMemoryId, kSharedMemoryOffset); |
| (...skipping 1455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2123 SetupDefaultProgram(); | 2181 SetupDefaultProgram(); |
| 2124 } | 2182 } |
| 2125 | 2183 |
| 2126 // Include the auto-generated part of this file. We split this because it means | 2184 // Include the auto-generated part of this file. We split this because it means |
| 2127 // we can easily edit the non-auto generated parts right here in this file | 2185 // we can easily edit the non-auto generated parts right here in this file |
| 2128 // instead of having to edit some template or the code generator. | 2186 // instead of having to edit some template or the code generator. |
| 2129 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" | 2187 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" |
| 2130 | 2188 |
| 2131 } // namespace gles2 | 2189 } // namespace gles2 |
| 2132 } // namespace gpu | 2190 } // namespace gpu |
| OLD | NEW |