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

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: Reduce android_webview changes 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..5f56b6ecca85539a5e5264be10c2916056276f13 100644
--- a/content/renderer/android/synchronous_compositor_proxy.cc
+++ b/content/renderer/android/synchronous_compositor_proxy.cc
@@ -168,28 +168,28 @@ void SynchronousCompositorProxy::DemandDrawHw(
if (inside_receive_) {
// Did not swap.
cc::CompositorFrame empty_frame;
- SendDemandDrawHwReply(&empty_frame, 0u, reply_message);
+ SendDemandDrawHwReply(std::move(empty_frame), 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);
}
@@ -253,7 +253,7 @@ void SynchronousCompositorProxy::DemandDrawSw(
if (inside_receive_) {
// Did not swap.
cc::CompositorFrame empty_frame;
- SendDemandDrawSwReply(false, &empty_frame, reply_message);
+ SendDemandDrawSwReply(false, std::move(empty_frame), reply_message);
danakj 2016/06/24 18:35:11 you can just pass a cc::CompositorFrame() here, no
Fady Samuel 2016/06/24 20:00:24 Done.
inside_receive_ = false;
}
}
@@ -280,33 +280,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));
}
}

Powered by Google App Engine
This is Rietveld 408576698