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 cc55ffa884adf3be780559afa7a34e574381b9f3..3722aded40d82247d25b7479c0769925fca4d039 100644 |
| --- a/content/renderer/gpu/compositor_output_surface.cc |
| +++ b/content/renderer/gpu/compositor_output_surface.cc |
| @@ -9,6 +9,8 @@ |
| #include "cc/output/compositor_frame.h" |
| #include "cc/output/compositor_frame_ack.h" |
| #include "cc/output/output_surface_client.h" |
| +#include "content/common/gpu/client/command_buffer_proxy_impl.h" |
| +#include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
| #include "content/common/view_messages.h" |
| #include "content/public/common/content_switches.h" |
| #include "content/renderer/render_thread_impl.h" |
| @@ -52,9 +54,9 @@ IPC::ForwardingMessageFilter* CompositorOutputSurface::CreateFilter( |
| CompositorOutputSurface::CompositorOutputSurface( |
| int32 routing_id, |
| - WebGraphicsContext3D* context3D, |
| + WebGraphicsContext3DCommandBufferImpl* context3D, |
| cc::SoftwareOutputDevice* software_device) |
| - : OutputSurface(make_scoped_ptr(context3D), |
| + : OutputSurface(scoped_ptr<WebKit::WebGraphicsContext3D>(context3D), |
| make_scoped_ptr(software_device)), |
| output_surface_filter_( |
| RenderThreadImpl::current()->compositor_output_surface_filter()), |
| @@ -100,6 +102,32 @@ void CompositorOutputSurface::SendFrameToParentCompositor( |
| Send(new ViewHostMsg_SwapCompositorFrame(routing_id_, *frame)); |
| } |
| +void CompositorOutputSurface::SwapBuffers( |
| + const cc::LatencyInfo& latency_info) { |
| + WebGraphicsContext3DCommandBufferImpl* command_buffer = |
| + static_cast<WebGraphicsContext3DCommandBufferImpl*>(context3d()); |
| + CommandBufferProxyImpl* command_buffer_proxy = |
| + command_buffer->GetCommandBufferProxy(); |
| + if (command_buffer_proxy) { |
|
piman
2013/04/03 18:05:09
I think DCHECK is enough. If we're able to send co
|
| + context3d()->flush(); |
|
piman
2013/04/03 18:05:09
nit: shallowFlush
|
| + command_buffer_proxy->SetLatencyInfo(latency_info); |
| + } |
| + OutputSurface::SwapBuffers(latency_info); |
| +} |
| + |
| +void CompositorOutputSurface::PostSubBuffer( |
| + gfx::Rect rect, const cc::LatencyInfo& latency_info) { |
| + WebGraphicsContext3DCommandBufferImpl* command_buffer = |
| + static_cast<WebGraphicsContext3DCommandBufferImpl*>(context3d()); |
| + CommandBufferProxyImpl* command_buffer_proxy = |
| + command_buffer->GetCommandBufferProxy(); |
| + if (command_buffer_proxy) { |
|
piman
2013/04/03 18:05:09
just DCHECK
|
| + context3d()->flush(); |
|
piman
2013/04/03 18:05:09
nit: shallowFlush
|
| + command_buffer_proxy->SetLatencyInfo(latency_info); |
| + } |
| + OutputSurface::PostSubBuffer(rect, latency_info); |
| +} |
| + |
| void CompositorOutputSurface::OnMessageReceived(const IPC::Message& message) { |
| DCHECK(CalledOnValidThread()); |
| if (!client_) |