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

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

Issue 2673473002: Rename SwapBuffersWithDamage to SwapBuffersWithBounds (Closed)
Patch Set: fix windows compile warning Created 3 years, 10 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_autogen.h
diff --git a/gpu/command_buffer/common/gles2_cmd_format_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_autogen.h
index fb1fa6f368d85864a93efda5f012aa670a557c04..6113c950e2ecad7dcc02ed20c854e9a6ac711c43 100644
--- a/gpu/command_buffer/common/gles2_cmd_format_autogen.h
+++ b/gpu/command_buffer/common/gles2_cmd_format_autogen.h
@@ -15645,49 +15645,48 @@ static_assert(offsetof(OverlayPromotionHintCHROMIUM, display_x) == 12,
static_assert(offsetof(OverlayPromotionHintCHROMIUM, display_y) == 16,
"offset of OverlayPromotionHintCHROMIUM display_y should be 16");
-struct SwapBuffersWithDamageCHROMIUM {
- typedef SwapBuffersWithDamageCHROMIUM ValueType;
- static const CommandId kCmdId = kSwapBuffersWithDamageCHROMIUM;
- static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+struct SwapBuffersWithBoundsCHROMIUMImmediate {
+ typedef SwapBuffersWithBoundsCHROMIUMImmediate ValueType;
+ static const CommandId kCmdId = kSwapBuffersWithBoundsCHROMIUMImmediate;
+ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;
static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
- static uint32_t ComputeSize() {
- return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
+ static uint32_t ComputeDataSize(GLsizei count) {
+ return static_cast<uint32_t>(sizeof(GLint) * 4 * count); // NOLINT
}
- void SetHeader() { header.SetCmd<ValueType>(); }
+ static uint32_t ComputeSize(GLsizei count) {
+ return static_cast<uint32_t>(sizeof(ValueType) +
+ ComputeDataSize(count)); // NOLINT
+ }
- void Init(GLint _x, GLint _y, GLint _width, GLint _height) {
- SetHeader();
- x = _x;
- y = _y;
- width = _width;
- height = _height;
+ void SetHeader(GLsizei count) {
+ header.SetCmdByTotalSize<ValueType>(ComputeSize(count));
}
- void* Set(void* cmd, GLint _x, GLint _y, GLint _width, GLint _height) {
- static_cast<ValueType*>(cmd)->Init(_x, _y, _width, _height);
- return NextCmdAddress<ValueType>(cmd);
+ void Init(GLsizei _count, const GLint* _rects) {
+ SetHeader(_count);
+ count = _count;
+ memcpy(ImmediateDataAddress(this), _rects, ComputeDataSize(_count));
+ }
+
+ void* Set(void* cmd, GLsizei _count, const GLint* _rects) {
+ static_cast<ValueType*>(cmd)->Init(_count, _rects);
+ const uint32_t size = ComputeSize(_count);
+ return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size);
}
gpu::CommandHeader header;
- int32_t x;
- int32_t y;
- int32_t width;
- int32_t height;
+ int32_t count;
};
-static_assert(sizeof(SwapBuffersWithDamageCHROMIUM) == 20,
- "size of SwapBuffersWithDamageCHROMIUM should be 20");
-static_assert(offsetof(SwapBuffersWithDamageCHROMIUM, header) == 0,
- "offset of SwapBuffersWithDamageCHROMIUM header should be 0");
-static_assert(offsetof(SwapBuffersWithDamageCHROMIUM, x) == 4,
- "offset of SwapBuffersWithDamageCHROMIUM x should be 4");
-static_assert(offsetof(SwapBuffersWithDamageCHROMIUM, y) == 8,
- "offset of SwapBuffersWithDamageCHROMIUM y should be 8");
-static_assert(offsetof(SwapBuffersWithDamageCHROMIUM, width) == 12,
- "offset of SwapBuffersWithDamageCHROMIUM width should be 12");
-static_assert(offsetof(SwapBuffersWithDamageCHROMIUM, height) == 16,
- "offset of SwapBuffersWithDamageCHROMIUM height should be 16");
+static_assert(sizeof(SwapBuffersWithBoundsCHROMIUMImmediate) == 8,
+ "size of SwapBuffersWithBoundsCHROMIUMImmediate should be 8");
+static_assert(
+ offsetof(SwapBuffersWithBoundsCHROMIUMImmediate, header) == 0,
+ "offset of SwapBuffersWithBoundsCHROMIUMImmediate header should be 0");
+static_assert(
+ offsetof(SwapBuffersWithBoundsCHROMIUMImmediate, count) == 4,
+ "offset of SwapBuffersWithBoundsCHROMIUMImmediate count should be 4");
#endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_AUTOGEN_H_
« no previous file with comments | « gpu/command_buffer/common/capabilities.cc ('k') | gpu/command_buffer/common/gles2_cmd_format_test_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698