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 5578298470470474b8abdf10107705ad9f4a7db0..0a43d41cba12ef61c05af3a4f7f81c42148c2db4 100644 |
--- a/content/renderer/gpu/compositor_output_surface.cc |
+++ b/content/renderer/gpu/compositor_output_surface.cc |
@@ -7,6 +7,7 @@ |
#include "base/message_loop_proxy.h" |
#include "cc/compositor_frame.h" |
#include "cc/output_surface_client.h" |
+#include "content/common/gpu/client/command_buffer_proxy_impl.h" |
#include "content/common/view_messages.h" |
#include "content/renderer/render_thread_impl.h" |
#include "ipc/ipc_forwarding_message_filter.h" |
@@ -35,13 +36,15 @@ IPC::ForwardingMessageFilter* CompositorOutputSurface::CreateFilter( |
CompositorOutputSurface::CompositorOutputSurface( |
int32 routing_id, |
WebGraphicsContext3D* context3D, |
+ CommandBufferProxyImpl* command_buffer_proxy, |
cc::SoftwareOutputDevice* software_device) |
: output_surface_filter_( |
RenderThreadImpl::current()->compositor_output_surface_filter()), |
client_(NULL), |
routing_id_(routing_id), |
context3D_(context3D), |
- software_device_(software_device) { |
+ software_device_(software_device), |
+ command_buffer_proxy_(command_buffer_proxy) { |
DCHECK(output_surface_filter_); |
capabilities_.has_parent_compositor = false; |
DetachFromThread(); |
@@ -78,6 +81,11 @@ bool CompositorOutputSurface::BindToClient( |
base::Bind(&CompositorOutputSurfaceProxy::OnMessageReceived, |
output_surface_proxy_)); |
+ if (command_buffer_proxy_) |
+ command_buffer_proxy_->SetLatencyInfoCallback( |
+ base::Bind(&CompositorOutputSurface::OnReceivedLatencyInfo, |
+ base::Unretained(this))); |
+ |
return true; |
} |
@@ -96,6 +104,19 @@ void CompositorOutputSurface::SendFrameToParentCompositor( |
Send(new ViewHostMsg_SwapCompositorFrame(routing_id_, frame)); |
} |
+void CompositorOutputSurface::SetLatencyInfo( |
+ const cc::LatencyInfo& latency_info) { |
+ if (command_buffer_proxy_) |
+ command_buffer_proxy_->SetLatencyInfo(latency_info); |
+} |
+ |
+void CompositorOutputSurface::OnReceivedLatencyInfo( |
+ const cc::LatencyInfo& latency_info) { |
+ DCHECK(CalledOnValidThread()); |
+ DCHECK(client_); |
+ client_->OnReceivedLatencyInfo(latency_info); |
+} |
+ |
void CompositorOutputSurface::OnMessageReceived(const IPC::Message& message) { |
DCHECK(CalledOnValidThread()); |
if (!client_) |