Index: content/browser/android/synchronous_compositor_host.cc |
diff --git a/content/browser/android/synchronous_compositor_host.cc b/content/browser/android/synchronous_compositor_host.cc |
index b0e0b9dab5a7012e3af9754467aba79c169f46ee..e8fecd035a62ac56742afa6f4f070c233cacbe35 100644 |
--- a/content/browser/android/synchronous_compositor_host.cc |
+++ b/content/browser/android/synchronous_compositor_host.cc |
@@ -88,6 +88,7 @@ bool SynchronousCompositorHost::OnMessageReceived(const IPC::Message& message) { |
IPC_MESSAGE_HANDLER(SyncCompositorHostMsg_OutputSurfaceCreated, |
OutputSurfaceCreated) |
IPC_MESSAGE_HANDLER(SyncCompositorHostMsg_UpdateState, ProcessCommonParams) |
+ IPC_MESSAGE_HANDLER(CompositorHostMsg_Frame, ReceiveFrame) |
IPC_MESSAGE_UNHANDLED(handled = false) |
IPC_END_MESSAGE_MAP() |
return handled; |
@@ -106,20 +107,46 @@ SynchronousCompositor::Frame SynchronousCompositorHost::DemandDrawHw( |
SynchronousCompositor::Frame frame; |
frame.frame.reset(new cc::CompositorFrame); |
SyncCompositorCommonRendererParams common_renderer_params; |
- if (!sender_->Send(new SyncCompositorMsg_DemandDrawHw( |
- routing_id_, params, &common_renderer_params, |
- &frame.output_surface_id, frame.frame.get()))) { |
- return SynchronousCompositor::Frame(); |
- } |
- ProcessCommonParams(common_renderer_params); |
- if (!frame.frame->delegated_frame_data) { |
- // This can happen if compositor did not swap in this draw. |
- frame.frame.reset(); |
- } |
- if (frame.frame) { |
- UpdateFrameMetaData(frame.frame->metadata.Clone()); |
- } |
- return frame; |
+ |
+ /* Send an async message instead of a synchronous one. |
+ * Currently not sure what to do in the analogous case |
+ * when sending sync message returns false. */ |
+ // if (!sender_->Send(new SyncCompositorMsg_DemandDrawHw( |
+ // routing_id_, params, &common_renderer_params, |
+ // &frame.output_surface_id, frame.frame.get()))) { |
+ // return SynchronousCompositor::Frame(); |
+ // } |
+ |
+ sender_->Send(new CompositorMsg_DemandDrawHw(routing_id_, params)); |
+ /* Now that the sent message is async, the following processing |
+ * of the result has to be done upon receiving the reply. */ |
+ |
+ // ProcessCommonParams(common_renderer_params); |
+ // if (!frame.frame->delegated_frame_data) { |
+ // // This can happen if compositor did not swap in this draw. |
+ // frame.frame.reset(); |
+ // } |
+ // if (frame.frame) { |
+ // UpdateFrameMetaData(frame.frame->metadata.Clone()); |
+ // } |
+ // return frame; |
+ // |
+ return nullptr; |
+} |
+ |
+void SynchronousCompositorHost::ReceiveFrame( |
+ content::SyncCompositorCommonRendererParams params, |
+ uint32_t output_surface_id, |
+ cc::CompositorFrame) { |
+ // TODO: the return message is received in this class, but |
+ // the received frame should be processed in BVR class (should it?) |
+ // because other data is stored there (e.g. current frame consumer) |
+ // |
+ // Either: |
+ // 1. pass the received frame back to browser view renderer (is it |
+ // appropriate?) |
+ // or |
+ // 2. pass the necessary things from bvr to here |
} |
void SynchronousCompositorHost::UpdateFrameMetaData( |