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

Unified Diff: cc/surfaces/compositor_frame_sink_support.cc

Issue 2527283003: cc: Introduce BeginFrame sequence numbers and acknowledgements.
Patch Set: . 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
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 011d9a091583d27ac07bb3598771baae74a3fc0a..aaee98b185fe45917a8674898ecb1c93d97ce117 100644
--- a/cc/surfaces/compositor_frame_sink_support.cc
+++ b/cc/surfaces/compositor_frame_sink_support.cc
@@ -67,7 +67,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 oldest_incorporated_frame = frame.metadata.oldest_incorporated_frame;
++ack_pending_count_;
+
surface_factory_.SubmitCompositorFrame(
local_frame_id_, std::move(frame),
base::Bind(&CompositorFrameSinkSupport::DidReceiveCompositorFrameAck,
@@ -76,6 +81,17 @@ void CompositorFrameSinkSupport::SubmitCompositorFrame(
display_->SetLocalFrameId(local_frame_id_,
frame.metadata.device_scale_factor);
}
+
+ BeginFrameAck ack(begin_frame_source_id, begin_frame_number, true,
+ oldest_incorporated_frame, 0);
+ 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::DidReceiveCompositorFrameAck() {

Powered by Google App Engine
This is Rietveld 408576698