diff options
author | jbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-02 05:22:15 +0000 |
---|---|---|
committer | jbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-02 05:22:15 +0000 |
commit | 4efcef19a6f2905c3061b3420c4dcef51f19e9c8 (patch) | |
tree | d8ba162833478b9207b91a6a38d5338801476535 /content | |
parent | 60eaa6e63719ceb6271f401dac963baa0dad70b2 (diff) | |
download | chromium_src-4efcef19a6f2905c3061b3420c4dcef51f19e9c8.zip chromium_src-4efcef19a6f2905c3061b3420c4dcef51f19e9c8.tar.gz chromium_src-4efcef19a6f2905c3061b3420c4dcef51f19e9c8.tar.bz2 |
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
Diffstat (limited to 'content')
-rw-r--r-- | content/common/gpu/client/command_buffer_proxy.cc | 9 | ||||
-rw-r--r-- | content/common/gpu/client/command_buffer_proxy.h | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/content/common/gpu/client/command_buffer_proxy.cc b/content/common/gpu/client/command_buffer_proxy.cc index ab578a8..e9dbefa 100644 --- a/content/common/gpu/client/command_buffer_proxy.cc +++ b/content/common/gpu/client/command_buffer_proxy.cc @@ -27,7 +27,8 @@ CommandBufferProxy::CommandBufferProxy( int route_id) : channel_(channel), route_id_(route_id), - flush_count_(0) { + flush_count_(0), + last_put_offset_(-1) { } CommandBufferProxy::~CommandBufferProxy() { @@ -171,6 +172,11 @@ void CommandBufferProxy::Flush(int32 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_, put_offset, ++flush_count_)); @@ -201,6 +207,7 @@ void CommandBufferProxy::SetGetBuffer(int32 shm_id) { return; Send(new GpuCommandBufferMsg_SetGetBuffer(route_id_, shm_id)); + last_put_offset_ = -1; } void CommandBufferProxy::SetGetOffset(int32 get_offset) { diff --git a/content/common/gpu/client/command_buffer_proxy.h b/content/common/gpu/client/command_buffer_proxy.h index b14395b..b6440b1 100644 --- a/content/common/gpu/client/command_buffer_proxy.h +++ b/content/common/gpu/client/command_buffer_proxy.h @@ -148,6 +148,7 @@ class CommandBufferProxy : public gpu::CommandBuffer, GpuChannelHost* channel_; int route_id_; unsigned int flush_count_; + int32 last_put_offset_; // Tasks to be invoked in echo responses. std::queue<base::Closure> echo_tasks_; |