| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // DO NOT EDIT! | 7 // DO NOT EDIT! |
| 8 | 8 |
| 9 // This file contains unit tests for gles2 commmands | 9 // This file contains unit tests for gles2 commmands |
| 10 // It is included by gles2_cmd_format_test.cc | 10 // It is included by gles2_cmd_format_test.cc |
| (...skipping 4438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4449 &cmd, | 4449 &cmd, |
| 4450 static_cast<GLuint>(11)); | 4450 static_cast<GLuint>(11)); |
| 4451 EXPECT_EQ(static_cast<uint32>(cmds::WaitSyncPointCHROMIUM::kCmdId), | 4451 EXPECT_EQ(static_cast<uint32>(cmds::WaitSyncPointCHROMIUM::kCmdId), |
| 4452 cmd.header.command); | 4452 cmd.header.command); |
| 4453 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); | 4453 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); |
| 4454 EXPECT_EQ(static_cast<GLuint>(11), cmd.sync_point); | 4454 EXPECT_EQ(static_cast<GLuint>(11), cmd.sync_point); |
| 4455 CheckBytesWrittenMatchesExpectedSize( | 4455 CheckBytesWrittenMatchesExpectedSize( |
| 4456 next_cmd, sizeof(cmd)); | 4456 next_cmd, sizeof(cmd)); |
| 4457 } | 4457 } |
| 4458 | 4458 |
| 4459 TEST_F(GLES2FormatTest, DrawBuffersEXT) { |
| 4460 cmds::DrawBuffersEXT& cmd = *GetBufferAs<cmds::DrawBuffersEXT>(); |
| 4461 void* next_cmd = cmd.Set( |
| 4462 &cmd, |
| 4463 static_cast<GLsizei>(11), |
| 4464 static_cast<uint32>(12), |
| 4465 static_cast<uint32>(13)); |
| 4466 EXPECT_EQ(static_cast<uint32>(cmds::DrawBuffersEXT::kCmdId), |
| 4467 cmd.header.command); |
| 4468 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); |
| 4469 EXPECT_EQ(static_cast<GLsizei>(11), cmd.count); |
| 4470 EXPECT_EQ(static_cast<uint32>(12), cmd.bufs_shm_id); |
| 4471 EXPECT_EQ(static_cast<uint32>(13), cmd.bufs_shm_offset); |
| 4472 CheckBytesWrittenMatchesExpectedSize( |
| 4473 next_cmd, sizeof(cmd)); |
| 4474 } |
| 4475 |
| 4476 TEST_F(GLES2FormatTest, DrawBuffersEXTImmediate) { |
| 4477 const int kSomeBaseValueToTestWith = 51; |
| 4478 static GLenum data[] = { |
| 4479 static_cast<GLenum>(kSomeBaseValueToTestWith + 0), |
| 4480 }; |
| 4481 cmds::DrawBuffersEXTImmediate& cmd = |
| 4482 *GetBufferAs<cmds::DrawBuffersEXTImmediate>(); |
| 4483 const GLsizei kNumElements = 1; |
| 4484 const size_t kExpectedCmdSize = |
| 4485 sizeof(cmd) + kNumElements * sizeof(GLenum) * 1; |
| 4486 void* next_cmd = cmd.Set( |
| 4487 &cmd, |
| 4488 static_cast<GLsizei>(1), |
| 4489 data); |
| 4490 EXPECT_EQ(static_cast<uint32>(cmds::DrawBuffersEXTImmediate::kCmdId), |
| 4491 cmd.header.command); |
| 4492 EXPECT_EQ(kExpectedCmdSize, cmd.header.size * 4u); |
| 4493 EXPECT_EQ(static_cast<GLsizei>(1), cmd.count); |
| 4494 CheckBytesWrittenMatchesExpectedSize( |
| 4495 next_cmd, sizeof(cmd) + |
| 4496 RoundSizeToMultipleOfEntries(sizeof(data))); |
| 4497 // TODO(gman): Check that data was inserted; |
| 4498 } |
| 4499 |
| 4459 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_TEST_AUTOGEN_H_ | 4500 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_TEST_AUTOGEN_H_ |
| 4460 | 4501 |
| OLD | NEW |