Chromium Code Reviews| Index: content/renderer/android/synchronous_compositor_proxy.cc |
| diff --git a/content/renderer/android/synchronous_compositor_proxy.cc b/content/renderer/android/synchronous_compositor_proxy.cc |
| index 0ef157f5b5f205db76386ecd3cc0db08efdf01da..832438456fd7357462173ffe9f2c467331d4e262 100644 |
| --- a/content/renderer/android/synchronous_compositor_proxy.cc |
| +++ b/content/renderer/android/synchronous_compositor_proxy.cc |
| @@ -167,29 +167,32 @@ void SynchronousCompositorProxy::DemandDrawHw( |
| if (inside_receive_) { |
| // Did not swap. |
| - cc::CompositorFrame empty_frame; |
| - SendDemandDrawHwReply(&empty_frame, 0u, reply_message); |
| + std::unique_ptr<cc::CompositorFrame> empty_frame( |
| + cc::CompositorFrame::Create()); |
| + SendDemandDrawHwReply(std::move(empty_frame), 0u, reply_message); |
| inside_receive_ = false; |
| } |
| } |
| -void SynchronousCompositorProxy::SwapBuffersHw(uint32_t output_surface_id, |
| - cc::CompositorFrame* frame) { |
| +void SynchronousCompositorProxy::SwapBuffersHw( |
| + uint32_t output_surface_id, |
| + std::unique_ptr<cc::CompositorFrame> frame) { |
| DCHECK(inside_receive_); |
| DCHECK(hardware_draw_reply_); |
| - DCHECK(frame); |
| - SendDemandDrawHwReply(frame, output_surface_id, hardware_draw_reply_); |
| + DCHECK(frame.get()); |
|
danakj
2016/06/23 20:34:41
no .get() needed. unique_ptr is testable
|
| + SendDemandDrawHwReply(std::move(frame), output_surface_id, |
| + hardware_draw_reply_); |
| inside_receive_ = false; |
| } |
| void SynchronousCompositorProxy::SendDemandDrawHwReply( |
| - cc::CompositorFrame* frame, |
| + std::unique_ptr<cc::CompositorFrame> frame, |
| uint32_t output_surface_id, |
| IPC::Message* reply_message) { |
| SyncCompositorCommonRendererParams common_renderer_params; |
| PopulateCommonParams(&common_renderer_params); |
| SyncCompositorMsg_DemandDrawHw::WriteReplyParams( |
| - reply_message, common_renderer_params, output_surface_id, *frame); |
| + reply_message, common_renderer_params, output_surface_id, frame); |
| Send(reply_message); |
| } |
| @@ -252,8 +255,9 @@ void SynchronousCompositorProxy::DemandDrawSw( |
| } |
| if (inside_receive_) { |
| // Did not swap. |
| - cc::CompositorFrame empty_frame; |
| - SendDemandDrawSwReply(false, &empty_frame, reply_message); |
| + std::unique_ptr<cc::CompositorFrame> empty_frame( |
| + cc::CompositorFrame::Create()); |
| + SendDemandDrawSwReply(false, std::move(empty_frame), reply_message); |
| inside_receive_ = false; |
| } |
| } |
| @@ -280,33 +284,35 @@ void SynchronousCompositorProxy::DoDemandDrawSw( |
| output_surface_->DemandDrawSw(&canvas); |
| } |
| -void SynchronousCompositorProxy::SwapBuffersSw(cc::CompositorFrame* frame) { |
| +void SynchronousCompositorProxy::SwapBuffersSw( |
| + std::unique_ptr<cc::CompositorFrame> frame) { |
| DCHECK(inside_receive_); |
| DCHECK(software_draw_reply_); |
| DCHECK(frame); |
| - SendDemandDrawSwReply(true, frame, software_draw_reply_); |
| + SendDemandDrawSwReply(true, std::move(frame), software_draw_reply_); |
| inside_receive_ = false; |
| } |
| void SynchronousCompositorProxy::SendDemandDrawSwReply( |
| bool success, |
| - cc::CompositorFrame* frame, |
| + std::unique_ptr<cc::CompositorFrame> frame, |
| IPC::Message* reply_message) { |
| SyncCompositorCommonRendererParams common_renderer_params; |
| PopulateCommonParams(&common_renderer_params); |
| SyncCompositorMsg_DemandDrawSw::WriteReplyParams( |
| - reply_message, success, common_renderer_params, *frame); |
| + reply_message, success, common_renderer_params, frame); |
| Send(reply_message); |
| } |
| -void SynchronousCompositorProxy::SwapBuffers(uint32_t output_surface_id, |
| - cc::CompositorFrame* frame) { |
| +void SynchronousCompositorProxy::SwapBuffers( |
| + uint32_t output_surface_id, |
| + std::unique_ptr<cc::CompositorFrame> frame) { |
| DCHECK(hardware_draw_reply_ || software_draw_reply_); |
| DCHECK(!(hardware_draw_reply_ && software_draw_reply_)); |
| if (hardware_draw_reply_) { |
| - SwapBuffersHw(output_surface_id, frame); |
| + SwapBuffersHw(output_surface_id, std::move(frame)); |
| } else if (software_draw_reply_) { |
| - SwapBuffersSw(frame); |
| + SwapBuffersSw(std::move(frame)); |
| } |
| } |