| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // This file is auto-generated from | 5 // This file is auto-generated from |
| 6 // gpu/command_buffer/build_gles2_cmd_buffer.py | 6 // gpu/command_buffer/build_gles2_cmd_buffer.py |
| 7 // It's formatted by clang-format using chromium coding style: | 7 // It's formatted by clang-format using chromium coding style: |
| 8 // clang-format -i -style=chromium filename | 8 // clang-format -i -style=chromium filename |
| 9 // DO NOT EDIT! | 9 // DO NOT EDIT! |
| 10 | 10 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 struct Cmds { | 126 struct Cmds { |
| 127 cmds::CheckFramebufferStatus cmd; | 127 cmds::CheckFramebufferStatus cmd; |
| 128 }; | 128 }; |
| 129 | 129 |
| 130 Cmds expected; | 130 Cmds expected; |
| 131 ExpectedMemoryInfo result1 = | 131 ExpectedMemoryInfo result1 = |
| 132 GetExpectedResultMemory(sizeof(cmds::CheckFramebufferStatus::Result)); | 132 GetExpectedResultMemory(sizeof(cmds::CheckFramebufferStatus::Result)); |
| 133 expected.cmd.Init(1, result1.id, result1.offset); | 133 expected.cmd.Init(1, result1.id, result1.offset); |
| 134 | 134 |
| 135 EXPECT_CALL(*command_buffer(), OnFlush()) | 135 EXPECT_CALL(*command_buffer(), OnFlush()) |
| 136 .WillOnce(SetMemory(result1.ptr, uint32(1))) | 136 .WillOnce(SetMemory(result1.ptr, uint32_t(1))) |
| 137 .RetiresOnSaturation(); | 137 .RetiresOnSaturation(); |
| 138 | 138 |
| 139 GLboolean result = gl_->CheckFramebufferStatus(1); | 139 GLboolean result = gl_->CheckFramebufferStatus(1); |
| 140 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 140 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 141 EXPECT_TRUE(result); | 141 EXPECT_TRUE(result); |
| 142 } | 142 } |
| 143 | 143 |
| 144 TEST_F(GLES2ImplementationTest, Clear) { | 144 TEST_F(GLES2ImplementationTest, Clear) { |
| 145 struct Cmds { | 145 struct Cmds { |
| 146 cmds::Clear cmd; | 146 cmds::Clear cmd; |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 struct Cmds { | 765 struct Cmds { |
| 766 cmds::IsBuffer cmd; | 766 cmds::IsBuffer cmd; |
| 767 }; | 767 }; |
| 768 | 768 |
| 769 Cmds expected; | 769 Cmds expected; |
| 770 ExpectedMemoryInfo result1 = | 770 ExpectedMemoryInfo result1 = |
| 771 GetExpectedResultMemory(sizeof(cmds::IsBuffer::Result)); | 771 GetExpectedResultMemory(sizeof(cmds::IsBuffer::Result)); |
| 772 expected.cmd.Init(1, result1.id, result1.offset); | 772 expected.cmd.Init(1, result1.id, result1.offset); |
| 773 | 773 |
| 774 EXPECT_CALL(*command_buffer(), OnFlush()) | 774 EXPECT_CALL(*command_buffer(), OnFlush()) |
| 775 .WillOnce(SetMemory(result1.ptr, uint32(1))) | 775 .WillOnce(SetMemory(result1.ptr, uint32_t(1))) |
| 776 .RetiresOnSaturation(); | 776 .RetiresOnSaturation(); |
| 777 | 777 |
| 778 GLboolean result = gl_->IsBuffer(1); | 778 GLboolean result = gl_->IsBuffer(1); |
| 779 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 779 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 780 EXPECT_TRUE(result); | 780 EXPECT_TRUE(result); |
| 781 } | 781 } |
| 782 | 782 |
| 783 TEST_F(GLES2ImplementationTest, IsEnabled) { | 783 TEST_F(GLES2ImplementationTest, IsEnabled) { |
| 784 struct Cmds { | 784 struct Cmds { |
| 785 cmds::IsEnabled cmd; | 785 cmds::IsEnabled cmd; |
| 786 }; | 786 }; |
| 787 | 787 |
| 788 Cmds expected; | 788 Cmds expected; |
| 789 ExpectedMemoryInfo result1 = | 789 ExpectedMemoryInfo result1 = |
| 790 GetExpectedResultMemory(sizeof(cmds::IsEnabled::Result)); | 790 GetExpectedResultMemory(sizeof(cmds::IsEnabled::Result)); |
| 791 expected.cmd.Init(1, result1.id, result1.offset); | 791 expected.cmd.Init(1, result1.id, result1.offset); |
| 792 | 792 |
| 793 EXPECT_CALL(*command_buffer(), OnFlush()) | 793 EXPECT_CALL(*command_buffer(), OnFlush()) |
| 794 .WillOnce(SetMemory(result1.ptr, uint32(1))) | 794 .WillOnce(SetMemory(result1.ptr, uint32_t(1))) |
| 795 .RetiresOnSaturation(); | 795 .RetiresOnSaturation(); |
| 796 | 796 |
| 797 GLboolean result = gl_->IsEnabled(1); | 797 GLboolean result = gl_->IsEnabled(1); |
| 798 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 798 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 799 EXPECT_TRUE(result); | 799 EXPECT_TRUE(result); |
| 800 } | 800 } |
| 801 | 801 |
| 802 TEST_F(GLES2ImplementationTest, IsFramebuffer) { | 802 TEST_F(GLES2ImplementationTest, IsFramebuffer) { |
| 803 struct Cmds { | 803 struct Cmds { |
| 804 cmds::IsFramebuffer cmd; | 804 cmds::IsFramebuffer cmd; |
| 805 }; | 805 }; |
| 806 | 806 |
| 807 Cmds expected; | 807 Cmds expected; |
| 808 ExpectedMemoryInfo result1 = | 808 ExpectedMemoryInfo result1 = |
| 809 GetExpectedResultMemory(sizeof(cmds::IsFramebuffer::Result)); | 809 GetExpectedResultMemory(sizeof(cmds::IsFramebuffer::Result)); |
| 810 expected.cmd.Init(1, result1.id, result1.offset); | 810 expected.cmd.Init(1, result1.id, result1.offset); |
| 811 | 811 |
| 812 EXPECT_CALL(*command_buffer(), OnFlush()) | 812 EXPECT_CALL(*command_buffer(), OnFlush()) |
| 813 .WillOnce(SetMemory(result1.ptr, uint32(1))) | 813 .WillOnce(SetMemory(result1.ptr, uint32_t(1))) |
| 814 .RetiresOnSaturation(); | 814 .RetiresOnSaturation(); |
| 815 | 815 |
| 816 GLboolean result = gl_->IsFramebuffer(1); | 816 GLboolean result = gl_->IsFramebuffer(1); |
| 817 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 817 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 818 EXPECT_TRUE(result); | 818 EXPECT_TRUE(result); |
| 819 } | 819 } |
| 820 | 820 |
| 821 TEST_F(GLES2ImplementationTest, IsProgram) { | 821 TEST_F(GLES2ImplementationTest, IsProgram) { |
| 822 struct Cmds { | 822 struct Cmds { |
| 823 cmds::IsProgram cmd; | 823 cmds::IsProgram cmd; |
| 824 }; | 824 }; |
| 825 | 825 |
| 826 Cmds expected; | 826 Cmds expected; |
| 827 ExpectedMemoryInfo result1 = | 827 ExpectedMemoryInfo result1 = |
| 828 GetExpectedResultMemory(sizeof(cmds::IsProgram::Result)); | 828 GetExpectedResultMemory(sizeof(cmds::IsProgram::Result)); |
| 829 expected.cmd.Init(1, result1.id, result1.offset); | 829 expected.cmd.Init(1, result1.id, result1.offset); |
| 830 | 830 |
| 831 EXPECT_CALL(*command_buffer(), OnFlush()) | 831 EXPECT_CALL(*command_buffer(), OnFlush()) |
| 832 .WillOnce(SetMemory(result1.ptr, uint32(1))) | 832 .WillOnce(SetMemory(result1.ptr, uint32_t(1))) |
| 833 .RetiresOnSaturation(); | 833 .RetiresOnSaturation(); |
| 834 | 834 |
| 835 GLboolean result = gl_->IsProgram(1); | 835 GLboolean result = gl_->IsProgram(1); |
| 836 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 836 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 837 EXPECT_TRUE(result); | 837 EXPECT_TRUE(result); |
| 838 } | 838 } |
| 839 | 839 |
| 840 TEST_F(GLES2ImplementationTest, IsRenderbuffer) { | 840 TEST_F(GLES2ImplementationTest, IsRenderbuffer) { |
| 841 struct Cmds { | 841 struct Cmds { |
| 842 cmds::IsRenderbuffer cmd; | 842 cmds::IsRenderbuffer cmd; |
| 843 }; | 843 }; |
| 844 | 844 |
| 845 Cmds expected; | 845 Cmds expected; |
| 846 ExpectedMemoryInfo result1 = | 846 ExpectedMemoryInfo result1 = |
| 847 GetExpectedResultMemory(sizeof(cmds::IsRenderbuffer::Result)); | 847 GetExpectedResultMemory(sizeof(cmds::IsRenderbuffer::Result)); |
| 848 expected.cmd.Init(1, result1.id, result1.offset); | 848 expected.cmd.Init(1, result1.id, result1.offset); |
| 849 | 849 |
| 850 EXPECT_CALL(*command_buffer(), OnFlush()) | 850 EXPECT_CALL(*command_buffer(), OnFlush()) |
| 851 .WillOnce(SetMemory(result1.ptr, uint32(1))) | 851 .WillOnce(SetMemory(result1.ptr, uint32_t(1))) |
| 852 .RetiresOnSaturation(); | 852 .RetiresOnSaturation(); |
| 853 | 853 |
| 854 GLboolean result = gl_->IsRenderbuffer(1); | 854 GLboolean result = gl_->IsRenderbuffer(1); |
| 855 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 855 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 856 EXPECT_TRUE(result); | 856 EXPECT_TRUE(result); |
| 857 } | 857 } |
| 858 | 858 |
| 859 TEST_F(GLES2ImplementationTest, IsShader) { | 859 TEST_F(GLES2ImplementationTest, IsShader) { |
| 860 struct Cmds { | 860 struct Cmds { |
| 861 cmds::IsShader cmd; | 861 cmds::IsShader cmd; |
| 862 }; | 862 }; |
| 863 | 863 |
| 864 Cmds expected; | 864 Cmds expected; |
| 865 ExpectedMemoryInfo result1 = | 865 ExpectedMemoryInfo result1 = |
| 866 GetExpectedResultMemory(sizeof(cmds::IsShader::Result)); | 866 GetExpectedResultMemory(sizeof(cmds::IsShader::Result)); |
| 867 expected.cmd.Init(1, result1.id, result1.offset); | 867 expected.cmd.Init(1, result1.id, result1.offset); |
| 868 | 868 |
| 869 EXPECT_CALL(*command_buffer(), OnFlush()) | 869 EXPECT_CALL(*command_buffer(), OnFlush()) |
| 870 .WillOnce(SetMemory(result1.ptr, uint32(1))) | 870 .WillOnce(SetMemory(result1.ptr, uint32_t(1))) |
| 871 .RetiresOnSaturation(); | 871 .RetiresOnSaturation(); |
| 872 | 872 |
| 873 GLboolean result = gl_->IsShader(1); | 873 GLboolean result = gl_->IsShader(1); |
| 874 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 874 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 875 EXPECT_TRUE(result); | 875 EXPECT_TRUE(result); |
| 876 } | 876 } |
| 877 | 877 |
| 878 TEST_F(GLES2ImplementationTest, IsTexture) { | 878 TEST_F(GLES2ImplementationTest, IsTexture) { |
| 879 struct Cmds { | 879 struct Cmds { |
| 880 cmds::IsTexture cmd; | 880 cmds::IsTexture cmd; |
| 881 }; | 881 }; |
| 882 | 882 |
| 883 Cmds expected; | 883 Cmds expected; |
| 884 ExpectedMemoryInfo result1 = | 884 ExpectedMemoryInfo result1 = |
| 885 GetExpectedResultMemory(sizeof(cmds::IsTexture::Result)); | 885 GetExpectedResultMemory(sizeof(cmds::IsTexture::Result)); |
| 886 expected.cmd.Init(1, result1.id, result1.offset); | 886 expected.cmd.Init(1, result1.id, result1.offset); |
| 887 | 887 |
| 888 EXPECT_CALL(*command_buffer(), OnFlush()) | 888 EXPECT_CALL(*command_buffer(), OnFlush()) |
| 889 .WillOnce(SetMemory(result1.ptr, uint32(1))) | 889 .WillOnce(SetMemory(result1.ptr, uint32_t(1))) |
| 890 .RetiresOnSaturation(); | 890 .RetiresOnSaturation(); |
| 891 | 891 |
| 892 GLboolean result = gl_->IsTexture(1); | 892 GLboolean result = gl_->IsTexture(1); |
| 893 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 893 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 894 EXPECT_TRUE(result); | 894 EXPECT_TRUE(result); |
| 895 } | 895 } |
| 896 | 896 |
| 897 TEST_F(GLES2ImplementationTest, LineWidth) { | 897 TEST_F(GLES2ImplementationTest, LineWidth) { |
| 898 struct Cmds { | 898 struct Cmds { |
| 899 cmds::LineWidth cmd; | 899 cmds::LineWidth cmd; |
| (...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1672 struct Cmds { | 1672 struct Cmds { |
| 1673 cmds::IsVertexArrayOES cmd; | 1673 cmds::IsVertexArrayOES cmd; |
| 1674 }; | 1674 }; |
| 1675 | 1675 |
| 1676 Cmds expected; | 1676 Cmds expected; |
| 1677 ExpectedMemoryInfo result1 = | 1677 ExpectedMemoryInfo result1 = |
| 1678 GetExpectedResultMemory(sizeof(cmds::IsVertexArrayOES::Result)); | 1678 GetExpectedResultMemory(sizeof(cmds::IsVertexArrayOES::Result)); |
| 1679 expected.cmd.Init(1, result1.id, result1.offset); | 1679 expected.cmd.Init(1, result1.id, result1.offset); |
| 1680 | 1680 |
| 1681 EXPECT_CALL(*command_buffer(), OnFlush()) | 1681 EXPECT_CALL(*command_buffer(), OnFlush()) |
| 1682 .WillOnce(SetMemory(result1.ptr, uint32(1))) | 1682 .WillOnce(SetMemory(result1.ptr, uint32_t(1))) |
| 1683 .RetiresOnSaturation(); | 1683 .RetiresOnSaturation(); |
| 1684 | 1684 |
| 1685 GLboolean result = gl_->IsVertexArrayOES(1); | 1685 GLboolean result = gl_->IsVertexArrayOES(1); |
| 1686 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1686 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1687 EXPECT_TRUE(result); | 1687 EXPECT_TRUE(result); |
| 1688 } | 1688 } |
| 1689 // TODO: Implement unit test for GenSharedIdsCHROMIUM | 1689 // TODO: Implement unit test for GenSharedIdsCHROMIUM |
| 1690 // TODO: Implement unit test for DeleteSharedIdsCHROMIUM | 1690 // TODO: Implement unit test for DeleteSharedIdsCHROMIUM |
| 1691 // TODO: Implement unit test for RegisterSharedIdsCHROMIUM | 1691 // TODO: Implement unit test for RegisterSharedIdsCHROMIUM |
| 1692 // TODO: Implement unit test for EnableFeatureCHROMIUM | 1692 // TODO: Implement unit test for EnableFeatureCHROMIUM |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1836 struct Cmds { | 1836 struct Cmds { |
| 1837 cmds::DiscardBackbufferCHROMIUM cmd; | 1837 cmds::DiscardBackbufferCHROMIUM cmd; |
| 1838 }; | 1838 }; |
| 1839 Cmds expected; | 1839 Cmds expected; |
| 1840 expected.cmd.Init(); | 1840 expected.cmd.Init(); |
| 1841 | 1841 |
| 1842 gl_->DiscardBackbufferCHROMIUM(); | 1842 gl_->DiscardBackbufferCHROMIUM(); |
| 1843 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1843 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1844 } | 1844 } |
| 1845 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_ | 1845 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_ |
| OLD | NEW |