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