Commit 4efcef19 authored by jbauman@chromium.org's avatar jbauman@chromium.org

Avoid sending duplicate flushes

The duplicate flush after the swapbuffers makes handling commands from other stubs difficult, so get rid of it.

BUG=112349
TEST=


Review URL: http://codereview.chromium.org/9567026

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124604 0039d316-1c4b-4281-b951-d872f2087c98
parent 60eaa6e6
...@@ -27,7 +27,8 @@ CommandBufferProxy::CommandBufferProxy( ...@@ -27,7 +27,8 @@ CommandBufferProxy::CommandBufferProxy(
int route_id) int route_id)
: channel_(channel), : channel_(channel),
route_id_(route_id), route_id_(route_id),
flush_count_(0) { flush_count_(0),
last_put_offset_(-1) {
} }
CommandBufferProxy::~CommandBufferProxy() { CommandBufferProxy::~CommandBufferProxy() {
...@@ -171,6 +172,11 @@ void CommandBufferProxy::Flush(int32 put_offset) { ...@@ -171,6 +172,11 @@ void CommandBufferProxy::Flush(int32 put_offset) {
TRACE_EVENT1("gpu", "CommandBufferProxy::Flush", "put_offset", put_offset); TRACE_EVENT1("gpu", "CommandBufferProxy::Flush", "put_offset", put_offset);
if (last_put_offset_ == put_offset)
return;
last_put_offset_ = put_offset;
Send(new GpuCommandBufferMsg_AsyncFlush(route_id_, Send(new GpuCommandBufferMsg_AsyncFlush(route_id_,
put_offset, put_offset,
++flush_count_)); ++flush_count_));
...@@ -201,6 +207,7 @@ void CommandBufferProxy::SetGetBuffer(int32 shm_id) { ...@@ -201,6 +207,7 @@ void CommandBufferProxy::SetGetBuffer(int32 shm_id) {
return; return;
Send(new GpuCommandBufferMsg_SetGetBuffer(route_id_, shm_id)); Send(new GpuCommandBufferMsg_SetGetBuffer(route_id_, shm_id));
last_put_offset_ = -1;
} }
void CommandBufferProxy::SetGetOffset(int32 get_offset) { void CommandBufferProxy::SetGetOffset(int32 get_offset) {
......
...@@ -148,6 +148,7 @@ class CommandBufferProxy : public gpu::CommandBuffer, ...@@ -148,6 +148,7 @@ class CommandBufferProxy : public gpu::CommandBuffer,
GpuChannelHost* channel_; GpuChannelHost* channel_;
int route_id_; int route_id_;
unsigned int flush_count_; unsigned int flush_count_;
int32 last_put_offset_;
// Tasks to be invoked in echo responses. // Tasks to be invoked in echo responses.
std::queue<base::Closure> echo_tasks_; std::queue<base::Closure> echo_tasks_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment