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 8802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8813 DiscardFramebufferEXTImmediate& cmd = | 8813 DiscardFramebufferEXTImmediate& cmd = |
8814 *GetImmediateAs<DiscardFramebufferEXTImmediate>(); | 8814 *GetImmediateAs<DiscardFramebufferEXTImmediate>(); |
8815 cmd.Init(target, count, attachments); | 8815 cmd.Init(target, count, attachments); |
8816 | 8816 |
8817 // Should not result into a call into GL. | 8817 // Should not result into a call into GL. |
8818 EXPECT_EQ(error::kNoError, | 8818 EXPECT_EQ(error::kNoError, |
8819 ExecuteImmediateCmd(cmd, sizeof(attachments))); | 8819 ExecuteImmediateCmd(cmd, sizeof(attachments))); |
8820 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 8820 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
8821 } | 8821 } |
8822 | 8822 |
8823 TEST_F(GLES2DecoderManualInitTest, RestoreState) { | |
8824 InitDecoder( | |
8825 "", // extensions | |
8826 false, // has alpha | |
8827 false, // has depth | |
8828 false, // has stencil | |
8829 false, // request alpha | |
8830 false, // request depth | |
8831 false, // request stencil | |
8832 true); // bind generates resource | |
8833 SetupTexture(); | |
no sievers
2013/12/20 17:37:07
You could actually put the expectations in the rig
kaanb
2014/01/07 23:33:42
Done.
| |
8834 // TODO(kaanb): do not hardcode size | |
no sievers
2013/12/20 17:37:07
I think group().max_texture_units() is what you ar
kaanb
2014/01/07 23:33:42
Done.
| |
8835 EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE0)) | |
8836 .Times(2) | |
8837 .RetiresOnSaturation(); | |
8838 EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE1)) | |
8839 .Times(1) | |
8840 .RetiresOnSaturation(); | |
8841 EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE2)) | |
8842 .Times(1) | |
8843 .RetiresOnSaturation(); | |
8844 EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE3)) | |
8845 .Times(1) | |
8846 .RetiresOnSaturation(); | |
8847 EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE4)) | |
8848 .Times(1) | |
8849 .RetiresOnSaturation(); | |
8850 EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE5)) | |
8851 .Times(1) | |
8852 .RetiresOnSaturation(); | |
8853 EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE6)) | |
8854 .Times(1) | |
8855 .RetiresOnSaturation(); | |
8856 EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE7)) | |
8857 .Times(1) | |
8858 .RetiresOnSaturation(); | |
8859 | |
8860 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, 304)) | |
8861 .Times(1) | |
8862 .RetiresOnSaturation(); | |
8863 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, 702)) | |
8864 .Times(7) | |
8865 .RetiresOnSaturation(); | |
8866 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_CUBE_MAP, 704)) | |
8867 .Times(8) | |
8868 .RetiresOnSaturation(); | |
8869 | |
8870 GetDecoder()->RestoreAllTextureUnitBindings(NULL); | |
8871 } | |
8872 | |
8823 // TODO(gman): Complete this test. | 8873 // TODO(gman): Complete this test. |
8824 // TEST_F(GLES2DecoderTest, CompressedTexImage2DGLError) { | 8874 // TEST_F(GLES2DecoderTest, CompressedTexImage2DGLError) { |
8825 // } | 8875 // } |
8826 | 8876 |
8827 // TODO(gman): BufferData | 8877 // TODO(gman): BufferData |
8828 | 8878 |
8829 // TODO(gman): BufferDataImmediate | 8879 // TODO(gman): BufferDataImmediate |
8830 | 8880 |
8831 // TODO(gman): BufferSubData | 8881 // TODO(gman): BufferSubData |
8832 | 8882 |
(...skipping 16 matching lines...) Expand all Loading... | |
8849 // TODO(gman): TexImage2DImmediate | 8899 // TODO(gman): TexImage2DImmediate |
8850 | 8900 |
8851 // TODO(gman): TexSubImage2DImmediate | 8901 // TODO(gman): TexSubImage2DImmediate |
8852 | 8902 |
8853 // TODO(gman): UseProgram | 8903 // TODO(gman): UseProgram |
8854 | 8904 |
8855 // TODO(gman): SwapBuffers | 8905 // TODO(gman): SwapBuffers |
8856 | 8906 |
8857 } // namespace gles2 | 8907 } // namespace gles2 |
8858 } // namespace gpu | 8908 } // namespace gpu |
OLD | NEW |