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

Unified Diff: cc/surfaces/compositor_frame_sink_support.cc

Issue 2854163003: [cc] Plumb BeginFrameAcks through SurfaceManager to DisplayScheduler. (Closed)
Patch Set: track state in DisplayScheduler rather than Surface Created 3 years, 7 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
« no previous file with comments | « no previous file | cc/surfaces/display.h » ('j') | cc/surfaces/surface_observer.h » ('J')
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 0fdb6c6855755951a03bcee2ce4fda161f209986..f42569568cee113005e6ce8673d50bcdbc5b4519 100644
--- a/cc/surfaces/compositor_frame_sink_support.cc
+++ b/cc/surfaces/compositor_frame_sink_support.cc
@@ -87,13 +87,18 @@ void CompositorFrameSinkSupport::SetNeedsBeginFrame(bool needs_begin_frame) {
void CompositorFrameSinkSupport::BeginFrameDidNotSwap(
const BeginFrameAck& ack) {
- // TODO(eseckler): While a pending CompositorFrame exists (see TODO below), we
- // should not acknowledge immediately. Instead, we should update the ack that
- // will be sent to DisplayScheduler when the pending frame is activated.
+ TRACE_EVENT2("cc", "CompositorFrameSinkSupport::BeginFrameDidNotSwap",
+ "ack.source_id", ack.source_id, "ack.sequence_number",
+ ack.sequence_number);
DCHECK_GE(ack.sequence_number, BeginFrameArgs::kStartingFrameNumber);
// |has_damage| is not transmitted, but false by default.
DCHECK(!ack.has_damage);
+
+ if (current_surface_) {
+ surface_manager_->SurfaceFinishedBeginFrame(current_surface_->surface_id(),
+ ack);
+ }
if (begin_frame_source_)
begin_frame_source_->DidFinishFrame(this, ack);
}
@@ -148,11 +153,8 @@ void CompositorFrameSinkSupport::SubmitCompositorFrame(
}
current_surface_ = std::move(surface);
- // TODO(eseckler): The CompositorFrame submitted below might not be activated
- // right away b/c of surface synchronization. We should only send the
- // BeginFrameAck to DisplayScheduler when it is activated. This also means
- // that we need to stay an active BFO while a CompositorFrame is pending.
- // See https://crbug.com/703079.
+ surface_manager_->SurfaceFinishedBeginFrame(current_surface_->surface_id(),
+ ack);
if (begin_frame_source_)
begin_frame_source_->DidFinishFrame(this, ack);
}
@@ -281,6 +283,10 @@ void CompositorFrameSinkSupport::Init(SurfaceManager* surface_manager) {
void CompositorFrameSinkSupport::OnBeginFrame(const BeginFrameArgs& args) {
UpdateNeedsBeginFramesInternal();
+ if (current_surface_) {
+ surface_manager_->SurfaceReceivedBeginFrame(current_surface_->surface_id(),
+ args);
+ }
last_begin_frame_args_ = args;
if (client_)
client_->OnBeginFrame(args);
« no previous file with comments | « no previous file | cc/surfaces/display.h » ('j') | cc/surfaces/surface_observer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698