Index: content/common/gpu/gpu_channel.cc |
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc |
index 8e9c226886f5eeef45cfd5f9dc7719728ce839e7..fec767fce7c58c2d40f4d33013e49bb12d336351 100644 |
--- a/content/common/gpu/gpu_channel.cc |
+++ b/content/common/gpu/gpu_channel.cc |
@@ -662,8 +662,7 @@ bool GpuChannel::OnControlMessageReceived(const IPC::Message& msg) { |
return handled; |
} |
-size_t GpuChannel::MatchSwapBufferMessagesPattern( |
- IPC::Message* current_message) { |
+size_t GpuChannel::MatchRetireSyncPointPattern(IPC::Message* current_message) { |
DCHECK(current_message); |
if (deferred_messages_.empty() || !current_message) |
return 0; |
@@ -679,8 +678,7 @@ size_t GpuChannel::MatchSwapBufferMessagesPattern( |
// If the current message is AsyncFlush, the expected message sequence for |
// SwapBuffer should be AsyncFlush->Echo. We only try to match Echo message. |
jbauman
2014/10/01 02:15:38
Change this comment.
jbauman
2014/10/01 02:20:59
Although, to keep the logic working in a similar w
|
- if (current_message->type() == GpuCommandBufferMsg_AsyncFlush::ID && |
- first_message->type() == GpuCommandBufferMsg_Echo::ID && |
+ if (first_message->type() == GpuCommandBufferMsg_RetireSyncPoint::ID && |
first_message->routing_id() == routing_id) { |
return 1; |
} |
@@ -705,6 +703,8 @@ void GpuChannel::HandleMessage() { |
if (stub) { |
if (!stub->IsScheduled()) |
return; |
+ // TODO: We might want to still retire sync points, and mostly |
+ // care about preempting flushes here. |
if (stub->IsPreempted()) { |
OnScheduled(); |
return; |
@@ -749,16 +749,16 @@ void GpuChannel::HandleMessage() { |
break; |
// We process the pending messages immediately if these messages matches |
- // the pattern of SwapBuffers, for example, GLRenderer always issues |
- // SwapBuffers calls with a specific IPC message patterns, for example, |
- // it should be AsyncFlush->Echo sequence. |
+ // the pattern of Flush followed by Insert/RetireSyncPoint since |
+ // sync points imply a Flush. |
// |
// Instead of posting a task to message loop, it could avoid the possibility |
- // of being blocked by other channels, and make SwapBuffers executed as soon |
- // as possible. |
+ // of being blocked by other channels, and signal clients or unblock waiting |
+ // contexts as soon as possible. |
if (!should_handle_swapbuffer_msgs_immediate) { |
- // Start from the current processing message to match SwapBuffer pattern. |
- matched_messages_num = MatchSwapBufferMessagesPattern(message.get()); |
+ // Start from the current processing message to match RetireSyncPoint |
+ // pattern. |
+ matched_messages_num = MatchRetireSyncPointPattern(message.get()); |
should_handle_swapbuffer_msgs_immediate = |
matched_messages_num > 0 && stub; |
} else { |