Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Unified Diff: content/renderer/android/synchronous_compositor_proxy.cc

Issue 2096493002: Make cc::CompositorFrames movable [Part 1 of 2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Dana's nits Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..8b4cec138da12250210485a66fa876a727ba7e1c 100644
--- a/content/renderer/android/synchronous_compositor_proxy.cc
+++ b/content/renderer/android/synchronous_compositor_proxy.cc
@@ -167,29 +167,28 @@ void SynchronousCompositorProxy::DemandDrawHw(
if (inside_receive_) {
// Did not swap.
- cc::CompositorFrame empty_frame;
- SendDemandDrawHwReply(&empty_frame, 0u, reply_message);
+ SendDemandDrawHwReply(cc::CompositorFrame(), 0u, reply_message);
inside_receive_ = false;
}
}
void SynchronousCompositorProxy::SwapBuffersHw(uint32_t output_surface_id,
- cc::CompositorFrame* frame) {
+ cc::CompositorFrame frame) {
DCHECK(inside_receive_);
DCHECK(hardware_draw_reply_);
- DCHECK(frame);
- SendDemandDrawHwReply(frame, output_surface_id, hardware_draw_reply_);
+ SendDemandDrawHwReply(std::move(frame), output_surface_id,
+ hardware_draw_reply_);
inside_receive_ = false;
}
void SynchronousCompositorProxy::SendDemandDrawHwReply(
- cc::CompositorFrame* frame,
+ 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 +251,7 @@ void SynchronousCompositorProxy::DemandDrawSw(
}
if (inside_receive_) {
// Did not swap.
- cc::CompositorFrame empty_frame;
- SendDemandDrawSwReply(false, &empty_frame, reply_message);
+ SendDemandDrawSwReply(false, cc::CompositorFrame(), reply_message);
inside_receive_ = false;
}
}
@@ -280,33 +278,32 @@ void SynchronousCompositorProxy::DoDemandDrawSw(
output_surface_->DemandDrawSw(&canvas);
}
-void SynchronousCompositorProxy::SwapBuffersSw(cc::CompositorFrame* frame) {
+void SynchronousCompositorProxy::SwapBuffersSw(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,
+ 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) {
+ 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));
}
}
« no previous file with comments | « content/renderer/android/synchronous_compositor_proxy.h ('k') | content/renderer/gpu/compositor_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698