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 // This file is auto-generated from | 5 // This file is auto-generated from |
6 // gpu/command_buffer/build_gles2_cmd_buffer.py | 6 // gpu/command_buffer/build_gles2_cmd_buffer.py |
7 // It's formatted by clang-format using chromium coding style: | 7 // It's formatted by clang-format using chromium coding style: |
8 // clang-format -i -style=chromium filename | 8 // clang-format -i -style=chromium filename |
9 // DO NOT EDIT! | 9 // DO NOT EDIT! |
10 | 10 |
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 expected.gen.Init(arraysize(ids), &ids[0]); | 744 expected.gen.Init(arraysize(ids), &ids[0]); |
745 expected.data[0] = kTransformFeedbacksStartId; | 745 expected.data[0] = kTransformFeedbacksStartId; |
746 expected.data[1] = kTransformFeedbacksStartId + 1; | 746 expected.data[1] = kTransformFeedbacksStartId + 1; |
747 gl_->GenTransformFeedbacks(arraysize(ids), &ids[0]); | 747 gl_->GenTransformFeedbacks(arraysize(ids), &ids[0]); |
748 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 748 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
749 EXPECT_EQ(kTransformFeedbacksStartId, ids[0]); | 749 EXPECT_EQ(kTransformFeedbacksStartId, ids[0]); |
750 EXPECT_EQ(kTransformFeedbacksStartId + 1, ids[1]); | 750 EXPECT_EQ(kTransformFeedbacksStartId + 1, ids[1]); |
751 } | 751 } |
752 // TODO(zmo): Implement unit test for GetActiveAttrib | 752 // TODO(zmo): Implement unit test for GetActiveAttrib |
753 // TODO(zmo): Implement unit test for GetActiveUniform | 753 // TODO(zmo): Implement unit test for GetActiveUniform |
| 754 // TODO(zmo): Implement unit test for GetActiveUniformBlockiv |
754 // TODO(zmo): Implement unit test for GetActiveUniformBlockName | 755 // TODO(zmo): Implement unit test for GetActiveUniformBlockName |
| 756 // TODO(zmo): Implement unit test for GetActiveUniformsiv |
755 // TODO(zmo): Implement unit test for GetAttachedShaders | 757 // TODO(zmo): Implement unit test for GetAttachedShaders |
756 // TODO(zmo): Implement unit test for GetAttribLocation | 758 // TODO(zmo): Implement unit test for GetAttribLocation |
757 | 759 |
758 TEST_F(GLES2ImplementationTest, GetBooleanv) { | 760 TEST_F(GLES2ImplementationTest, GetBooleanv) { |
759 struct Cmds { | 761 struct Cmds { |
760 cmds::GetBooleanv cmd; | 762 cmds::GetBooleanv cmd; |
761 }; | 763 }; |
762 typedef cmds::GetBooleanv::Result Result; | 764 typedef cmds::GetBooleanv::Result Result; |
763 Result::Type result = 0; | 765 Result::Type result = 0; |
764 Cmds expected; | 766 Cmds expected; |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 Cmds expected; | 979 Cmds expected; |
978 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); | 980 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); |
979 expected.cmd.Init(123, GL_TEXTURE_MAG_FILTER, result1.id, result1.offset); | 981 expected.cmd.Init(123, GL_TEXTURE_MAG_FILTER, result1.id, result1.offset); |
980 EXPECT_CALL(*command_buffer(), OnFlush()) | 982 EXPECT_CALL(*command_buffer(), OnFlush()) |
981 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1))) | 983 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1))) |
982 .RetiresOnSaturation(); | 984 .RetiresOnSaturation(); |
983 gl_->GetTexParameteriv(123, GL_TEXTURE_MAG_FILTER, &result); | 985 gl_->GetTexParameteriv(123, GL_TEXTURE_MAG_FILTER, &result); |
984 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 986 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
985 EXPECT_EQ(static_cast<Result::Type>(1), result); | 987 EXPECT_EQ(static_cast<Result::Type>(1), result); |
986 } | 988 } |
| 989 // TODO(zmo): Implement unit test for GetTransformFeedbackVarying |
987 // TODO(zmo): Implement unit test for GetUniformBlockIndex | 990 // TODO(zmo): Implement unit test for GetUniformBlockIndex |
988 // TODO(zmo): Implement unit test for GetUniformfv | 991 // TODO(zmo): Implement unit test for GetUniformfv |
989 // TODO(zmo): Implement unit test for GetUniformiv | 992 // TODO(zmo): Implement unit test for GetUniformiv |
| 993 // TODO(zmo): Implement unit test for GetUniformIndices |
990 // TODO(zmo): Implement unit test for GetUniformLocation | 994 // TODO(zmo): Implement unit test for GetUniformLocation |
991 | 995 |
992 TEST_F(GLES2ImplementationTest, GetVertexAttribfv) { | 996 TEST_F(GLES2ImplementationTest, GetVertexAttribfv) { |
993 struct Cmds { | 997 struct Cmds { |
994 cmds::GetVertexAttribfv cmd; | 998 cmds::GetVertexAttribfv cmd; |
995 }; | 999 }; |
996 typedef cmds::GetVertexAttribfv::Result Result; | 1000 typedef cmds::GetVertexAttribfv::Result Result; |
997 Result::Type result = 0; | 1001 Result::Type result = 0; |
998 Cmds expected; | 1002 Cmds expected; |
999 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); | 1003 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); |
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2025 for (int ii = 0; ii < 2; ++ii) { | 2029 for (int ii = 0; ii < 2; ++ii) { |
2026 for (int jj = 0; jj < 4; ++jj) { | 2030 for (int jj = 0; jj < 4; ++jj) { |
2027 data[ii][jj] = static_cast<GLuint>(ii * 4 + jj); | 2031 data[ii][jj] = static_cast<GLuint>(ii * 4 + jj); |
2028 } | 2032 } |
2029 } | 2033 } |
2030 expected.cmd.Init(1, 2, &data[0][0]); | 2034 expected.cmd.Init(1, 2, &data[0][0]); |
2031 gl_->Uniform4uiv(1, 2, &data[0][0]); | 2035 gl_->Uniform4uiv(1, 2, &data[0][0]); |
2032 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 2036 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
2033 } | 2037 } |
2034 | 2038 |
| 2039 TEST_F(GLES2ImplementationTest, UniformBlockBinding) { |
| 2040 struct Cmds { |
| 2041 cmds::UniformBlockBinding cmd; |
| 2042 }; |
| 2043 Cmds expected; |
| 2044 expected.cmd.Init(1, 2, 3); |
| 2045 |
| 2046 gl_->UniformBlockBinding(1, 2, 3); |
| 2047 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 2048 } |
| 2049 |
2035 TEST_F(GLES2ImplementationTest, UniformMatrix2fv) { | 2050 TEST_F(GLES2ImplementationTest, UniformMatrix2fv) { |
2036 GLfloat data[2][4] = {{0}}; | 2051 GLfloat data[2][4] = {{0}}; |
2037 struct Cmds { | 2052 struct Cmds { |
2038 cmds::UniformMatrix2fvImmediate cmd; | 2053 cmds::UniformMatrix2fvImmediate cmd; |
2039 GLfloat data[2][4]; | 2054 GLfloat data[2][4]; |
2040 }; | 2055 }; |
2041 | 2056 |
2042 Cmds expected; | 2057 Cmds expected; |
2043 for (int ii = 0; ii < 2; ++ii) { | 2058 for (int ii = 0; ii < 2; ++ii) { |
2044 for (int jj = 0; jj < 4; ++jj) { | 2059 for (int jj = 0; jj < 4; ++jj) { |
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2960 struct Cmds { | 2975 struct Cmds { |
2961 cmds::MatrixLoadIdentityCHROMIUM cmd; | 2976 cmds::MatrixLoadIdentityCHROMIUM cmd; |
2962 }; | 2977 }; |
2963 Cmds expected; | 2978 Cmds expected; |
2964 expected.cmd.Init(GL_PATH_PROJECTION_CHROMIUM); | 2979 expected.cmd.Init(GL_PATH_PROJECTION_CHROMIUM); |
2965 | 2980 |
2966 gl_->MatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM); | 2981 gl_->MatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM); |
2967 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 2982 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
2968 } | 2983 } |
2969 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_ | 2984 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_ |
OLD | NEW |