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 8806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8817 AddExpectationsForActiveTexture(GL_TEXTURE1); | 8817 AddExpectationsForActiveTexture(GL_TEXTURE1); |
8818 AddExpectationsForBindTexture(GL_TEXTURE_2D, | 8818 AddExpectationsForBindTexture(GL_TEXTURE_2D, |
8819 TestHelper::kServiceDefaultTexture2dId); | 8819 TestHelper::kServiceDefaultTexture2dId); |
8820 | 8820 |
8821 // Expect to restore active texture unit to GL_TEXTURE0. | 8821 // Expect to restore active texture unit to GL_TEXTURE0. |
8822 AddExpectationsForActiveTexture(GL_TEXTURE0); | 8822 AddExpectationsForActiveTexture(GL_TEXTURE0); |
8823 | 8823 |
8824 GetDecoder()->RestoreAllTextureUnitBindings(&prev_state); | 8824 GetDecoder()->RestoreAllTextureUnitBindings(&prev_state); |
8825 } | 8825 } |
8826 | 8826 |
| 8827 TEST_F(GLES2DecoderManualInitTest, TexImage2DFloatOnGLES2) { |
| 8828 InitDecoder("GL_OES_texture_float", // extensions |
| 8829 "opengl es 2.0", // gl version |
| 8830 false, // has alpha |
| 8831 false, // has depth |
| 8832 false, // has stencil |
| 8833 false, // request alpha |
| 8834 false, // request depth |
| 8835 false, // request stencil |
| 8836 false); // bind generates resource |
| 8837 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 8838 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 17, 0, GL_RGBA, GL_FLOAT, 0, 0); |
| 8839 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 16, 17, 0, GL_RGB, GL_FLOAT, 0, 0); |
| 8840 DoTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, 16, 17, 0, GL_LUMINANCE, |
| 8841 GL_FLOAT, 0, 0); |
| 8842 DoTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, 16, 17, 0, GL_ALPHA, GL_FLOAT, |
| 8843 0, 0); |
| 8844 DoTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA, 16, 17, 0, |
| 8845 GL_LUMINANCE_ALPHA, GL_FLOAT, 0, 0); |
| 8846 } |
| 8847 |
| 8848 TEST_F(GLES2DecoderManualInitTest, TexImage2DFloatConvertsFormatDesktop) { |
| 8849 InitDecoder("GL_ARB_texture_float", // extensions |
| 8850 "2.1", // gl version |
| 8851 false, // has alpha |
| 8852 false, // has depth |
| 8853 false, // has stencil |
| 8854 false, // request alpha |
| 8855 false, // request depth |
| 8856 false, // request stencil |
| 8857 false); // bind generates resource |
| 8858 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 8859 DoTexImage2DConvertInternalFormat(GL_TEXTURE_2D, 0, GL_RGBA, 16, 17, 0, |
| 8860 GL_RGBA, GL_FLOAT, 0, 0, GL_RGBA32F_ARB); |
| 8861 DoTexImage2DConvertInternalFormat(GL_TEXTURE_2D, 0, GL_RGB, 16, 17, 0, |
| 8862 GL_RGB, GL_FLOAT, 0, 0, GL_RGB32F_ARB); |
| 8863 DoTexImage2DConvertInternalFormat(GL_TEXTURE_2D, 0, GL_LUMINANCE, 16, 17, 0, |
| 8864 GL_LUMINANCE, GL_FLOAT, 0, 0, |
| 8865 GL_LUMINANCE32F_ARB); |
| 8866 DoTexImage2DConvertInternalFormat(GL_TEXTURE_2D, 0, GL_ALPHA, 16, 17, 0, |
| 8867 GL_ALPHA, GL_FLOAT, 0, 0, GL_ALPHA32F_ARB); |
| 8868 DoTexImage2DConvertInternalFormat(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA, 16, |
| 8869 17, 0, GL_LUMINANCE_ALPHA, GL_FLOAT, 0, 0, |
| 8870 GL_LUMINANCE_ALPHA32F_ARB); |
| 8871 } |
| 8872 |
| 8873 |
8827 // TODO(gman): Complete this test. | 8874 // TODO(gman): Complete this test. |
8828 // TEST_F(GLES2DecoderTest, CompressedTexImage2DGLError) { | 8875 // TEST_F(GLES2DecoderTest, CompressedTexImage2DGLError) { |
8829 // } | 8876 // } |
8830 | 8877 |
8831 // TODO(gman): BufferData | 8878 // TODO(gman): BufferData |
8832 | 8879 |
8833 // TODO(gman): BufferDataImmediate | 8880 // TODO(gman): BufferDataImmediate |
8834 | 8881 |
8835 // TODO(gman): BufferSubData | 8882 // TODO(gman): BufferSubData |
8836 | 8883 |
(...skipping 16 matching lines...) Expand all Loading... |
8853 // TODO(gman): TexImage2DImmediate | 8900 // TODO(gman): TexImage2DImmediate |
8854 | 8901 |
8855 // TODO(gman): TexSubImage2DImmediate | 8902 // TODO(gman): TexSubImage2DImmediate |
8856 | 8903 |
8857 // TODO(gman): UseProgram | 8904 // TODO(gman): UseProgram |
8858 | 8905 |
8859 // TODO(gman): SwapBuffers | 8906 // TODO(gman): SwapBuffers |
8860 | 8907 |
8861 } // namespace gles2 | 8908 } // namespace gles2 |
8862 } // namespace gpu | 8909 } // namespace gpu |
OLD | NEW |