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

Unified Diff: content/browser/android/synchronous_compositor_host.cc

Issue 2458743002: Switching to base::Optional<CompositorFrame> in Android's synchronous compositor IPC messages (Closed)
Patch Set: Style Created 4 years, 2 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/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 eb5a90fa6d0287d38f18ce369f439becf52ab5f9..b2a2ffc860849ddfa462e05ff8b7618887675f48 100644
--- a/content/browser/android/synchronous_compositor_host.cc
+++ b/content/browser/android/synchronous_compositor_host.cc
@@ -121,7 +121,7 @@ SynchronousCompositor::Frame SynchronousCompositorHost::DemandDrawHw(
viewport_rect_for_tile_priority,
transform_for_tile_priority);
uint32_t compositor_frame_sink_id;
- cc::CompositorFrame compositor_frame;
+ base::Optional<cc::CompositorFrame> compositor_frame;
SyncCompositorCommonRendererParams common_renderer_params;
if (!sender_->Send(new SyncCompositorMsg_DemandDrawHw(
@@ -132,8 +132,11 @@ SynchronousCompositor::Frame SynchronousCompositorHost::DemandDrawHw(
ProcessCommonParams(common_renderer_params);
+ if (!compositor_frame)
+ return SynchronousCompositor::Frame();
+
return ProcessHardwareFrame(compositor_frame_sink_id,
- std::move(compositor_frame));
+ std::move(*compositor_frame));
}
SynchronousCompositor::Frame SynchronousCompositorHost::ProcessHardwareFrame(
@@ -143,13 +146,7 @@ SynchronousCompositor::Frame SynchronousCompositorHost::ProcessHardwareFrame(
frame.frame.reset(new cc::CompositorFrame);
frame.compositor_frame_sink_id = compositor_frame_sink_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();
- }
- if (frame.frame) {
- UpdateFrameMetaData(frame.frame->metadata.Clone());
- }
+ UpdateFrameMetaData(frame.frame->metadata.Clone());
return frame;
}
« no previous file with comments | « content/browser/android/synchronous_compositor_browser_filter.cc ('k') | content/common/android/sync_compositor_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698