| 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 e50a1e93aa420458328ac9fa3628bb0006a3db65..f2577bb7374368d2d780d934d91b2decc2b0663b 100644
|
| --- a/content/renderer/gpu/compositor_output_surface.cc
|
| +++ b/content/renderer/gpu/compositor_output_surface.cc
|
| @@ -4,11 +4,14 @@
|
|
|
| #include "content/renderer/gpu/compositor_output_surface.h"
|
|
|
| +#include "base/command_line.h"
|
| #include "base/message_loop_proxy.h"
|
| #include "content/common/view_messages.h"
|
| +#include "content/public/common/content_switches.h"
|
| #include "content/renderer/render_thread_impl.h"
|
| #include "ipc/ipc_forwarding_message_filter.h"
|
| #include "ipc/ipc_sync_channel.h"
|
| +#include "ipc/ipc_sync_message_filter.h"
|
| #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorOutputSurfaceClient.h"
|
| #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3D.h"
|
|
|
| @@ -21,7 +24,10 @@ using WebKit::WebCompositorSoftwareOutputDevice;
|
| IPC::ForwardingMessageFilter* CompositorOutputSurface::CreateFilter(
|
| base::TaskRunner* target_task_runner)
|
| {
|
| - uint32 messages_to_filter[] = {ViewMsg_UpdateVSyncParameters::ID};
|
| + uint32 messages_to_filter[] = {
|
| + ViewMsg_UpdateVSyncParameters::ID,
|
| + ViewMsg_SwapCompositorFrameACK::ID,
|
| + };
|
| return new IPC::ForwardingMessageFilter(
|
| messages_to_filter, arraysize(messages_to_filter),
|
| target_task_runner);
|
| @@ -38,7 +44,9 @@ CompositorOutputSurface::CompositorOutputSurface(
|
| context3D_(context3D),
|
| software_device_(software_device) {
|
| DCHECK(output_surface_filter_);
|
| - capabilities_.hasParentCompositor = false;
|
| + CommandLine* command_line = CommandLine::ForCurrentProcess();
|
| + capabilities_.hasParentCompositor = command_line->HasSwitch(
|
| + switches::kEnableDelegatedRenderer);
|
| DetachFromThread();
|
| }
|
|
|
| @@ -87,9 +95,9 @@ WebCompositorSoftwareOutputDevice* CompositorOutputSurface::softwareDevice()
|
| }
|
|
|
| void CompositorOutputSurface::sendFrameToParentCompositor(
|
| - const WebKit::WebCompositorFrame&) {
|
| + const WebKit::WebCompositorFrame& frame) {
|
| DCHECK(CalledOnValidThread());
|
| - NOTREACHED();
|
| + Send(new ViewHostMsg_SwapCompositorFrame(routing_id_, frame));
|
| }
|
|
|
| void CompositorOutputSurface::OnMessageReceived(const IPC::Message& message) {
|
| @@ -98,6 +106,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_SwapCompositorFrameACK, OnSwapCompositorFrameACK);
|
| IPC_END_MESSAGE_MAP()
|
| }
|
|
|
| @@ -112,3 +121,12 @@ void CompositorOutputSurface::OnUpdateVSyncParameters(
|
| static_cast<double>(base::Time::kMicrosecondsPerSecond);
|
| client_->onVSyncParametersChanged(monotonicTimebase, intervalInSeconds);
|
| }
|
| +
|
| +void CompositorOutputSurface::OnSwapCompositorFrameACK(
|
| + const WebKit::WebCompositorFrameAck& ack) {
|
| + client_->onSendFrameToParentCompositorAck(ack);
|
| +}
|
| +
|
| +bool CompositorOutputSurface::Send(IPC::Message* message) {
|
| + return ChildThread::current()->sync_message_filter()->Send(message);
|
| +}
|
|
|