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

Unified Diff: cc/surfaces/direct_compositor_frame_sink.cc

Issue 2755463002: [cc] Fix CompositorFrameSinkSupport BeginFrameAck interface. (Closed)
Patch Set: sync Created 3 years, 9 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: cc/surfaces/direct_compositor_frame_sink.cc
diff --git a/cc/surfaces/direct_compositor_frame_sink.cc b/cc/surfaces/direct_compositor_frame_sink.cc
index a915b941c1e6ada8c17fff3cefbfd350d8e76c1a..a3c55c0beb062fa23a1f90bef7ab42768d77aa70 100644
--- a/cc/surfaces/direct_compositor_frame_sink.cc
+++ b/cc/surfaces/direct_compositor_frame_sink.cc
@@ -94,6 +94,10 @@ void DirectCompositorFrameSink::DetachFromClient() {
}
void DirectCompositorFrameSink::SubmitCompositorFrame(CompositorFrame frame) {
+ DCHECK(frame.metadata.begin_frame_ack.has_damage);
+ DCHECK_LE(BeginFrameArgs::kStartingFrameNumber,
+ frame.metadata.begin_frame_ack.sequence_number);
+
gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size();
if (frame_size.IsEmpty() || frame_size != last_swap_frame_size_) {
delegated_local_surface_id_ = local_surface_id_allocator_.GenerateId();
@@ -151,7 +155,9 @@ void DirectCompositorFrameSink::OnNeedsBeginFrames(bool needs_begin_frame) {
}
void DirectCompositorFrameSink::OnDidFinishFrame(const BeginFrameAck& ack) {
- support_->DidFinishFrame(ack);
+ // If there was damage, SubmitCompositorFrame includes the ack.
+ if (!ack.has_damage)
+ support_->BeginFrameDidNotSwap(ack);
}
} // namespace cc
« no previous file with comments | « cc/surfaces/compositor_frame_sink_support_unittest.cc ('k') | cc/surfaces/direct_compositor_frame_sink_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698