summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/common
diff options
context:
space:
mode:
authoralexst@chromium.org <alexst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-09 16:50:01 +0000
committeralexst@chromium.org <alexst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-09 16:50:01 +0000
commit957f064cc82988fab07e8f8f1fb2b4a39d02d644 (patch)
tree197774441fd33e065430070f8d7305ea823dc2bc /gpu/command_buffer/common
parentd61ff032329717354de78f02ef8dc89379335ec2 (diff)
downloadchromium_src-957f064cc82988fab07e8f8f1fb2b4a39d02d644.zip
chromium_src-957f064cc82988fab07e8f8f1fb2b4a39d02d644.tar.gz
chromium_src-957f064cc82988fab07e8f8f1fb2b4a39d02d644.tar.bz2
Plumb ScheduleOverlayPlane into the GPU process.
BUG= Review URL: https://codereview.chromium.org/222333002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262715 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/common')
-rw-r--r--gpu/command_buffer/common/gles2_cmd_format_autogen.h104
-rw-r--r--gpu/command_buffer/common/gles2_cmd_format_test_autogen.h32
-rw-r--r--gpu/command_buffer/common/gles2_cmd_ids_autogen.h3
3 files changed, 138 insertions, 1 deletions
diff --git a/gpu/command_buffer/common/gles2_cmd_format_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_autogen.h
index 49888b3..c63282f 100644
--- a/gpu/command_buffer/common/gles2_cmd_format_autogen.h
+++ b/gpu/command_buffer/common/gles2_cmd_format_autogen.h
@@ -10661,4 +10661,108 @@ COMPILE_ASSERT(sizeof(DiscardBackbufferCHROMIUM) == 4,
COMPILE_ASSERT(offsetof(DiscardBackbufferCHROMIUM, header) == 0,
OffsetOf_DiscardBackbufferCHROMIUM_header_not_0);
+struct ScheduleOverlayPlaneCHROMIUM {
+ typedef ScheduleOverlayPlaneCHROMIUM ValueType;
+ static const CommandId kCmdId = kScheduleOverlayPlaneCHROMIUM;
+ static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+ static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+ static uint32 ComputeSize() {
+ return static_cast<uint32>(sizeof(ValueType)); // NOLINT
+ }
+
+ void SetHeader() { header.SetCmd<ValueType>(); }
+
+ void Init(GLint _plane_z_order,
+ GLenum _plane_transform,
+ GLuint _overlay_texture_id,
+ GLint _bounds_x,
+ GLint _bounds_y,
+ GLint _bounds_width,
+ GLint _bounds_height,
+ GLfloat _uv_x,
+ GLfloat _uv_y,
+ GLfloat _uv_width,
+ GLfloat _uv_height) {
+ SetHeader();
+ plane_z_order = _plane_z_order;
+ plane_transform = _plane_transform;
+ overlay_texture_id = _overlay_texture_id;
+ bounds_x = _bounds_x;
+ bounds_y = _bounds_y;
+ bounds_width = _bounds_width;
+ bounds_height = _bounds_height;
+ uv_x = _uv_x;
+ uv_y = _uv_y;
+ uv_width = _uv_width;
+ uv_height = _uv_height;
+ }
+
+ void* Set(void* cmd,
+ GLint _plane_z_order,
+ GLenum _plane_transform,
+ GLuint _overlay_texture_id,
+ GLint _bounds_x,
+ GLint _bounds_y,
+ GLint _bounds_width,
+ GLint _bounds_height,
+ GLfloat _uv_x,
+ GLfloat _uv_y,
+ GLfloat _uv_width,
+ GLfloat _uv_height) {
+ static_cast<ValueType*>(cmd)->Init(_plane_z_order,
+ _plane_transform,
+ _overlay_texture_id,
+ _bounds_x,
+ _bounds_y,
+ _bounds_width,
+ _bounds_height,
+ _uv_x,
+ _uv_y,
+ _uv_width,
+ _uv_height);
+ return NextCmdAddress<ValueType>(cmd);
+ }
+
+ gpu::CommandHeader header;
+ int32 plane_z_order;
+ uint32 plane_transform;
+ uint32 overlay_texture_id;
+ int32 bounds_x;
+ int32 bounds_y;
+ int32 bounds_width;
+ int32 bounds_height;
+ float uv_x;
+ float uv_y;
+ float uv_width;
+ float uv_height;
+};
+
+COMPILE_ASSERT(sizeof(ScheduleOverlayPlaneCHROMIUM) == 48,
+ Sizeof_ScheduleOverlayPlaneCHROMIUM_is_not_48);
+COMPILE_ASSERT(offsetof(ScheduleOverlayPlaneCHROMIUM, header) == 0,
+ OffsetOf_ScheduleOverlayPlaneCHROMIUM_header_not_0);
+COMPILE_ASSERT(offsetof(ScheduleOverlayPlaneCHROMIUM, plane_z_order) == 4,
+ OffsetOf_ScheduleOverlayPlaneCHROMIUM_plane_z_order_not_4);
+COMPILE_ASSERT(offsetof(ScheduleOverlayPlaneCHROMIUM, plane_transform) == 8,
+ OffsetOf_ScheduleOverlayPlaneCHROMIUM_plane_transform_not_8);
+COMPILE_ASSERT(offsetof(ScheduleOverlayPlaneCHROMIUM, overlay_texture_id) == 12,
+ OffsetOf_ScheduleOverlayPlaneCHROMIUM_overlay_texture_id_not_12);
+COMPILE_ASSERT(offsetof(ScheduleOverlayPlaneCHROMIUM, bounds_x) == 16,
+ OffsetOf_ScheduleOverlayPlaneCHROMIUM_bounds_x_not_16);
+COMPILE_ASSERT(offsetof(ScheduleOverlayPlaneCHROMIUM, bounds_y) == 20,
+ OffsetOf_ScheduleOverlayPlaneCHROMIUM_bounds_y_not_20);
+COMPILE_ASSERT(offsetof(ScheduleOverlayPlaneCHROMIUM, bounds_width) == 24,
+ OffsetOf_ScheduleOverlayPlaneCHROMIUM_bounds_width_not_24);
+COMPILE_ASSERT(offsetof(ScheduleOverlayPlaneCHROMIUM, bounds_height) == 28,
+ OffsetOf_ScheduleOverlayPlaneCHROMIUM_bounds_height_not_28);
+COMPILE_ASSERT(offsetof(ScheduleOverlayPlaneCHROMIUM, uv_x) == 32,
+ OffsetOf_ScheduleOverlayPlaneCHROMIUM_uv_x_not_32);
+COMPILE_ASSERT(offsetof(ScheduleOverlayPlaneCHROMIUM, uv_y) == 36,
+ OffsetOf_ScheduleOverlayPlaneCHROMIUM_uv_y_not_36);
+COMPILE_ASSERT(offsetof(ScheduleOverlayPlaneCHROMIUM, uv_width) == 40,
+ OffsetOf_ScheduleOverlayPlaneCHROMIUM_uv_width_not_40);
+COMPILE_ASSERT(offsetof(ScheduleOverlayPlaneCHROMIUM, uv_height) == 44,
+ OffsetOf_ScheduleOverlayPlaneCHROMIUM_uv_height_not_44);
+
#endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_AUTOGEN_H_
diff --git a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
index fe48327..98b91b5 100644
--- a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
+++ b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
@@ -3824,4 +3824,36 @@ TEST_F(GLES2FormatTest, DiscardBackbufferCHROMIUM) {
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
}
+TEST_F(GLES2FormatTest, ScheduleOverlayPlaneCHROMIUM) {
+ cmds::ScheduleOverlayPlaneCHROMIUM& cmd =
+ *GetBufferAs<cmds::ScheduleOverlayPlaneCHROMIUM>();
+ void* next_cmd = cmd.Set(&cmd,
+ static_cast<GLint>(11),
+ static_cast<GLenum>(12),
+ static_cast<GLuint>(13),
+ static_cast<GLint>(14),
+ static_cast<GLint>(15),
+ static_cast<GLint>(16),
+ static_cast<GLint>(17),
+ static_cast<GLfloat>(18),
+ static_cast<GLfloat>(19),
+ static_cast<GLfloat>(20),
+ static_cast<GLfloat>(21));
+ EXPECT_EQ(static_cast<uint32>(cmds::ScheduleOverlayPlaneCHROMIUM::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLint>(11), cmd.plane_z_order);
+ EXPECT_EQ(static_cast<GLenum>(12), cmd.plane_transform);
+ EXPECT_EQ(static_cast<GLuint>(13), cmd.overlay_texture_id);
+ EXPECT_EQ(static_cast<GLint>(14), cmd.bounds_x);
+ EXPECT_EQ(static_cast<GLint>(15), cmd.bounds_y);
+ EXPECT_EQ(static_cast<GLint>(16), cmd.bounds_width);
+ EXPECT_EQ(static_cast<GLint>(17), cmd.bounds_height);
+ EXPECT_EQ(static_cast<GLfloat>(18), cmd.uv_x);
+ EXPECT_EQ(static_cast<GLfloat>(19), cmd.uv_y);
+ EXPECT_EQ(static_cast<GLfloat>(20), cmd.uv_width);
+ EXPECT_EQ(static_cast<GLfloat>(21), cmd.uv_height);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
#endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_TEST_AUTOGEN_H_
diff --git a/gpu/command_buffer/common/gles2_cmd_ids_autogen.h b/gpu/command_buffer/common/gles2_cmd_ids_autogen.h
index f63df0e..7c359b9 100644
--- a/gpu/command_buffer/common/gles2_cmd_ids_autogen.h
+++ b/gpu/command_buffer/common/gles2_cmd_ids_autogen.h
@@ -245,7 +245,8 @@
OP(WaitSyncPointCHROMIUM) /* 486 */ \
OP(DrawBuffersEXT) /* 487 */ \
OP(DrawBuffersEXTImmediate) /* 488 */ \
- OP(DiscardBackbufferCHROMIUM) /* 489 */
+ OP(DiscardBackbufferCHROMIUM) /* 489 */ \
+ OP(ScheduleOverlayPlaneCHROMIUM) /* 490 */
enum CommandId {
kStartPoint = cmd::kLastCommonId, // All GLES2 commands start after this.