| 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 1786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1797 }; | 1797 }; |
| 1798 Cmds expected; | 1798 Cmds expected; |
| 1799 expected.cmd.Init(1, 2); | 1799 expected.cmd.Init(1, 2); |
| 1800 | 1800 |
| 1801 gl_->VertexAttribDivisorANGLE(1, 2); | 1801 gl_->VertexAttribDivisorANGLE(1, 2); |
| 1802 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1802 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1803 } | 1803 } |
| 1804 // TODO: Implement unit test for GenMailboxCHROMIUM | 1804 // TODO: Implement unit test for GenMailboxCHROMIUM |
| 1805 // TODO: Implement unit test for BindUniformLocationCHROMIUM | 1805 // TODO: Implement unit test for BindUniformLocationCHROMIUM |
| 1806 | 1806 |
| 1807 TEST_F(GLES2ImplementationTest, GenValuebuffersCHROMIUM) { | |
| 1808 GLuint ids[2] = { | |
| 1809 0, | |
| 1810 }; | |
| 1811 struct Cmds { | |
| 1812 cmds::GenValuebuffersCHROMIUMImmediate gen; | |
| 1813 GLuint data[2]; | |
| 1814 }; | |
| 1815 Cmds expected; | |
| 1816 expected.gen.Init(arraysize(ids), &ids[0]); | |
| 1817 expected.data[0] = kValuebuffersStartId; | |
| 1818 expected.data[1] = kValuebuffersStartId + 1; | |
| 1819 gl_->GenValuebuffersCHROMIUM(arraysize(ids), &ids[0]); | |
| 1820 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | |
| 1821 EXPECT_EQ(kValuebuffersStartId, ids[0]); | |
| 1822 EXPECT_EQ(kValuebuffersStartId + 1, ids[1]); | |
| 1823 } | |
| 1824 | |
| 1825 TEST_F(GLES2ImplementationTest, DeleteValuebuffersCHROMIUM) { | |
| 1826 GLuint ids[2] = {kValuebuffersStartId, kValuebuffersStartId + 1}; | |
| 1827 struct Cmds { | |
| 1828 cmds::DeleteValuebuffersCHROMIUMImmediate del; | |
| 1829 GLuint data[2]; | |
| 1830 }; | |
| 1831 Cmds expected; | |
| 1832 expected.del.Init(arraysize(ids), &ids[0]); | |
| 1833 expected.data[0] = kValuebuffersStartId; | |
| 1834 expected.data[1] = kValuebuffersStartId + 1; | |
| 1835 gl_->DeleteValuebuffersCHROMIUM(arraysize(ids), &ids[0]); | |
| 1836 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | |
| 1837 } | |
| 1838 | |
| 1839 TEST_F(GLES2ImplementationTest, IsValuebufferCHROMIUM) { | |
| 1840 struct Cmds { | |
| 1841 cmds::IsValuebufferCHROMIUM cmd; | |
| 1842 }; | |
| 1843 | |
| 1844 Cmds expected; | |
| 1845 ExpectedMemoryInfo result1 = | |
| 1846 GetExpectedResultMemory(sizeof(cmds::IsValuebufferCHROMIUM::Result)); | |
| 1847 expected.cmd.Init(1, result1.id, result1.offset); | |
| 1848 | |
| 1849 EXPECT_CALL(*command_buffer(), OnFlush()) | |
| 1850 .WillOnce(SetMemory(result1.ptr, uint32_t(1))) | |
| 1851 .RetiresOnSaturation(); | |
| 1852 | |
| 1853 GLboolean result = gl_->IsValuebufferCHROMIUM(1); | |
| 1854 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | |
| 1855 EXPECT_TRUE(result); | |
| 1856 } | |
| 1857 | |
| 1858 TEST_F(GLES2ImplementationTest, BindValuebufferCHROMIUM) { | |
| 1859 struct Cmds { | |
| 1860 cmds::BindValuebufferCHROMIUM cmd; | |
| 1861 }; | |
| 1862 Cmds expected; | |
| 1863 expected.cmd.Init(GL_SUBSCRIBED_VALUES_BUFFER_CHROMIUM, 2); | |
| 1864 | |
| 1865 gl_->BindValuebufferCHROMIUM(GL_SUBSCRIBED_VALUES_BUFFER_CHROMIUM, 2); | |
| 1866 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | |
| 1867 ClearCommands(); | |
| 1868 gl_->BindValuebufferCHROMIUM(GL_SUBSCRIBED_VALUES_BUFFER_CHROMIUM, 2); | |
| 1869 EXPECT_TRUE(NoCommandsWritten()); | |
| 1870 } | |
| 1871 | |
| 1872 TEST_F(GLES2ImplementationTest, SubscribeValueCHROMIUM) { | |
| 1873 struct Cmds { | |
| 1874 cmds::SubscribeValueCHROMIUM cmd; | |
| 1875 }; | |
| 1876 Cmds expected; | |
| 1877 expected.cmd.Init(GL_SUBSCRIBED_VALUES_BUFFER_CHROMIUM, | |
| 1878 GL_MOUSE_POSITION_CHROMIUM); | |
| 1879 | |
| 1880 gl_->SubscribeValueCHROMIUM(GL_SUBSCRIBED_VALUES_BUFFER_CHROMIUM, | |
| 1881 GL_MOUSE_POSITION_CHROMIUM); | |
| 1882 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | |
| 1883 } | |
| 1884 | |
| 1885 TEST_F(GLES2ImplementationTest, PopulateSubscribedValuesCHROMIUM) { | |
| 1886 struct Cmds { | |
| 1887 cmds::PopulateSubscribedValuesCHROMIUM cmd; | |
| 1888 }; | |
| 1889 Cmds expected; | |
| 1890 expected.cmd.Init(GL_SUBSCRIBED_VALUES_BUFFER_CHROMIUM); | |
| 1891 | |
| 1892 gl_->PopulateSubscribedValuesCHROMIUM(GL_SUBSCRIBED_VALUES_BUFFER_CHROMIUM); | |
| 1893 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | |
| 1894 } | |
| 1895 | |
| 1896 TEST_F(GLES2ImplementationTest, UniformValuebufferCHROMIUM) { | |
| 1897 struct Cmds { | |
| 1898 cmds::UniformValuebufferCHROMIUM cmd; | |
| 1899 }; | |
| 1900 Cmds expected; | |
| 1901 expected.cmd.Init(1, GL_SUBSCRIBED_VALUES_BUFFER_CHROMIUM, | |
| 1902 GL_MOUSE_POSITION_CHROMIUM); | |
| 1903 | |
| 1904 gl_->UniformValuebufferCHROMIUM(1, GL_SUBSCRIBED_VALUES_BUFFER_CHROMIUM, | |
| 1905 GL_MOUSE_POSITION_CHROMIUM); | |
| 1906 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | |
| 1907 } | |
| 1908 | |
| 1909 TEST_F(GLES2ImplementationTest, BindTexImage2DCHROMIUM) { | 1807 TEST_F(GLES2ImplementationTest, BindTexImage2DCHROMIUM) { |
| 1910 struct Cmds { | 1808 struct Cmds { |
| 1911 cmds::BindTexImage2DCHROMIUM cmd; | 1809 cmds::BindTexImage2DCHROMIUM cmd; |
| 1912 }; | 1810 }; |
| 1913 Cmds expected; | 1811 Cmds expected; |
| 1914 expected.cmd.Init(GL_TEXTURE_2D, 2); | 1812 expected.cmd.Init(GL_TEXTURE_2D, 2); |
| 1915 | 1813 |
| 1916 gl_->BindTexImage2DCHROMIUM(GL_TEXTURE_2D, 2); | 1814 gl_->BindTexImage2DCHROMIUM(GL_TEXTURE_2D, 2); |
| 1917 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1815 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1918 } | 1816 } |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2019 struct Cmds { | 1917 struct Cmds { |
| 2020 cmds::MatrixLoadIdentityCHROMIUM cmd; | 1918 cmds::MatrixLoadIdentityCHROMIUM cmd; |
| 2021 }; | 1919 }; |
| 2022 Cmds expected; | 1920 Cmds expected; |
| 2023 expected.cmd.Init(GL_PATH_PROJECTION_CHROMIUM); | 1921 expected.cmd.Init(GL_PATH_PROJECTION_CHROMIUM); |
| 2024 | 1922 |
| 2025 gl_->MatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM); | 1923 gl_->MatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM); |
| 2026 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1924 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 2027 } | 1925 } |
| 2028 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_ | 1926 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_ |
| OLD | NEW |