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

Unified Diff: gpu/command_buffer/common/gles2_cmd_format_test_autogen.h

Issue 10106015: Allow textures to be moved from one GL context group to another. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 months 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
===================================================================
--- gpu/command_buffer/common/gles2_cmd_format_test_autogen.h (revision 134729)
+++ gpu/command_buffer/common/gles2_cmd_format_test_autogen.h (working copy)
@@ -3775,5 +3775,224 @@
next_cmd, sizeof(cmd));
}
+TEST_F(GLES2FormatTest, GenMailboxCHROMIUM) {
+ GenMailboxCHROMIUM& cmd = *GetBufferAs<GenMailboxCHROMIUM>();
+ void* next_cmd = cmd.Set(
+ &cmd,
+ static_cast<GLuint>(11));
+ EXPECT_EQ(static_cast<uint32>(GenMailboxCHROMIUM::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.bucket_id);
+ CheckBytesWrittenMatchesExpectedSize(
+ next_cmd, sizeof(cmd));
+}
+
+TEST_F(GLES2FormatTest, ProduceTextureCHROMIUM) {
+ ProduceTextureCHROMIUM& cmd = *GetBufferAs<ProduceTextureCHROMIUM>();
+ void* next_cmd = cmd.Set(
+ &cmd,
+ static_cast<GLenum>(11),
+ static_cast<uint32>(12),
+ static_cast<uint32>(13));
+ EXPECT_EQ(static_cast<uint32>(ProduceTextureCHROMIUM::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLenum>(11), cmd.target);
+ EXPECT_EQ(static_cast<uint32>(12), cmd.mailbox_shm_id);
+ EXPECT_EQ(static_cast<uint32>(13), cmd.mailbox_shm_offset);
+ CheckBytesWrittenMatchesExpectedSize(
+ next_cmd, sizeof(cmd));
+}
+
+TEST_F(GLES2FormatTest, ProduceTextureCHROMIUMImmediate) {
+ const int kSomeBaseValueToTestWith = 51;
+ static GLbyte data[] = {
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 0),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 1),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 2),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 3),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 4),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 5),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 6),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 7),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 8),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 9),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 10),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 11),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 12),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 13),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 14),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 15),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 16),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 17),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 18),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 19),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 20),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 21),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 22),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 23),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 24),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 25),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 26),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 27),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 28),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 29),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 30),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 31),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 32),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 33),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 34),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 35),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 36),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 37),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 38),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 39),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 40),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 41),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 42),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 43),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 44),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 45),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 46),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 47),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 48),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 49),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 50),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 51),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 52),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 53),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 54),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 55),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 56),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 57),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 58),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 59),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 60),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 61),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 62),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 63),
+ };
+ ProduceTextureCHROMIUMImmediate& cmd =
+ *GetBufferAs<ProduceTextureCHROMIUMImmediate>();
+ void* next_cmd = cmd.Set(
+ &cmd,
+ static_cast<GLenum>(11),
+ data);
+ EXPECT_EQ(static_cast<uint32>(ProduceTextureCHROMIUMImmediate::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd) +
+ RoundSizeToMultipleOfEntries(sizeof(data)),
+ cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLenum>(11), cmd.target);
+ CheckBytesWrittenMatchesExpectedSize(
+ next_cmd, sizeof(cmd) +
+ RoundSizeToMultipleOfEntries(sizeof(data)));
+ // TODO(gman): Check that data was inserted;
+}
+
+TEST_F(GLES2FormatTest, ConsumeTextureCHROMIUM) {
+ ConsumeTextureCHROMIUM& cmd = *GetBufferAs<ConsumeTextureCHROMIUM>();
+ void* next_cmd = cmd.Set(
+ &cmd,
+ static_cast<GLenum>(11),
+ static_cast<uint32>(12),
+ static_cast<uint32>(13));
+ EXPECT_EQ(static_cast<uint32>(ConsumeTextureCHROMIUM::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLenum>(11), cmd.target);
+ EXPECT_EQ(static_cast<uint32>(12), cmd.mailbox_shm_id);
+ EXPECT_EQ(static_cast<uint32>(13), cmd.mailbox_shm_offset);
+ CheckBytesWrittenMatchesExpectedSize(
+ next_cmd, sizeof(cmd));
+}
+
+TEST_F(GLES2FormatTest, ConsumeTextureCHROMIUMImmediate) {
+ const int kSomeBaseValueToTestWith = 51;
+ static GLbyte data[] = {
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 0),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 1),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 2),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 3),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 4),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 5),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 6),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 7),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 8),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 9),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 10),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 11),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 12),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 13),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 14),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 15),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 16),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 17),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 18),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 19),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 20),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 21),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 22),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 23),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 24),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 25),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 26),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 27),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 28),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 29),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 30),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 31),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 32),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 33),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 34),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 35),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 36),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 37),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 38),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 39),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 40),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 41),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 42),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 43),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 44),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 45),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 46),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 47),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 48),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 49),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 50),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 51),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 52),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 53),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 54),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 55),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 56),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 57),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 58),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 59),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 60),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 61),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 62),
+ static_cast<GLbyte>(kSomeBaseValueToTestWith + 63),
+ };
+ ConsumeTextureCHROMIUMImmediate& cmd =
+ *GetBufferAs<ConsumeTextureCHROMIUMImmediate>();
+ void* next_cmd = cmd.Set(
+ &cmd,
+ static_cast<GLenum>(11),
+ data);
+ EXPECT_EQ(static_cast<uint32>(ConsumeTextureCHROMIUMImmediate::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd) +
+ RoundSizeToMultipleOfEntries(sizeof(data)),
+ cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLenum>(11), cmd.target);
+ CheckBytesWrittenMatchesExpectedSize(
+ next_cmd, sizeof(cmd) +
+ RoundSizeToMultipleOfEntries(sizeof(data)));
+ // TODO(gman): Check that data was inserted;
+}
+
#endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_TEST_AUTOGEN_H_
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_format_autogen.h ('k') | gpu/command_buffer/common/gles2_cmd_ids_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698