Skip to content

Commit

Permalink
Remove unnecessary RasterCHROMIUM parameters
Browse files Browse the repository at this point in the history
The xywh rectangle was only used on the client side and not at all on
the service side, so use cmd_args to clean up the service-side API.

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I60478b01acc9fcc7185b47acc9d747adf2a6d412
Reviewed-on: https://chromium-review.googlesource.com/734169
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: enne <enne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510978}
  • Loading branch information
quisquous authored and Commit Bot committed Oct 24, 2017
1 parent 15bcbbf commit 53bdeca
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 48 deletions.
1 change: 1 addition & 0 deletions gpu/command_buffer/build_gles2_cmd_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4616,6 +4616,7 @@
'needs_size': True,
'extension': 'CHROMIUM_raster_transport',
'extension_flag': 'chromium_raster_transport',
'cmd_args': 'void* list',
},
'EndRasterCHROMIUM': {
'decoder_func': 'DoEndRasterCHROMIUM',
Expand Down
6 changes: 1 addition & 5 deletions gpu/command_buffer/client/gles2_cmd_helper_autogen.h
Original file line number Diff line number Diff line change
Expand Up @@ -3305,14 +3305,10 @@ void BeginRasterCHROMIUM(GLuint texture_id,

void RasterCHROMIUM(uint32_t list_shm_id,
uint32_t list_shm_offset,
GLint x,
GLint y,
GLint w,
GLint h,
uint32_t data_size) {
gles2::cmds::RasterCHROMIUM* c = GetCmdSpace<gles2::cmds::RasterCHROMIUM>();
if (c) {
c->Init(list_shm_id, list_shm_offset, x, y, w, h, data_size);
c->Init(list_shm_id, list_shm_offset, data_size);
}
}

Expand Down
6 changes: 2 additions & 4 deletions gpu/command_buffer/client/gles2_implementation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7181,8 +7181,7 @@ void GLES2Implementation::RasterCHROMIUM(const cc::DisplayItemList* list,
size_t size = op->Serialize(memory + written_bytes, free_bytes, options);
if (!size) {
buffer.Shrink(written_bytes);
helper_->RasterCHROMIUM(buffer.shm_id(), buffer.offset(), x, y, w, h,
written_bytes);
helper_->RasterCHROMIUM(buffer.shm_id(), buffer.offset(), written_bytes);
buffer.Reset(kBlockAlloc);
memory = static_cast<char*>(buffer.address());
written_bytes = 0;
Expand All @@ -7203,8 +7202,7 @@ void GLES2Implementation::RasterCHROMIUM(const cc::DisplayItemList* list,

if (!written_bytes)
return;
helper_->RasterCHROMIUM(buffer.shm_id(), buffer.offset(), x, y, w, h,
buffer.size());
helper_->RasterCHROMIUM(buffer.shm_id(), buffer.offset(), buffer.size());

CheckGLError();
#endif
Expand Down
36 changes: 6 additions & 30 deletions gpu/command_buffer/common/gles2_cmd_format_autogen.h
Original file line number Diff line number Diff line change
Expand Up @@ -16220,62 +16220,38 @@ struct RasterCHROMIUM {

void Init(uint32_t _list_shm_id,
uint32_t _list_shm_offset,
GLint _x,
GLint _y,
GLint _w,
GLint _h,
uint32_t _data_size) {
SetHeader();
list_shm_id = _list_shm_id;
list_shm_offset = _list_shm_offset;
x = _x;
y = _y;
w = _w;
h = _h;
data_size = _data_size;
}

void* Set(void* cmd,
uint32_t _list_shm_id,
uint32_t _list_shm_offset,
GLint _x,
GLint _y,
GLint _w,
GLint _h,
uint32_t _data_size) {
static_cast<ValueType*>(cmd)->Init(_list_shm_id, _list_shm_offset, _x, _y,
_w, _h, _data_size);
static_cast<ValueType*>(cmd)->Init(_list_shm_id, _list_shm_offset,
_data_size);
return NextCmdAddress<ValueType>(cmd);
}

gpu::CommandHeader header;
uint32_t list_shm_id;
uint32_t list_shm_offset;
int32_t x;
int32_t y;
int32_t w;
int32_t h;
uint32_t data_size;
};

static_assert(sizeof(RasterCHROMIUM) == 32,
"size of RasterCHROMIUM should be 32");
static_assert(sizeof(RasterCHROMIUM) == 16,
"size of RasterCHROMIUM should be 16");
static_assert(offsetof(RasterCHROMIUM, header) == 0,
"offset of RasterCHROMIUM header should be 0");
static_assert(offsetof(RasterCHROMIUM, list_shm_id) == 4,
"offset of RasterCHROMIUM list_shm_id should be 4");
static_assert(offsetof(RasterCHROMIUM, list_shm_offset) == 8,
"offset of RasterCHROMIUM list_shm_offset should be 8");
static_assert(offsetof(RasterCHROMIUM, x) == 12,
"offset of RasterCHROMIUM x should be 12");
static_assert(offsetof(RasterCHROMIUM, y) == 16,
"offset of RasterCHROMIUM y should be 16");
static_assert(offsetof(RasterCHROMIUM, w) == 20,
"offset of RasterCHROMIUM w should be 20");
static_assert(offsetof(RasterCHROMIUM, h) == 24,
"offset of RasterCHROMIUM h should be 24");
static_assert(offsetof(RasterCHROMIUM, data_size) == 28,
"offset of RasterCHROMIUM data_size should be 28");
static_assert(offsetof(RasterCHROMIUM, data_size) == 12,
"offset of RasterCHROMIUM data_size should be 12");

struct EndRasterCHROMIUM {
typedef EndRasterCHROMIUM ValueType;
Expand Down
13 changes: 4 additions & 9 deletions gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
Original file line number Diff line number Diff line change
Expand Up @@ -5419,20 +5419,15 @@ TEST_F(GLES2FormatTest, BeginRasterCHROMIUM) {

TEST_F(GLES2FormatTest, RasterCHROMIUM) {
cmds::RasterCHROMIUM& cmd = *GetBufferAs<cmds::RasterCHROMIUM>();
void* next_cmd = cmd.Set(&cmd, static_cast<uint32_t>(11),
static_cast<uint32_t>(12), static_cast<GLint>(13),
static_cast<GLint>(14), static_cast<GLint>(15),
static_cast<GLint>(16), static_cast<uint32_t>(17));
void* next_cmd =
cmd.Set(&cmd, static_cast<uint32_t>(11), static_cast<uint32_t>(12),
static_cast<uint32_t>(13));
EXPECT_EQ(static_cast<uint32_t>(cmds::RasterCHROMIUM::kCmdId),
cmd.header.command);
EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
EXPECT_EQ(static_cast<uint32_t>(11), cmd.list_shm_id);
EXPECT_EQ(static_cast<uint32_t>(12), cmd.list_shm_offset);
EXPECT_EQ(static_cast<GLint>(13), cmd.x);
EXPECT_EQ(static_cast<GLint>(14), cmd.y);
EXPECT_EQ(static_cast<GLint>(15), cmd.w);
EXPECT_EQ(static_cast<GLint>(16), cmd.h);
EXPECT_EQ(static_cast<uint32_t>(17), cmd.data_size);
EXPECT_EQ(static_cast<uint32_t>(13), cmd.data_size);
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
}

Expand Down

0 comments on commit 53bdeca

Please sign in to comment.