Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(477)

Side by Side Diff: gpu/command_buffer/client/gles2_implementation_unittest_autogen.h

Issue 780433006: Add framebuffer object related commands to command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tex
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 struct Cmds { 803 struct Cmds {
804 cmds::Hint cmd; 804 cmds::Hint cmd;
805 }; 805 };
806 Cmds expected; 806 Cmds expected;
807 expected.cmd.Init(GL_GENERATE_MIPMAP_HINT, GL_FASTEST); 807 expected.cmd.Init(GL_GENERATE_MIPMAP_HINT, GL_FASTEST);
808 808
809 gl_->Hint(GL_GENERATE_MIPMAP_HINT, GL_FASTEST); 809 gl_->Hint(GL_GENERATE_MIPMAP_HINT, GL_FASTEST);
810 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); 810 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
811 } 811 }
812 812
813 TEST_F(GLES2ImplementationTest, InvalidateFramebuffer) {
814 GLenum data[2][1] = {{0}};
815 struct Cmds {
816 cmds::InvalidateFramebufferImmediate cmd;
817 GLenum data[2][1];
818 };
819
820 Cmds expected;
821 for (int ii = 0; ii < 2; ++ii) {
822 for (int jj = 0; jj < 1; ++jj) {
823 data[ii][jj] = static_cast<GLenum>(ii * 1 + jj);
824 }
825 }
826 expected.cmd.Init(GL_FRAMEBUFFER, 2, &data[0][0]);
827 gl_->InvalidateFramebuffer(GL_FRAMEBUFFER, 2, &data[0][0]);
828 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
829 }
830
831 TEST_F(GLES2ImplementationTest, InvalidateSubFramebuffer) {
832 GLenum data[2][1] = {{0}};
833 struct Cmds {
834 cmds::InvalidateSubFramebufferImmediate cmd;
835 GLenum data[2][1];
836 };
837
838 Cmds expected;
839 for (int ii = 0; ii < 2; ++ii) {
840 for (int jj = 0; jj < 1; ++jj) {
841 data[ii][jj] = static_cast<GLenum>(ii * 1 + jj);
842 }
843 }
844 expected.cmd.Init(GL_FRAMEBUFFER, 2, &data[0][0], 4, 5, 6, 7);
845 gl_->InvalidateSubFramebuffer(GL_FRAMEBUFFER, 2, &data[0][0], 4, 5, 6, 7);
846 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
847 }
Ken Russell (switch to Gerrit) 2014/12/05 03:17:37 The autogenerated unit tests look correct to me.
848
813 TEST_F(GLES2ImplementationTest, IsBuffer) { 849 TEST_F(GLES2ImplementationTest, IsBuffer) {
814 struct Cmds { 850 struct Cmds {
815 cmds::IsBuffer cmd; 851 cmds::IsBuffer cmd;
816 }; 852 };
817 853
818 Cmds expected; 854 Cmds expected;
819 ExpectedMemoryInfo result1 = 855 ExpectedMemoryInfo result1 =
820 GetExpectedResultMemory(sizeof(cmds::IsBuffer::Result)); 856 GetExpectedResultMemory(sizeof(cmds::IsBuffer::Result));
821 expected.cmd.Init(1, result1.id, result1.offset); 857 expected.cmd.Init(1, result1.id, result1.offset);
822 858
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 struct Cmds { 1016 struct Cmds {
981 cmds::PolygonOffset cmd; 1017 cmds::PolygonOffset cmd;
982 }; 1018 };
983 Cmds expected; 1019 Cmds expected;
984 expected.cmd.Init(1, 2); 1020 expected.cmd.Init(1, 2);
985 1021
986 gl_->PolygonOffset(1, 2); 1022 gl_->PolygonOffset(1, 2);
987 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); 1023 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
988 } 1024 }
989 1025
1026 TEST_F(GLES2ImplementationTest, ReadBuffer) {
1027 struct Cmds {
1028 cmds::ReadBuffer cmd;
1029 };
1030 Cmds expected;
1031 expected.cmd.Init(1);
1032
1033 gl_->ReadBuffer(1);
1034 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
1035 }
1036
990 TEST_F(GLES2ImplementationTest, ReleaseShaderCompiler) { 1037 TEST_F(GLES2ImplementationTest, ReleaseShaderCompiler) {
991 struct Cmds { 1038 struct Cmds {
992 cmds::ReleaseShaderCompiler cmd; 1039 cmds::ReleaseShaderCompiler cmd;
993 }; 1040 };
994 Cmds expected; 1041 Cmds expected;
995 expected.cmd.Init(); 1042 expected.cmd.Init();
996 1043
997 gl_->ReleaseShaderCompiler(); 1044 gl_->ReleaseShaderCompiler();
998 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); 1045 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
999 } 1046 }
(...skipping 1416 matching lines...) Expand 10 before | Expand all | Expand 10 after
2416 struct Cmds { 2463 struct Cmds {
2417 cmds::MatrixLoadIdentityCHROMIUM cmd; 2464 cmds::MatrixLoadIdentityCHROMIUM cmd;
2418 }; 2465 };
2419 Cmds expected; 2466 Cmds expected;
2420 expected.cmd.Init(GL_PATH_PROJECTION_CHROMIUM); 2467 expected.cmd.Init(GL_PATH_PROJECTION_CHROMIUM);
2421 2468
2422 gl_->MatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM); 2469 gl_->MatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM);
2423 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); 2470 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
2424 } 2471 }
2425 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_ 2472 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698