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

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

Issue 13068002: Send vsync notification from browser to renderer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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
Index: content/browser/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 4b02fda8cd5ef8c1bacf20bce2d5ebaff8845ef6..af036956f1420f308e200557e31d59e34e9e0aea 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -364,6 +364,8 @@ bool RenderWidgetHostImpl::OnMessageReceived(const IPC::Message &msg) {
OnCompositorSurfaceBuffersSwapped)
IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame,
msg_is_ok = OnSwapCompositorFrame(msg))
+ IPC_MESSAGE_HANDLER(ViewHostMsg_EnableVSyncNotification,
+ OnEnableVSyncNotification)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnUpdateIsDelayed)
IPC_MESSAGE_HANDLER(ViewHostMsg_HandleInputEvent_ACK, OnInputEventAck)
@@ -1294,6 +1296,10 @@ void RenderWidgetHostImpl::UpdateVSyncParameters(base::TimeTicks timebase,
Send(new ViewMsg_UpdateVSyncParameters(GetRoutingID(), timebase, interval));
}
+void RenderWidgetHostImpl::SendVSync(base::TimeTicks frame_time) {
+ Send(new ViewMsg_DidVSync(GetRoutingID(), frame_time));
+}
+
void RenderWidgetHostImpl::RendererExited(base::TerminationStatus status,
int exit_code) {
// Clearing this flag causes us to re-create the renderer when recovering
@@ -1624,6 +1630,12 @@ bool RenderWidgetHostImpl::OnSwapCompositorFrame(
return true;
}
+void RenderWidgetHostImpl::OnEnableVSyncNotification(bool enable) {
+ TRACE_EVENT1("renderer_host",
+ "RenderWidgetHostImpl::OnEnableVSyncNotification", "enable", enable);
+ view_->EnableVSyncNotification(enable);
+}
+
void RenderWidgetHostImpl::OnUpdateRect(
const ViewHostMsg_UpdateRect_Params& params) {
TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnUpdateRect");

Powered by Google App Engine
This is Rietveld 408576698