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

Side by Side Diff: cc/surfaces/direct_compositor_frame_sink.cc

Issue 2888043004: [cc] Add and plumb CFS::DidNotProduceFrame. (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/surfaces/direct_compositor_frame_sink.h" 5 #include "cc/surfaces/direct_compositor_frame_sink.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "cc/output/compositor_frame.h" 8 #include "cc/output/compositor_frame.h"
9 #include "cc/output/compositor_frame_sink_client.h" 9 #include "cc/output/compositor_frame_sink_client.h"
10 #include "cc/surfaces/display.h" 10 #include "cc/surfaces/display.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 delegated_local_surface_id_ = local_surface_id_allocator_.GenerateId(); 103 delegated_local_surface_id_ = local_surface_id_allocator_.GenerateId();
104 last_swap_frame_size_ = frame_size; 104 last_swap_frame_size_ = frame_size;
105 } 105 }
106 display_->SetLocalSurfaceId(delegated_local_surface_id_, 106 display_->SetLocalSurfaceId(delegated_local_surface_id_,
107 frame.metadata.device_scale_factor); 107 frame.metadata.device_scale_factor);
108 108
109 support_->SubmitCompositorFrame(delegated_local_surface_id_, 109 support_->SubmitCompositorFrame(delegated_local_surface_id_,
110 std::move(frame)); 110 std::move(frame));
111 } 111 }
112 112
113 void DirectCompositorFrameSink::BeginFrameDidNotProduceFrame(
114 const BeginFrameAck& ack) {
115 DCHECK(!ack.has_damage);
116 DCHECK_LE(BeginFrameArgs::kStartingFrameNumber, ack.sequence_number);
117 support_->BeginFrameDidNotProduceFrame(ack);
118 }
119
113 void DirectCompositorFrameSink::DisplayOutputSurfaceLost() { 120 void DirectCompositorFrameSink::DisplayOutputSurfaceLost() {
114 is_lost_ = true; 121 is_lost_ = true;
115 client_->DidLoseCompositorFrameSink(); 122 client_->DidLoseCompositorFrameSink();
116 } 123 }
117 124
118 void DirectCompositorFrameSink::DisplayWillDrawAndSwap( 125 void DirectCompositorFrameSink::DisplayWillDrawAndSwap(
119 bool will_draw_and_swap, 126 bool will_draw_and_swap,
120 const RenderPassList& render_passes) { 127 const RenderPassList& render_passes) {
121 // This notification is not relevant to our client outside of tests. 128 // This notification is not relevant to our client outside of tests.
122 } 129 }
(...skipping 22 matching lines...) Expand all
145 void DirectCompositorFrameSink::WillDrawSurface( 152 void DirectCompositorFrameSink::WillDrawSurface(
146 const LocalSurfaceId& local_surface_id, 153 const LocalSurfaceId& local_surface_id,
147 const gfx::Rect& damage_rect) { 154 const gfx::Rect& damage_rect) {
148 // TODO(staraz): Implement this. 155 // TODO(staraz): Implement this.
149 } 156 }
150 157
151 void DirectCompositorFrameSink::OnNeedsBeginFrames(bool needs_begin_frame) { 158 void DirectCompositorFrameSink::OnNeedsBeginFrames(bool needs_begin_frame) {
152 support_->SetNeedsBeginFrame(needs_begin_frame); 159 support_->SetNeedsBeginFrame(needs_begin_frame);
153 } 160 }
154 161
155 void DirectCompositorFrameSink::OnDidFinishFrame(const BeginFrameAck& ack) { 162 void DirectCompositorFrameSink::OnDidFinishFrame(const BeginFrameAck& ack) {}
piman 2017/05/18 19:16:37 nit: Are there any non-empty OnDidFinishFrame left
Eric Seckler 2017/05/19 08:13:37 You're right, done. Also got rid of the related ob
156 // If there was damage, SubmitCompositorFrame includes the ack.
157 if (!ack.has_damage)
158 support_->BeginFrameDidNotSwap(ack);
159 }
160 163
161 } // namespace cc 164 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698