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

Unified Diff: content/browser/renderer_host/render_message_filter.cc

Issue 8498036: Delay UpdateRect until the SwapBuffers callback when accelerated compositing is on. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: allow multiple update messages in flight Created 9 years 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
Index: content/browser/renderer_host/render_message_filter.cc
diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc
index fe937b20804296ad6e91353b0f27f424a671bcb9..238a1a27271cda7943b857aaa5a6cce40585911b 100644
--- a/content/browser/renderer_host/render_message_filter.cc
+++ b/content/browser/renderer_host/render_message_filter.cc
@@ -357,6 +357,7 @@ bool RenderMessageFilter::OnMessageReceived(const IPC::Message& message,
OnOpenChannelToPpapiBroker)
IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_UpdateRect,
render_widget_helper_->DidReceiveUpdateMsg(message))
+ IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnUpdateIsDelayed)
IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_CheckPermission,
OnCheckNotificationPermission)
IPC_MESSAGE_HANDLER(ChildProcessHostMsg_SyncAllocateSharedMemory,
@@ -889,3 +890,16 @@ void RenderMessageFilter::OnCompletedOpenChannelToNpapiPlugin(
DCHECK(ContainsKey(plugin_host_clients_, client));
plugin_host_clients_.erase(client);
}
+
+void RenderMessageFilter::OnUpdateIsDelayed(const IPC::Message& msg) {
+ // When not in accelerated compositing mode, in certain cases (e.g. waiting
+ // for a resize or if no backing store) the RenderWidgetHost is blocking the
+ // UI thread for some time, waiting for an UpdateRect from the renderer. If we
+ // are going to switch to accelerated compositing, the GPU process may need
+ // round-trips to the UI thread before finishing the frame, causing deadlocks
+ // if we delay the UpdateRect until we receive the OnSwapBuffersComplete. So
+ // the renderer sent us this message, so that we can unblock the UI thread.
+ // We will simply re-use the UpdateRect unblock mechanism, just with a
+ // different message.
+ render_widget_helper_->DidReceiveUpdateMsg(msg);
+}
« no previous file with comments | « content/browser/renderer_host/render_message_filter.h ('k') | content/browser/renderer_host/render_widget_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698