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.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 8881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8892 { | 8892 { |
8893 EXPECT_CALL(*gl_, UseProgram(kServiceProgramId)) | 8893 EXPECT_CALL(*gl_, UseProgram(kServiceProgramId)) |
8894 .Times(1) | 8894 .Times(1) |
8895 .RetiresOnSaturation(); | 8895 .RetiresOnSaturation(); |
8896 cmds::UseProgram cmd; | 8896 cmds::UseProgram cmd; |
8897 cmd.Init(client_program_id_); | 8897 cmd.Init(client_program_id_); |
8898 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 8898 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
8899 } | 8899 } |
8900 } | 8900 } |
8901 | 8901 |
| 8902 TEST_F(GLES2DecoderManualInitTest, TexImage2DFloatOnGLES2) { |
| 8903 InitDecoder("GL_OES_texture_float", // extensions |
| 8904 "opengl es 2.0", // gl version |
| 8905 false, // has alpha |
| 8906 false, // has depth |
| 8907 false, // has stencil |
| 8908 false, // request alpha |
| 8909 false, // request depth |
| 8910 false, // request stencil |
| 8911 false); // bind generates resource |
| 8912 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 8913 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 17, 0, GL_RGBA, GL_FLOAT, 0, 0); |
| 8914 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 16, 17, 0, GL_RGB, GL_FLOAT, 0, 0); |
| 8915 DoTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, 16, 17, 0, GL_LUMINANCE, |
| 8916 GL_FLOAT, 0, 0); |
| 8917 DoTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, 16, 17, 0, GL_ALPHA, GL_FLOAT, |
| 8918 0, 0); |
| 8919 DoTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA, 16, 17, 0, |
| 8920 GL_LUMINANCE_ALPHA, GL_FLOAT, 0, 0); |
| 8921 } |
| 8922 |
| 8923 TEST_F(GLES2DecoderManualInitTest, TexImage2DFloatOnGLES3) { |
| 8924 InitDecoder("GL_OES_texture_float GL_EXT_color_buffer_float", // extensions |
| 8925 "opengl es 3.0", // gl version |
| 8926 false, // has alpha |
| 8927 false, // has depth |
| 8928 false, // has stencil |
| 8929 false, // request alpha |
| 8930 false, // request depth |
| 8931 false, // request stencil |
| 8932 false); // bind generates resource |
| 8933 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 8934 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 17, 0, GL_RGBA, GL_FLOAT, 0, 0); |
| 8935 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 16, 17, 0, GL_RGB, GL_FLOAT, 0, 0); |
| 8936 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, 16, 17, 0, GL_RGBA, GL_FLOAT, 0, |
| 8937 0); |
| 8938 DoTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, 16, 17, 0, GL_LUMINANCE, |
| 8939 GL_FLOAT, 0, 0); |
| 8940 DoTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, 16, 17, 0, GL_ALPHA, GL_FLOAT, |
| 8941 0, 0); |
| 8942 DoTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA, 16, 17, 0, |
| 8943 GL_LUMINANCE_ALPHA, GL_FLOAT, 0, 0); |
| 8944 } |
| 8945 |
| 8946 TEST_F(GLES2DecoderManualInitTest, TexImage2DFloatConvertsFormatDesktop) { |
| 8947 InitDecoder("GL_ARB_texture_float", // extensions |
| 8948 "2.1", // gl version |
| 8949 false, // has alpha |
| 8950 false, // has depth |
| 8951 false, // has stencil |
| 8952 false, // request alpha |
| 8953 false, // request depth |
| 8954 false, // request stencil |
| 8955 false); // bind generates resource |
| 8956 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 8957 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, 16, 17, 0, GL_RGBA, GL_FLOAT, 0, |
| 8958 0); |
| 8959 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGB32F, 16, 17, 0, GL_RGB, GL_FLOAT, 0, 0); |
| 8960 DoTexImage2DConvertInternalFormat(GL_TEXTURE_2D, 0, GL_RGBA, 16, 17, 0, |
| 8961 GL_RGBA, GL_FLOAT, 0, 0, GL_RGBA32F_ARB); |
| 8962 DoTexImage2DConvertInternalFormat(GL_TEXTURE_2D, 0, GL_RGB, 16, 17, 0, |
| 8963 GL_RGB, GL_FLOAT, 0, 0, GL_RGB32F_ARB); |
| 8964 DoTexImage2DConvertInternalFormat(GL_TEXTURE_2D, 0, GL_LUMINANCE, 16, 17, 0, |
| 8965 GL_LUMINANCE, GL_FLOAT, 0, 0, |
| 8966 GL_LUMINANCE32F_ARB); |
| 8967 DoTexImage2DConvertInternalFormat(GL_TEXTURE_2D, 0, GL_ALPHA, 16, 17, 0, |
| 8968 GL_ALPHA, GL_FLOAT, 0, 0, GL_ALPHA32F_ARB); |
| 8969 DoTexImage2DConvertInternalFormat(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA, 16, |
| 8970 17, 0, GL_LUMINANCE_ALPHA, GL_FLOAT, 0, 0, |
| 8971 GL_LUMINANCE_ALPHA32F_ARB); |
| 8972 } |
| 8973 |
8902 // TODO(gman): Complete this test. | 8974 // TODO(gman): Complete this test. |
8903 // TEST_F(GLES2DecoderTest, CompressedTexImage2DGLError) { | 8975 // TEST_F(GLES2DecoderTest, CompressedTexImage2DGLError) { |
8904 // } | 8976 // } |
8905 | 8977 |
8906 // TODO(gman): BufferData | 8978 // TODO(gman): BufferData |
8907 | 8979 |
8908 // TODO(gman): BufferDataImmediate | 8980 // TODO(gman): BufferDataImmediate |
8909 | 8981 |
8910 // TODO(gman): BufferSubData | 8982 // TODO(gman): BufferSubData |
8911 | 8983 |
(...skipping 16 matching lines...) Expand all Loading... |
8928 // TODO(gman): TexImage2DImmediate | 9000 // TODO(gman): TexImage2DImmediate |
8929 | 9001 |
8930 // TODO(gman): TexSubImage2DImmediate | 9002 // TODO(gman): TexSubImage2DImmediate |
8931 | 9003 |
8932 // TODO(gman): UseProgram | 9004 // TODO(gman): UseProgram |
8933 | 9005 |
8934 // TODO(gman): SwapBuffers | 9006 // TODO(gman): SwapBuffers |
8935 | 9007 |
8936 } // namespace gles2 | 9008 } // namespace gles2 |
8937 } // namespace gpu | 9009 } // namespace gpu |
OLD | NEW |