| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 gl_->BindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 2, 3); | 49 gl_->BindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 2, 3); |
| 50 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 50 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 51 } | 51 } |
| 52 | 52 |
| 53 TEST_F(GLES2ImplementationTest, BindBufferRange) { | 53 TEST_F(GLES2ImplementationTest, BindBufferRange) { |
| 54 struct Cmds { | 54 struct Cmds { |
| 55 cmds::BindBufferRange cmd; | 55 cmds::BindBufferRange cmd; |
| 56 }; | 56 }; |
| 57 Cmds expected; | 57 Cmds expected; |
| 58 expected.cmd.Init(GL_TRANSFORM_FEEDBACK_BUFFER, 2, 3, 4, 5); | 58 expected.cmd.Init(GL_TRANSFORM_FEEDBACK_BUFFER, 2, 3, 4, 4); |
| 59 | 59 |
| 60 gl_->BindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 2, 3, 4, 5); | 60 gl_->BindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 2, 3, 4, 4); |
| 61 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 61 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 62 } | 62 } |
| 63 | 63 |
| 64 TEST_F(GLES2ImplementationTest, BindFramebuffer) { | 64 TEST_F(GLES2ImplementationTest, BindFramebuffer) { |
| 65 struct Cmds { | 65 struct Cmds { |
| 66 cmds::BindFramebuffer cmd; | 66 cmds::BindFramebuffer cmd; |
| 67 }; | 67 }; |
| 68 Cmds expected; | 68 Cmds expected; |
| 69 expected.cmd.Init(GL_FRAMEBUFFER, 2); | 69 expected.cmd.Init(GL_FRAMEBUFFER, 2); |
| 70 | 70 |
| (...skipping 673 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 GetActiveUniformBlockName |
| 754 // TODO(zmo): Implement unit test for GetAttachedShaders | 755 // TODO(zmo): Implement unit test for GetAttachedShaders |
| 755 // TODO(zmo): Implement unit test for GetAttribLocation | 756 // TODO(zmo): Implement unit test for GetAttribLocation |
| 756 | 757 |
| 757 TEST_F(GLES2ImplementationTest, GetBooleanv) { | 758 TEST_F(GLES2ImplementationTest, GetBooleanv) { |
| 758 struct Cmds { | 759 struct Cmds { |
| 759 cmds::GetBooleanv cmd; | 760 cmds::GetBooleanv cmd; |
| 760 }; | 761 }; |
| 761 typedef cmds::GetBooleanv::Result Result; | 762 typedef cmds::GetBooleanv::Result Result; |
| 762 Result::Type result = 0; | 763 Result::Type result = 0; |
| 763 Cmds expected; | 764 Cmds expected; |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 Cmds expected; | 977 Cmds expected; |
| 977 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); | 978 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); |
| 978 expected.cmd.Init(123, GL_TEXTURE_MAG_FILTER, result1.id, result1.offset); | 979 expected.cmd.Init(123, GL_TEXTURE_MAG_FILTER, result1.id, result1.offset); |
| 979 EXPECT_CALL(*command_buffer(), OnFlush()) | 980 EXPECT_CALL(*command_buffer(), OnFlush()) |
| 980 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1))) | 981 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1))) |
| 981 .RetiresOnSaturation(); | 982 .RetiresOnSaturation(); |
| 982 gl_->GetTexParameteriv(123, GL_TEXTURE_MAG_FILTER, &result); | 983 gl_->GetTexParameteriv(123, GL_TEXTURE_MAG_FILTER, &result); |
| 983 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 984 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 984 EXPECT_EQ(static_cast<Result::Type>(1), result); | 985 EXPECT_EQ(static_cast<Result::Type>(1), result); |
| 985 } | 986 } |
| 987 // TODO(zmo): Implement unit test for GetUniformBlockIndex |
| 986 // TODO(zmo): Implement unit test for GetUniformfv | 988 // TODO(zmo): Implement unit test for GetUniformfv |
| 987 // TODO(zmo): Implement unit test for GetUniformiv | 989 // TODO(zmo): Implement unit test for GetUniformiv |
| 988 // TODO(zmo): Implement unit test for GetUniformLocation | 990 // TODO(zmo): Implement unit test for GetUniformLocation |
| 989 | 991 |
| 990 TEST_F(GLES2ImplementationTest, GetVertexAttribfv) { | 992 TEST_F(GLES2ImplementationTest, GetVertexAttribfv) { |
| 991 struct Cmds { | 993 struct Cmds { |
| 992 cmds::GetVertexAttribfv cmd; | 994 cmds::GetVertexAttribfv cmd; |
| 993 }; | 995 }; |
| 994 typedef cmds::GetVertexAttribfv::Result Result; | 996 typedef cmds::GetVertexAttribfv::Result Result; |
| 995 Result::Type result = 0; | 997 Result::Type result = 0; |
| (...skipping 1962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2958 struct Cmds { | 2960 struct Cmds { |
| 2959 cmds::MatrixLoadIdentityCHROMIUM cmd; | 2961 cmds::MatrixLoadIdentityCHROMIUM cmd; |
| 2960 }; | 2962 }; |
| 2961 Cmds expected; | 2963 Cmds expected; |
| 2962 expected.cmd.Init(GL_PATH_PROJECTION_CHROMIUM); | 2964 expected.cmd.Init(GL_PATH_PROJECTION_CHROMIUM); |
| 2963 | 2965 |
| 2964 gl_->MatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM); | 2966 gl_->MatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM); |
| 2965 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 2967 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 2966 } | 2968 } |
| 2967 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_ | 2969 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_ |
| OLD | NEW |