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

Unified Diff: cc/surfaces/compositor_frame_sink_support.cc

Issue 2527283003: cc: Introduce BeginFrame sequence numbers and acknowledgements.
Patch Set: Address Brian's comments. Created 4 years 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
« no previous file with comments | « cc/surfaces/compositor_frame_sink_support.h ('k') | cc/surfaces/direct_compositor_frame_sink_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/compositor_frame_sink_support.cc
diff --git a/cc/surfaces/compositor_frame_sink_support.cc b/cc/surfaces/compositor_frame_sink_support.cc
index d28ea4a2d4f536c041f515d37c2f613847f5d114..6631dbbbcb6486c43c1308f6cc588e6c9643d41e 100644
--- a/cc/surfaces/compositor_frame_sink_support.cc
+++ b/cc/surfaces/compositor_frame_sink_support.cc
@@ -73,7 +73,12 @@ void CompositorFrameSinkSupport::SubmitCompositorFrame(
display_->Resize(frame_size);
}
}
+
+ uint64_t begin_frame_source_id = frame.metadata.begin_frame_source_id;
+ uint64_t begin_frame_number = frame.metadata.begin_frame_number;
+ uint64_t latest_confirmed_frame = frame.metadata.latest_confirmed_frame;
++ack_pending_count_;
+
surface_factory_.SubmitCompositorFrame(
local_frame_id_, std::move(frame),
base::Bind(&CompositorFrameSinkSupport::DidReceiveCompositorFrameAck,
@@ -82,6 +87,17 @@ void CompositorFrameSinkSupport::SubmitCompositorFrame(
display_->SetLocalFrameId(local_frame_id_,
frame.metadata.device_scale_factor);
}
+
+ BeginFrameAck ack(begin_frame_source_id, begin_frame_number,
+ latest_confirmed_frame, 0, true);
+ if (begin_frame_source_)
+ begin_frame_source_->DidFinishFrame(this, ack);
+}
+
+void CompositorFrameSinkSupport::BeginFrameDidNotDraw(
+ const BeginFrameAck& ack) {
+ if (begin_frame_source_)
+ begin_frame_source_->DidFinishFrame(this, ack);
}
void CompositorFrameSinkSupport::Require(const LocalFrameId& local_frame_id,
« no previous file with comments | « cc/surfaces/compositor_frame_sink_support.h ('k') | cc/surfaces/direct_compositor_frame_sink_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698