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 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 | 967 |
968 EXPECT_CALL(*gl_, DrawArraysInstancedANGLE(_, _, _, _)) | 968 EXPECT_CALL(*gl_, DrawArraysInstancedANGLE(_, _, _, _)) |
969 .Times(0) | 969 .Times(0) |
970 .RetiresOnSaturation(); | 970 .RetiresOnSaturation(); |
971 DrawArraysInstancedANGLE cmd; | 971 DrawArraysInstancedANGLE cmd; |
972 cmd.Init(GL_TRIANGLES, 0, kNumVertices, 1); | 972 cmd.Init(GL_TRIANGLES, 0, kNumVertices, 1); |
973 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 973 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
974 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 974 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
975 } | 975 } |
976 | 976 |
| 977 TEST_P(GLES2DecoderWithShaderTest, VertexAttribDivisorANGLEFails) { |
| 978 SetupTexture(); |
| 979 SetupVertexBuffer(); |
| 980 DoEnableVertexAttribArray(1); |
| 981 DoVertexAttribPointer(1, 2, GL_FLOAT, 0, 0); |
| 982 |
| 983 EXPECT_CALL(*gl_, VertexAttribDivisorANGLE(_, _)) |
| 984 .Times(0) |
| 985 .RetiresOnSaturation(); |
| 986 |
| 987 VertexAttribDivisorANGLE cmd; |
| 988 cmd.Init(0, 1); |
| 989 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 990 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 991 } |
| 992 |
977 TEST_P(GLES2DecoderGeometryInstancingTest, | 993 TEST_P(GLES2DecoderGeometryInstancingTest, |
978 DrawArraysInstancedANGLENoAttributesFails) { | 994 DrawArraysInstancedANGLENoAttributesFails) { |
979 SetupTexture(); | 995 SetupTexture(); |
980 | 996 |
981 EXPECT_CALL(*gl_, DrawArraysInstancedANGLE(_, _, _, _)) | 997 EXPECT_CALL(*gl_, DrawArraysInstancedANGLE(_, _, _, _)) |
982 .Times(0) | 998 .Times(0) |
983 .RetiresOnSaturation(); | 999 .RetiresOnSaturation(); |
984 DrawArraysInstancedANGLE cmd; | 1000 DrawArraysInstancedANGLE cmd; |
985 cmd.Init(GL_TRIANGLES, 0, kNumVertices, 1); | 1001 cmd.Init(GL_TRIANGLES, 0, kNumVertices, 1); |
986 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 1002 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
(...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2259 .Times(1) | 2275 .Times(1) |
2260 .RetiresOnSaturation(); | 2276 .RetiresOnSaturation(); |
2261 DrawArrays cmd; | 2277 DrawArrays cmd; |
2262 cmd.Init(GL_TRIANGLES, 0, kNumVertices); | 2278 cmd.Init(GL_TRIANGLES, 0, kNumVertices); |
2263 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 2279 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
2264 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 2280 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
2265 } | 2281 } |
2266 | 2282 |
2267 } // namespace gles2 | 2283 } // namespace gles2 |
2268 } // namespace gpu | 2284 } // namespace gpu |
OLD | NEW |