| 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 <limits.h> | 7 #include <limits.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 912 false); | 912 false); |
| 913 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 913 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 914 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 914 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 915 } | 915 } |
| 916 | 916 |
| 917 TEST_P(GLES2DecoderManualInitTest, ReadPixels2RowLengthWorkaround) { | 917 TEST_P(GLES2DecoderManualInitTest, ReadPixels2RowLengthWorkaround) { |
| 918 base::CommandLine command_line(0, NULL); | 918 base::CommandLine command_line(0, NULL); |
| 919 command_line.AppendSwitchASCII( | 919 command_line.AppendSwitchASCII( |
| 920 switches::kGpuDriverBugWorkarounds, | 920 switches::kGpuDriverBugWorkarounds, |
| 921 base::IntToString(gpu::PACK_PARAMETERS_WORKAROUND_WITH_PACK_BUFFER)); | 921 base::IntToString(gpu::PACK_PARAMETERS_WORKAROUND_WITH_PACK_BUFFER)); |
| 922 command_line.AppendSwitch(switches::kEnableUnsafeES3APIs); | |
| 923 InitState init; | 922 InitState init; |
| 924 init.gl_version = "OpenGL ES 3.0"; | 923 init.gl_version = "OpenGL ES 3.0"; |
| 925 init.bind_generates_resource = true; | 924 init.bind_generates_resource = true; |
| 926 init.context_type = CONTEXT_TYPE_OPENGLES3; | 925 init.context_type = CONTEXT_TYPE_OPENGLES3; |
| 927 InitDecoderWithCommandLine(init, &command_line); | 926 InitDecoderWithCommandLine(init, &command_line); |
| 928 | 927 |
| 929 const GLsizei kWidth = 5; | 928 const GLsizei kWidth = 5; |
| 930 const GLsizei kHeight = 3; | 929 const GLsizei kHeight = 3; |
| 931 const GLint kBytesPerPixel = 4; | 930 const GLint kBytesPerPixel = 4; |
| 932 const GLenum kFormat = GL_RGBA; | 931 const GLenum kFormat = GL_RGBA; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 false); | 965 false); |
| 967 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 966 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 968 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 967 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 969 } | 968 } |
| 970 | 969 |
| 971 TEST_P(GLES2DecoderManualInitTest, ReadPixels2AlignmentWorkaround) { | 970 TEST_P(GLES2DecoderManualInitTest, ReadPixels2AlignmentWorkaround) { |
| 972 base::CommandLine command_line(0, NULL); | 971 base::CommandLine command_line(0, NULL); |
| 973 command_line.AppendSwitchASCII( | 972 command_line.AppendSwitchASCII( |
| 974 switches::kGpuDriverBugWorkarounds, | 973 switches::kGpuDriverBugWorkarounds, |
| 975 base::IntToString(gpu::PACK_PARAMETERS_WORKAROUND_WITH_PACK_BUFFER)); | 974 base::IntToString(gpu::PACK_PARAMETERS_WORKAROUND_WITH_PACK_BUFFER)); |
| 976 command_line.AppendSwitch(switches::kEnableUnsafeES3APIs); | |
| 977 InitState init; | 975 InitState init; |
| 978 init.gl_version = "OpenGL ES 3.0"; | 976 init.gl_version = "OpenGL ES 3.0"; |
| 979 init.bind_generates_resource = true; | 977 init.bind_generates_resource = true; |
| 980 init.context_type = CONTEXT_TYPE_OPENGLES3; | 978 init.context_type = CONTEXT_TYPE_OPENGLES3; |
| 981 InitDecoderWithCommandLine(init, &command_line); | 979 InitDecoderWithCommandLine(init, &command_line); |
| 982 | 980 |
| 983 const GLsizei kWidth = 5; | 981 const GLsizei kWidth = 5; |
| 984 const GLsizei kHeight = 3; | 982 const GLsizei kHeight = 3; |
| 985 const GLint kBytesPerPixel = 4; | 983 const GLint kBytesPerPixel = 4; |
| 986 const GLenum kFormat = GL_RGBA; | 984 const GLenum kFormat = GL_RGBA; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1022 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 1020 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 1023 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 1021 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 1024 } | 1022 } |
| 1025 | 1023 |
| 1026 TEST_P(GLES2DecoderManualInitTest, | 1024 TEST_P(GLES2DecoderManualInitTest, |
| 1027 ReadPixels2RowLengthAndAlignmentWorkarounds) { | 1025 ReadPixels2RowLengthAndAlignmentWorkarounds) { |
| 1028 base::CommandLine command_line(0, NULL); | 1026 base::CommandLine command_line(0, NULL); |
| 1029 command_line.AppendSwitchASCII( | 1027 command_line.AppendSwitchASCII( |
| 1030 switches::kGpuDriverBugWorkarounds, | 1028 switches::kGpuDriverBugWorkarounds, |
| 1031 base::IntToString(gpu::PACK_PARAMETERS_WORKAROUND_WITH_PACK_BUFFER)); | 1029 base::IntToString(gpu::PACK_PARAMETERS_WORKAROUND_WITH_PACK_BUFFER)); |
| 1032 command_line.AppendSwitch(switches::kEnableUnsafeES3APIs); | |
| 1033 InitState init; | 1030 InitState init; |
| 1034 init.gl_version = "OpenGL ES 3.0"; | 1031 init.gl_version = "OpenGL ES 3.0"; |
| 1035 init.bind_generates_resource = true; | 1032 init.bind_generates_resource = true; |
| 1036 init.context_type = CONTEXT_TYPE_OPENGLES3; | 1033 init.context_type = CONTEXT_TYPE_OPENGLES3; |
| 1037 InitDecoderWithCommandLine(init, &command_line); | 1034 InitDecoderWithCommandLine(init, &command_line); |
| 1038 | 1035 |
| 1039 const GLsizei kWidth = 5; | 1036 const GLsizei kWidth = 5; |
| 1040 const GLsizei kHeight = 3; | 1037 const GLsizei kHeight = 3; |
| 1041 const GLint kBytesPerPixel = 4; | 1038 const GLint kBytesPerPixel = 4; |
| 1042 const GLenum kFormat = GL_RGBA; | 1039 const GLenum kFormat = GL_RGBA; |
| (...skipping 2802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3845 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 3842 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 3846 } | 3843 } |
| 3847 } | 3844 } |
| 3848 | 3845 |
| 3849 // TODO(gman): PixelStorei | 3846 // TODO(gman): PixelStorei |
| 3850 | 3847 |
| 3851 // TODO(gman): SwapBuffers | 3848 // TODO(gman): SwapBuffers |
| 3852 | 3849 |
| 3853 } // namespace gles2 | 3850 } // namespace gles2 |
| 3854 } // namespace gpu | 3851 } // namespace gpu |
| OLD | NEW |