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

Unified Diff: content/common/gpu/client/command_buffer_proxy.cc

Issue 9567026: Avoid sending duplicate flushes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « content/common/gpu/client/command_buffer_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/client/command_buffer_proxy.cc
diff --git a/content/common/gpu/client/command_buffer_proxy.cc b/content/common/gpu/client/command_buffer_proxy.cc
index f195c8fdbe3dd1e5cf6c7da18d9b5d112698ae97..366169f98b5b9ac52447d057f5de97457fcb4308 100644
--- a/content/common/gpu/client/command_buffer_proxy.cc
+++ b/content/common/gpu/client/command_buffer_proxy.cc
@@ -28,7 +28,8 @@ CommandBufferProxy::CommandBufferProxy(
int route_id)
: channel_(channel),
route_id_(route_id),
- flush_count_(0) {
+ flush_count_(0),
+ last_put_offset_(-1) {
}
CommandBufferProxy::~CommandBufferProxy() {
@@ -172,6 +173,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_));
@@ -202,6 +208,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) {
« no previous file with comments | « content/common/gpu/client/command_buffer_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698