diff options
-rw-r--r-- | content/common/gpu/gpu_command_buffer_stub.cc | 16 | ||||
-rw-r--r-- | content/common/gpu/gpu_command_buffer_stub.h | 6 | ||||
-rw-r--r-- | content/common/gpu/gpu_messages.h | 4 | ||||
-rw-r--r-- | content/renderer/gpu/command_buffer_proxy.cc | 6 | ||||
-rw-r--r-- | content/renderer/gpu/command_buffer_proxy.h | 2 |
5 files changed, 20 insertions, 14 deletions
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc index 600cab2..8483147 100644 --- a/content/common/gpu/gpu_command_buffer_stub.cc +++ b/content/common/gpu/gpu_command_buffer_stub.cc @@ -196,12 +196,14 @@ void GpuCommandBufferStub::OnGetState(IPC::Message* reply_message) { void GpuCommandBufferStub::OnFlush(int32 put_offset, int32 last_known_get, - int32 flush_count, + uint32 flush_count, IPC::Message* reply_message) { TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnFlush"); gpu::CommandBuffer::State state; - if (flush_count <= last_flush_count_) { - DLOG(INFO) << "!!OUT OF ORDER IPC!!"; + if (flush_count - last_flush_count_ >= 0x8000000U) { + // We received this message out-of-order. This should not happen but is here + // to catch regressions. Ignore the message. + NOTREACHED() << "Received an AsyncFlush message out-of-order"; state = command_buffer_->GetState(); } else { last_flush_count_ = flush_count; @@ -215,13 +217,15 @@ void GpuCommandBufferStub::OnFlush(int32 put_offset, Send(reply_message); } -void GpuCommandBufferStub::OnAsyncFlush(int32 put_offset, int32 flush_count) { +void GpuCommandBufferStub::OnAsyncFlush(int32 put_offset, uint32 flush_count) { TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnAsyncFlush"); - if (flush_count > last_flush_count_) { + if (flush_count - last_flush_count_ < 0x8000000U) { last_flush_count_ = flush_count; command_buffer_->Flush(put_offset); } else { - DLOG(INFO) << "!!OUT OF ORDER IPC!!"; + // We received this message out-of-order. This should not happen but is here + // to catch regressions. Ignore the message. + NOTREACHED() << "Received a Flush message out-of-order"; } // TODO(piman): Do this everytime the scheduler finishes processing a batch of // commands. diff --git a/content/common/gpu/gpu_command_buffer_stub.h b/content/common/gpu/gpu_command_buffer_stub.h index 0526b79..e499edb 100644 --- a/content/common/gpu/gpu_command_buffer_stub.h +++ b/content/common/gpu/gpu_command_buffer_stub.h @@ -85,9 +85,9 @@ class GpuCommandBufferStub void OnGetState(IPC::Message* reply_message); void OnFlush(int32 put_offset, int32 last_known_get, - int32 flush_count, + uint32 flush_count, IPC::Message* reply_message); - void OnAsyncFlush(int32 put_offset, int32 flush_count); + void OnAsyncFlush(int32 put_offset, uint32 flush_count); void OnCreateTransferBuffer(int32 size, int32 id_request, IPC::Message* reply_message); @@ -125,7 +125,7 @@ class GpuCommandBufferStub std::vector<int32> requested_attribs_; uint32 parent_texture_id_; int32 route_id_; - int32 last_flush_count_; + uint32 last_flush_count_; // The following two fields are used on Mac OS X to identify the window // for the rendering results on the browser side. diff --git a/content/common/gpu/gpu_messages.h b/content/common/gpu/gpu_messages.h index 466367e..3d154ef 100644 --- a/content/common/gpu/gpu_messages.h +++ b/content/common/gpu/gpu_messages.h @@ -355,7 +355,7 @@ IPC_SYNC_MESSAGE_ROUTED0_1(GpuCommandBufferMsg_GetState, IPC_SYNC_MESSAGE_ROUTED3_1(GpuCommandBufferMsg_Flush, int32 /* put_offset */, int32 /* last_known_get */, - int32 /* flush_count */, + uint32 /* flush_count */, gpu::CommandBuffer::State /* state */) // Asynchronously synchronize the put and get offsets of both processes. @@ -363,7 +363,7 @@ IPC_SYNC_MESSAGE_ROUTED3_1(GpuCommandBufferMsg_Flush, // is returned via an UpdateState message. IPC_MESSAGE_ROUTED2(GpuCommandBufferMsg_AsyncFlush, int32 /* put_offset */, - int32 /* flush_count */) + uint32 /* flush_count */) // Return the current state of the command buffer following a request via // an AsyncGetState or AsyncFlush message. (This message is sent from the diff --git a/content/renderer/gpu/command_buffer_proxy.cc b/content/renderer/gpu/command_buffer_proxy.cc index dca13b8..8c3a65c 100644 --- a/content/renderer/gpu/command_buffer_proxy.cc +++ b/content/renderer/gpu/command_buffer_proxy.cc @@ -154,8 +154,10 @@ void CommandBufferProxy::Flush(int32 put_offset) { if (last_state_.error != gpu::error::kNoError) return; - Send(new GpuCommandBufferMsg_AsyncFlush( - route_id_, put_offset, ++flush_count_)); + IPC::Message *message = new GpuCommandBufferMsg_AsyncFlush( + route_id_, put_offset, ++flush_count_); + message->set_unblock(true); + Send(message); } gpu::CommandBuffer::State CommandBufferProxy::FlushSync(int32 put_offset, diff --git a/content/renderer/gpu/command_buffer_proxy.h b/content/renderer/gpu/command_buffer_proxy.h index 0cadef7..665fec7 100644 --- a/content/renderer/gpu/command_buffer_proxy.h +++ b/content/renderer/gpu/command_buffer_proxy.h @@ -106,7 +106,7 @@ class CommandBufferProxy : public gpu::CommandBuffer, IPC::Channel::Sender* channel_; int route_id_; - int flush_count_; + unsigned int flush_count_; scoped_ptr<Task> notify_repaint_task_; |