Chromium Code Reviews| 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 da0bd2a87607a19343181c0a9ad2ef1c38a8dcc9..7d20525bfc837cf1fd6805ef64a4b642043872cb 100644 |
| --- a/content/renderer/gpu/compositor_output_surface.cc |
| +++ b/content/renderer/gpu/compositor_output_surface.cc |
| @@ -9,6 +9,7 @@ |
| #include "cc/compositor_frame.h" |
| #include "cc/compositor_frame_ack.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/public/common/content_switches.h" |
| #include "content/renderer/render_thread_impl.h" |
| @@ -53,6 +54,7 @@ IPC::ForwardingMessageFilter* CompositorOutputSurface::CreateFilter( |
| CompositorOutputSurface::CompositorOutputSurface( |
| int32 routing_id, |
| WebGraphicsContext3D* context3D, |
| + CommandBufferProxyImpl* command_buffer_proxy, |
| cc::SoftwareOutputDevice* software_device) |
| : OutputSurface(make_scoped_ptr(context3D), |
| make_scoped_ptr(software_device)), |
| @@ -60,7 +62,8 @@ CompositorOutputSurface::CompositorOutputSurface( |
| RenderThreadImpl::current()->compositor_output_surface_filter()), |
| routing_id_(routing_id), |
| prefers_smoothness_(false), |
| - main_thread_id_(base::PlatformThread::CurrentId()) { |
| + main_thread_id_(base::PlatformThread::CurrentId()), |
| + command_buffer_proxy_(command_buffer_proxy) { |
| DCHECK(output_surface_filter_); |
| CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| capabilities_.has_parent_compositor = command_line->HasSwitch( |
| @@ -91,6 +94,11 @@ bool CompositorOutputSurface::BindToClient( |
| base::Bind(&CompositorOutputSurfaceProxy::OnMessageReceived, |
| output_surface_proxy_)); |
| + if (command_buffer_proxy_) |
|
apatrick_chromium
2013/03/15 19:09:35
nit: braces
|
| + command_buffer_proxy_->SetLatencyInfoCallback( |
| + base::Bind(&CompositorOutputSurface::OnReceivedLatencyInfo, |
| + base::Unretained(this))); |
| + |
| return true; |
| } |
| @@ -100,6 +108,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_) |