| 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 181a5addd12905ca1d1694d09713775df847a5cf..74a0bbc778f8b96a04fed1a3747d1eff309f3d17 100644
|
| --- a/content/browser/android/synchronous_compositor_host.cc
|
| +++ b/content/browser/android/synchronous_compositor_host.cc
|
| @@ -98,7 +98,8 @@ bool SynchronousCompositorHost::OnMessageReceived(const IPC::Message& message) {
|
| return handled;
|
| }
|
|
|
| -void SynchronousCompositorHost::DemandDrawHwAsync(
|
| +scoped_refptr<SynchronousCompositor::FrameFuture>
|
| +SynchronousCompositorHost::DemandDrawHwAsync(
|
| const gfx::Size& viewport_size,
|
| const gfx::Rect& viewport_rect_for_tile_priority,
|
| const gfx::Transform& transform_for_tile_priority) {
|
| @@ -106,9 +107,13 @@ void SynchronousCompositorHost::DemandDrawHwAsync(
|
| viewport_rect_for_tile_priority,
|
| transform_for_tile_priority);
|
| sender_->Send(new SyncCompositorMsg_DemandDrawHwAsync(routing_id_, params));
|
| +
|
| + frame_future_ = new SynchronousCompositor::FrameFuture();
|
| + return frame_future_;
|
| }
|
|
|
| -SynchronousCompositor::Frame SynchronousCompositorHost::DemandDrawHw(
|
| +scoped_refptr<SynchronousCompositor::FrameFuture>
|
| +SynchronousCompositorHost::DemandDrawHw(
|
| const gfx::Size& viewport_size,
|
| const gfx::Rect& viewport_rect_for_tile_priority,
|
| const gfx::Transform& transform_for_tile_priority) {
|
| @@ -122,12 +127,17 @@ SynchronousCompositor::Frame SynchronousCompositorHost::DemandDrawHw(
|
| if (!sender_->Send(new SyncCompositorMsg_DemandDrawHw(
|
| routing_id_, params, &common_renderer_params, &output_surface_id,
|
| &compositor_frame))) {
|
| - return SynchronousCompositor::Frame();
|
| + // return SynchronousCompositor::Frame();
|
| + return nullptr;
|
| }
|
|
|
| ProcessCommonParams(common_renderer_params);
|
|
|
| - return ProcessHardwareFrame(output_surface_id, std::move(compositor_frame));
|
| + frame_future_ = new SynchronousCompositor::FrameFuture();
|
| + frame_future_->setFrame(
|
| + ProcessHardwareFrame(output_surface_id, std::move(compositor_frame)));
|
| +
|
| + return frame_future_;
|
| }
|
|
|
| bool SynchronousCompositorHost::DemandDrawHwReceiveFrame(
|
| @@ -135,27 +145,31 @@ bool SynchronousCompositorHost::DemandDrawHwReceiveFrame(
|
| SyncCompositorHostMsg_ReturnFrame::Param param;
|
| if (!SyncCompositorHostMsg_ReturnFrame::Read(&message, ¶m))
|
| return false;
|
| - uint32_t output_surface_id = std::get<0>(param);
|
| - cc::CompositorFrame compositor_frame = std::move(std::get<1>(param));
|
| - client_->OnDrawHardwareProcessFrame(
|
| - ProcessHardwareFrame(output_surface_id, std::move(compositor_frame)));
|
| + // uint32_t output_surface_id = std::get<0>(param);
|
| + // cc::CompositorFrame compositor_frame = std::move(std::get<1>(param));
|
| + // TODO(ojars):
|
| + // client_->OnDrawHardwareProcessFrame(
|
| + // ProcessHardwareFrame(output_surface_id, std::move(compositor_frame)));
|
| return true;
|
| }
|
|
|
| -SynchronousCompositor::Frame SynchronousCompositorHost::ProcessHardwareFrame(
|
| +std::unique_ptr<SynchronousCompositor::Frame>
|
| +SynchronousCompositorHost::ProcessHardwareFrame(
|
| uint32_t output_surface_id,
|
| cc::CompositorFrame compositor_frame) {
|
| - SynchronousCompositor::Frame frame;
|
| - frame.frame.reset(new cc::CompositorFrame);
|
| - frame.output_surface_id = output_surface_id;
|
| - *frame.frame = std::move(compositor_frame);
|
| - if (!frame.frame->delegated_frame_data) {
|
| + auto frame = base::MakeUnique<SynchronousCompositor::Frame>();
|
| + // SynchronousCompositor::Frame frame;
|
| + frame->frame.reset(new cc::CompositorFrame);
|
| + frame->output_surface_id = output_surface_id;
|
| + *(frame->frame) = std::move(compositor_frame);
|
| + if (!frame->frame->delegated_frame_data) {
|
| // This can happen if compositor did not swap in this draw.
|
| - frame.frame.reset();
|
| + frame->frame.reset();
|
| }
|
| - if (frame.frame) {
|
| - UpdateFrameMetaData(frame.frame->metadata.Clone());
|
| + if (frame->frame) {
|
| + UpdateFrameMetaData(frame->frame->metadata.Clone());
|
| }
|
| + // return base::MakeUnique<SynchronousCompositor::Frame>(frame);
|
| return frame;
|
| }
|
|
|
|
|