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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 struct Cmds { | 71 struct Cmds { |
72 cmds::BindSampler cmd; | 72 cmds::BindSampler cmd; |
73 }; | 73 }; |
74 Cmds expected; | 74 Cmds expected; |
75 expected.cmd.Init(1, 2); | 75 expected.cmd.Init(1, 2); |
76 | 76 |
77 gl_->BindSampler(1, 2); | 77 gl_->BindSampler(1, 2); |
78 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 78 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
79 } | 79 } |
80 | 80 |
| 81 TEST_F(GLES2ImplementationTest, BindTransformFeedback) { |
| 82 struct Cmds { |
| 83 cmds::BindTransformFeedback cmd; |
| 84 }; |
| 85 Cmds expected; |
| 86 expected.cmd.Init(GL_TRANSFORM_FEEDBACK, 2); |
| 87 |
| 88 gl_->BindTransformFeedback(GL_TRANSFORM_FEEDBACK, 2); |
| 89 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 90 } |
| 91 |
81 TEST_F(GLES2ImplementationTest, BlendColor) { | 92 TEST_F(GLES2ImplementationTest, BlendColor) { |
82 struct Cmds { | 93 struct Cmds { |
83 cmds::BlendColor cmd; | 94 cmds::BlendColor cmd; |
84 }; | 95 }; |
85 Cmds expected; | 96 Cmds expected; |
86 expected.cmd.Init(1, 2, 3, 4); | 97 expected.cmd.Init(1, 2, 3, 4); |
87 | 98 |
88 gl_->BlendColor(1, 2, 3, 4); | 99 gl_->BlendColor(1, 2, 3, 4); |
89 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 100 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
90 } | 101 } |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 GLuint data[2]; | 366 GLuint data[2]; |
356 }; | 367 }; |
357 Cmds expected; | 368 Cmds expected; |
358 expected.del.Init(arraysize(ids), &ids[0]); | 369 expected.del.Init(arraysize(ids), &ids[0]); |
359 expected.data[0] = kTexturesStartId; | 370 expected.data[0] = kTexturesStartId; |
360 expected.data[1] = kTexturesStartId + 1; | 371 expected.data[1] = kTexturesStartId + 1; |
361 gl_->DeleteTextures(arraysize(ids), &ids[0]); | 372 gl_->DeleteTextures(arraysize(ids), &ids[0]); |
362 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 373 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
363 } | 374 } |
364 | 375 |
| 376 TEST_F(GLES2ImplementationTest, DeleteTransformFeedbacks) { |
| 377 GLuint ids[2] = {kTransformFeedbacksStartId, kTransformFeedbacksStartId + 1}; |
| 378 struct Cmds { |
| 379 cmds::DeleteTransformFeedbacksImmediate del; |
| 380 GLuint data[2]; |
| 381 }; |
| 382 Cmds expected; |
| 383 expected.del.Init(arraysize(ids), &ids[0]); |
| 384 expected.data[0] = kTransformFeedbacksStartId; |
| 385 expected.data[1] = kTransformFeedbacksStartId + 1; |
| 386 gl_->DeleteTransformFeedbacks(arraysize(ids), &ids[0]); |
| 387 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 388 } |
| 389 |
365 TEST_F(GLES2ImplementationTest, DepthFunc) { | 390 TEST_F(GLES2ImplementationTest, DepthFunc) { |
366 struct Cmds { | 391 struct Cmds { |
367 cmds::DepthFunc cmd; | 392 cmds::DepthFunc cmd; |
368 }; | 393 }; |
369 Cmds expected; | 394 Cmds expected; |
370 expected.cmd.Init(GL_NEVER); | 395 expected.cmd.Init(GL_NEVER); |
371 | 396 |
372 gl_->DepthFunc(GL_NEVER); | 397 gl_->DepthFunc(GL_NEVER); |
373 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 398 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
374 } | 399 } |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 }; | 621 }; |
597 Cmds expected; | 622 Cmds expected; |
598 expected.gen.Init(arraysize(ids), &ids[0]); | 623 expected.gen.Init(arraysize(ids), &ids[0]); |
599 expected.data[0] = kTexturesStartId; | 624 expected.data[0] = kTexturesStartId; |
600 expected.data[1] = kTexturesStartId + 1; | 625 expected.data[1] = kTexturesStartId + 1; |
601 gl_->GenTextures(arraysize(ids), &ids[0]); | 626 gl_->GenTextures(arraysize(ids), &ids[0]); |
602 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 627 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
603 EXPECT_EQ(kTexturesStartId, ids[0]); | 628 EXPECT_EQ(kTexturesStartId, ids[0]); |
604 EXPECT_EQ(kTexturesStartId + 1, ids[1]); | 629 EXPECT_EQ(kTexturesStartId + 1, ids[1]); |
605 } | 630 } |
| 631 |
| 632 TEST_F(GLES2ImplementationTest, GenTransformFeedbacks) { |
| 633 GLuint ids[2] = { |
| 634 0, |
| 635 }; |
| 636 struct Cmds { |
| 637 cmds::GenTransformFeedbacksImmediate gen; |
| 638 GLuint data[2]; |
| 639 }; |
| 640 Cmds expected; |
| 641 expected.gen.Init(arraysize(ids), &ids[0]); |
| 642 expected.data[0] = kTransformFeedbacksStartId; |
| 643 expected.data[1] = kTransformFeedbacksStartId + 1; |
| 644 gl_->GenTransformFeedbacks(arraysize(ids), &ids[0]); |
| 645 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 646 EXPECT_EQ(kTransformFeedbacksStartId, ids[0]); |
| 647 EXPECT_EQ(kTransformFeedbacksStartId + 1, ids[1]); |
| 648 } |
606 // TODO: Implement unit test for GetActiveAttrib | 649 // TODO: Implement unit test for GetActiveAttrib |
607 // TODO: Implement unit test for GetActiveUniform | 650 // TODO: Implement unit test for GetActiveUniform |
608 // TODO: Implement unit test for GetAttachedShaders | 651 // TODO: Implement unit test for GetAttachedShaders |
609 // TODO: Implement unit test for GetAttribLocation | 652 // TODO: Implement unit test for GetAttribLocation |
610 | 653 |
611 TEST_F(GLES2ImplementationTest, GetBooleanv) { | 654 TEST_F(GLES2ImplementationTest, GetBooleanv) { |
612 struct Cmds { | 655 struct Cmds { |
613 cmds::GetBooleanv cmd; | 656 cmds::GetBooleanv cmd; |
614 }; | 657 }; |
615 typedef cmds::GetBooleanv::Result Result; | 658 typedef cmds::GetBooleanv::Result Result; |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1068 | 1111 |
1069 EXPECT_CALL(*command_buffer(), OnFlush()) | 1112 EXPECT_CALL(*command_buffer(), OnFlush()) |
1070 .WillOnce(SetMemory(result1.ptr, uint32_t(1))) | 1113 .WillOnce(SetMemory(result1.ptr, uint32_t(1))) |
1071 .RetiresOnSaturation(); | 1114 .RetiresOnSaturation(); |
1072 | 1115 |
1073 GLboolean result = gl_->IsTexture(1); | 1116 GLboolean result = gl_->IsTexture(1); |
1074 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1117 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
1075 EXPECT_TRUE(result); | 1118 EXPECT_TRUE(result); |
1076 } | 1119 } |
1077 | 1120 |
| 1121 TEST_F(GLES2ImplementationTest, IsTransformFeedback) { |
| 1122 struct Cmds { |
| 1123 cmds::IsTransformFeedback cmd; |
| 1124 }; |
| 1125 |
| 1126 Cmds expected; |
| 1127 ExpectedMemoryInfo result1 = |
| 1128 GetExpectedResultMemory(sizeof(cmds::IsTransformFeedback::Result)); |
| 1129 expected.cmd.Init(1, result1.id, result1.offset); |
| 1130 |
| 1131 EXPECT_CALL(*command_buffer(), OnFlush()) |
| 1132 .WillOnce(SetMemory(result1.ptr, uint32_t(1))) |
| 1133 .RetiresOnSaturation(); |
| 1134 |
| 1135 GLboolean result = gl_->IsTransformFeedback(1); |
| 1136 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1137 EXPECT_TRUE(result); |
| 1138 } |
| 1139 |
1078 TEST_F(GLES2ImplementationTest, LineWidth) { | 1140 TEST_F(GLES2ImplementationTest, LineWidth) { |
1079 struct Cmds { | 1141 struct Cmds { |
1080 cmds::LineWidth cmd; | 1142 cmds::LineWidth cmd; |
1081 }; | 1143 }; |
1082 Cmds expected; | 1144 Cmds expected; |
1083 expected.cmd.Init(0.5f); | 1145 expected.cmd.Init(0.5f); |
1084 | 1146 |
1085 gl_->LineWidth(0.5f); | 1147 gl_->LineWidth(0.5f); |
1086 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1148 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
1087 } | 1149 } |
1088 | 1150 |
1089 TEST_F(GLES2ImplementationTest, LinkProgram) { | 1151 TEST_F(GLES2ImplementationTest, LinkProgram) { |
1090 struct Cmds { | 1152 struct Cmds { |
1091 cmds::LinkProgram cmd; | 1153 cmds::LinkProgram cmd; |
1092 }; | 1154 }; |
1093 Cmds expected; | 1155 Cmds expected; |
1094 expected.cmd.Init(1); | 1156 expected.cmd.Init(1); |
1095 | 1157 |
1096 gl_->LinkProgram(1); | 1158 gl_->LinkProgram(1); |
1097 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1159 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
1098 } | 1160 } |
1099 | 1161 |
| 1162 TEST_F(GLES2ImplementationTest, PauseTransformFeedback) { |
| 1163 struct Cmds { |
| 1164 cmds::PauseTransformFeedback cmd; |
| 1165 }; |
| 1166 Cmds expected; |
| 1167 expected.cmd.Init(); |
| 1168 |
| 1169 gl_->PauseTransformFeedback(); |
| 1170 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1171 } |
| 1172 |
1100 TEST_F(GLES2ImplementationTest, PixelStorei) { | 1173 TEST_F(GLES2ImplementationTest, PixelStorei) { |
1101 struct Cmds { | 1174 struct Cmds { |
1102 cmds::PixelStorei cmd; | 1175 cmds::PixelStorei cmd; |
1103 }; | 1176 }; |
1104 Cmds expected; | 1177 Cmds expected; |
1105 expected.cmd.Init(GL_PACK_ALIGNMENT, 1); | 1178 expected.cmd.Init(GL_PACK_ALIGNMENT, 1); |
1106 | 1179 |
1107 gl_->PixelStorei(GL_PACK_ALIGNMENT, 1); | 1180 gl_->PixelStorei(GL_PACK_ALIGNMENT, 1); |
1108 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1181 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
1109 } | 1182 } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1145 struct Cmds { | 1218 struct Cmds { |
1146 cmds::RenderbufferStorage cmd; | 1219 cmds::RenderbufferStorage cmd; |
1147 }; | 1220 }; |
1148 Cmds expected; | 1221 Cmds expected; |
1149 expected.cmd.Init(GL_RENDERBUFFER, GL_RGBA4, 3, 4); | 1222 expected.cmd.Init(GL_RENDERBUFFER, GL_RGBA4, 3, 4); |
1150 | 1223 |
1151 gl_->RenderbufferStorage(GL_RENDERBUFFER, GL_RGBA4, 3, 4); | 1224 gl_->RenderbufferStorage(GL_RENDERBUFFER, GL_RGBA4, 3, 4); |
1152 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1225 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
1153 } | 1226 } |
1154 | 1227 |
| 1228 TEST_F(GLES2ImplementationTest, ResumeTransformFeedback) { |
| 1229 struct Cmds { |
| 1230 cmds::ResumeTransformFeedback cmd; |
| 1231 }; |
| 1232 Cmds expected; |
| 1233 expected.cmd.Init(); |
| 1234 |
| 1235 gl_->ResumeTransformFeedback(); |
| 1236 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1237 } |
| 1238 |
1155 TEST_F(GLES2ImplementationTest, SampleCoverage) { | 1239 TEST_F(GLES2ImplementationTest, SampleCoverage) { |
1156 struct Cmds { | 1240 struct Cmds { |
1157 cmds::SampleCoverage cmd; | 1241 cmds::SampleCoverage cmd; |
1158 }; | 1242 }; |
1159 Cmds expected; | 1243 Cmds expected; |
1160 expected.cmd.Init(1, true); | 1244 expected.cmd.Init(1, true); |
1161 | 1245 |
1162 gl_->SampleCoverage(1, true); | 1246 gl_->SampleCoverage(1, true); |
1163 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1247 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
1164 } | 1248 } |
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2265 GLuint data[2]; | 2349 GLuint data[2]; |
2266 }; | 2350 }; |
2267 Cmds expected; | 2351 Cmds expected; |
2268 expected.del.Init(arraysize(ids), &ids[0]); | 2352 expected.del.Init(arraysize(ids), &ids[0]); |
2269 expected.data[0] = kQueriesStartId; | 2353 expected.data[0] = kQueriesStartId; |
2270 expected.data[1] = kQueriesStartId + 1; | 2354 expected.data[1] = kQueriesStartId + 1; |
2271 gl_->DeleteQueriesEXT(arraysize(ids), &ids[0]); | 2355 gl_->DeleteQueriesEXT(arraysize(ids), &ids[0]); |
2272 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 2356 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
2273 } | 2357 } |
2274 // TODO: Implement unit test for BeginQueryEXT | 2358 // TODO: Implement unit test for BeginQueryEXT |
| 2359 |
| 2360 TEST_F(GLES2ImplementationTest, BeginTransformFeedback) { |
| 2361 struct Cmds { |
| 2362 cmds::BeginTransformFeedback cmd; |
| 2363 }; |
| 2364 Cmds expected; |
| 2365 expected.cmd.Init(GL_POINTS); |
| 2366 |
| 2367 gl_->BeginTransformFeedback(GL_POINTS); |
| 2368 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 2369 } |
| 2370 |
| 2371 TEST_F(GLES2ImplementationTest, EndTransformFeedback) { |
| 2372 struct Cmds { |
| 2373 cmds::EndTransformFeedback cmd; |
| 2374 }; |
| 2375 Cmds expected; |
| 2376 expected.cmd.Init(); |
| 2377 |
| 2378 gl_->EndTransformFeedback(); |
| 2379 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 2380 } |
2275 // TODO: Implement unit test for InsertEventMarkerEXT | 2381 // TODO: Implement unit test for InsertEventMarkerEXT |
2276 // TODO: Implement unit test for PushGroupMarkerEXT | 2382 // TODO: Implement unit test for PushGroupMarkerEXT |
2277 | 2383 |
2278 TEST_F(GLES2ImplementationTest, PopGroupMarkerEXT) { | 2384 TEST_F(GLES2ImplementationTest, PopGroupMarkerEXT) { |
2279 struct Cmds { | 2385 struct Cmds { |
2280 cmds::PopGroupMarkerEXT cmd; | 2386 cmds::PopGroupMarkerEXT cmd; |
2281 }; | 2387 }; |
2282 Cmds expected; | 2388 Cmds expected; |
2283 expected.cmd.Init(); | 2389 expected.cmd.Init(); |
2284 | 2390 |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2613 struct Cmds { | 2719 struct Cmds { |
2614 cmds::MatrixLoadIdentityCHROMIUM cmd; | 2720 cmds::MatrixLoadIdentityCHROMIUM cmd; |
2615 }; | 2721 }; |
2616 Cmds expected; | 2722 Cmds expected; |
2617 expected.cmd.Init(GL_PATH_PROJECTION_CHROMIUM); | 2723 expected.cmd.Init(GL_PATH_PROJECTION_CHROMIUM); |
2618 | 2724 |
2619 gl_->MatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM); | 2725 gl_->MatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM); |
2620 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 2726 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
2621 } | 2727 } |
2622 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_ | 2728 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_ |
OLD | NEW |