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

Unified Diff: content/renderer/gpu/compositor_output_surface.cc

Issue 11833009: Provide a vsync notification to the renderer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 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/renderer/gpu/compositor_output_surface.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/compositor_output_surface.cc
diff --git a/content/renderer/gpu/compositor_output_surface.cc b/content/renderer/gpu/compositor_output_surface.cc
index 2b18c357317fa617559009923ae85cdb946e9e05..9856d3d957630d0b055852f1cc94b1aa32f04371 100644
--- a/content/renderer/gpu/compositor_output_surface.cc
+++ b/content/renderer/gpu/compositor_output_surface.cc
@@ -37,7 +37,9 @@ namespace content {
IPC::ForwardingMessageFilter* CompositorOutputSurface::CreateFilter(
base::TaskRunner* target_task_runner)
{
- uint32 messages_to_filter[] = {ViewMsg_UpdateVSyncParameters::ID};
+ uint32 messages_to_filter[] = {
+ ViewMsg_UpdateVSyncParameters::ID, ViewMsg_DidVSync::ID
+ };
return new IPC::ForwardingMessageFilter(
messages_to_filter, arraysize(messages_to_filter),
target_task_runner);
@@ -116,6 +118,7 @@ void CompositorOutputSurface::OnMessageReceived(const IPC::Message& message) {
return;
IPC_BEGIN_MESSAGE_MAP(CompositorOutputSurface, message)
IPC_MESSAGE_HANDLER(ViewMsg_UpdateVSyncParameters, OnUpdateVSyncParameters);
+ IPC_MESSAGE_HANDLER(ViewMsg_DidVSync, DidVSync);
IPC_END_MESSAGE_MAP()
}
@@ -126,6 +129,18 @@ void CompositorOutputSurface::OnUpdateVSyncParameters(
client_->OnVSyncParametersChanged(timebase, interval);
}
+void CompositorOutputSurface::EnableVSyncNotification(bool enable) {
+ DCHECK(CalledOnValidThread());
+ DCHECK(client_);
+ Send(new ViewHostMsg_EnableVSyncNotification(routing_id_, enable));
+}
+
+void CompositorOutputSurface::DidVSync(base::TimeTicks frame_time) {
+ DCHECK(CalledOnValidThread());
+ DCHECK(client_);
+ client_->DidVSync(frame_time);
+}
+
bool CompositorOutputSurface::Send(IPC::Message* message) {
return ChildThread::current()->sync_message_filter()->Send(message);
}
« no previous file with comments | « content/renderer/gpu/compositor_output_surface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698