| 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 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 1792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1803 GLenum internal_format = GL_RGBA; | 1803 GLenum internal_format = GL_RGBA; |
| 1804 GLsizei width = 2; | 1804 GLsizei width = 2; |
| 1805 GLsizei height = 4; | 1805 GLsizei height = 4; |
| 1806 GLenum format = GL_RGBA; | 1806 GLenum format = GL_RGBA; |
| 1807 GLenum type = GL_UNSIGNED_BYTE; | 1807 GLenum type = GL_UNSIGNED_BYTE; |
| 1808 | 1808 |
| 1809 DoBindTexture( | 1809 DoBindTexture( |
| 1810 GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId); | 1810 GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId); |
| 1811 ASSERT_TRUE(GetTexture(client_texture_id_) != NULL); | 1811 ASSERT_TRUE(GetTexture(client_texture_id_) != NULL); |
| 1812 | 1812 |
| 1813 EXPECT_CALL(*gl_, GetError()) |
| 1814 .WillOnce(Return(GL_NO_ERROR)) |
| 1815 .WillOnce(Return(GL_NO_ERROR)) |
| 1816 .RetiresOnSaturation(); |
| 1817 EXPECT_CALL(*gl_, |
| 1818 TexImage2D(target, |
| 1819 level, |
| 1820 internal_format, |
| 1821 width, |
| 1822 height, |
| 1823 0, |
| 1824 format, |
| 1825 type, |
| 1826 _)) |
| 1827 .Times(1) |
| 1828 .RetiresOnSaturation(); |
| 1829 |
| 1813 TexImage2D cmd; | 1830 TexImage2D cmd; |
| 1814 cmd.Init(target, | 1831 cmd.Init(target, |
| 1815 level, | 1832 level, |
| 1816 internal_format, | 1833 internal_format, |
| 1817 width, | 1834 width, |
| 1818 height, | 1835 height, |
| 1819 format, | 1836 format, |
| 1820 type, | 1837 type, |
| 1821 kSharedMemoryId, | 1838 kSharedMemoryId, |
| 1822 kSharedMemoryOffset); | 1839 kSharedMemoryOffset); |
| 1823 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 1840 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 1824 | 1841 |
| 1825 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); | 1842 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 1826 } | 1843 } |
| 1827 | 1844 |
| 1828 TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleTexImage2DInvalid) { | 1845 TEST_P(GLES2DecoderManualInitTest, ARBTextureRectangleTexImage2DInvalid) { |
| 1829 InitState init; | 1846 InitState init; |
| 1830 init.extensions = "GL_ARB_texture_rectangle"; | 1847 init.extensions = "GL_ARB_texture_rectangle"; |
| 1831 init.bind_generates_resource = true; | 1848 init.bind_generates_resource = true; |
| 1832 InitDecoder(init); | 1849 InitDecoder(init); |
| 1833 | 1850 |
| 1834 GLenum target = GL_TEXTURE_RECTANGLE_ARB; | 1851 GLenum target = GL_TEXTURE_RECTANGLE_ARB; |
| 1835 GLint level = 1; | 1852 GLint level = 1; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1848 level, | 1865 level, |
| 1849 internal_format, | 1866 internal_format, |
| 1850 width, | 1867 width, |
| 1851 height, | 1868 height, |
| 1852 format, | 1869 format, |
| 1853 type, | 1870 type, |
| 1854 kSharedMemoryId, | 1871 kSharedMemoryId, |
| 1855 kSharedMemoryOffset); | 1872 kSharedMemoryOffset); |
| 1856 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 1873 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 1857 | 1874 |
| 1858 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); | 1875 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); |
| 1859 } | 1876 } |
| 1860 | 1877 |
| 1861 TEST_P(GLES2DecoderManualInitTest, TexSubImage2DClearsAfterTexImage2DNULL) { | 1878 TEST_P(GLES2DecoderManualInitTest, TexSubImage2DClearsAfterTexImage2DNULL) { |
| 1862 InitState init; | 1879 InitState init; |
| 1863 init.gl_version = "opengl es 2.0"; | 1880 init.gl_version = "opengl es 2.0"; |
| 1864 init.has_alpha = true; | 1881 init.has_alpha = true; |
| 1865 init.has_depth = true; | 1882 init.has_depth = true; |
| 1866 init.request_alpha = true; | 1883 init.request_alpha = true; |
| 1867 init.request_depth = true; | 1884 init.request_depth = true; |
| 1868 InitDecoder(init); | 1885 InitDecoder(init); |
| (...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3367 // TODO(gman): CompressedTexSubImage2DImmediate | 3384 // TODO(gman): CompressedTexSubImage2DImmediate |
| 3368 | 3385 |
| 3369 // TODO(gman): TexImage2D | 3386 // TODO(gman): TexImage2D |
| 3370 | 3387 |
| 3371 // TODO(gman): TexImage2DImmediate | 3388 // TODO(gman): TexImage2DImmediate |
| 3372 | 3389 |
| 3373 // TODO(gman): TexSubImage2DImmediate | 3390 // TODO(gman): TexSubImage2DImmediate |
| 3374 | 3391 |
| 3375 } // namespace gles2 | 3392 } // namespace gles2 |
| 3376 } // namespace gpu | 3393 } // namespace gpu |
| OLD | NEW |