OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/compositor_frame_sink_support.h" | 5 #include "cc/surfaces/compositor_frame_sink_support.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 // |has_damage| is not transmitted, but false by default. | 113 // |has_damage| is not transmitted, but false by default. |
114 DCHECK(!ack.has_damage); | 114 DCHECK(!ack.has_damage); |
115 if (begin_frame_source_) | 115 if (begin_frame_source_) |
116 begin_frame_source_->DidFinishFrame(this, ack); | 116 begin_frame_source_->DidFinishFrame(this, ack); |
117 } | 117 } |
118 | 118 |
119 void CompositorFrameSinkSupport::SubmitCompositorFrame( | 119 void CompositorFrameSinkSupport::SubmitCompositorFrame( |
120 const LocalSurfaceId& local_surface_id, | 120 const LocalSurfaceId& local_surface_id, |
121 CompositorFrame frame) { | 121 CompositorFrame frame) { |
122 DCHECK(surface_factory_); | 122 DCHECK(surface_factory_); |
123 ++ack_pending_count_; | |
124 | |
125 DCHECK_GE(frame.metadata.begin_frame_ack.sequence_number, | 123 DCHECK_GE(frame.metadata.begin_frame_ack.sequence_number, |
126 BeginFrameArgs::kStartingFrameNumber); | 124 BeginFrameArgs::kStartingFrameNumber); |
| 125 DCHECK(!frame.render_pass_list.empty()); |
| 126 |
| 127 ++ack_pending_count_; |
127 | 128 |
128 // |has_damage| is not transmitted. | 129 // |has_damage| is not transmitted. |
129 frame.metadata.begin_frame_ack.has_damage = true; | 130 frame.metadata.begin_frame_ack.has_damage = true; |
130 | 131 |
131 BeginFrameAck ack = frame.metadata.begin_frame_ack; | 132 BeginFrameAck ack = frame.metadata.begin_frame_ack; |
132 surface_factory_->SubmitCompositorFrame( | 133 surface_factory_->SubmitCompositorFrame( |
133 local_surface_id, std::move(frame), | 134 local_surface_id, std::move(frame), |
134 base::Bind(&CompositorFrameSinkSupport::DidReceiveCompositorFrameAck, | 135 base::Bind(&CompositorFrameSinkSupport::DidReceiveCompositorFrameAck, |
135 weak_factory_.GetWeakPtr()), | 136 weak_factory_.GetWeakPtr()), |
136 base::BindRepeating(&CompositorFrameSinkSupport::WillDrawSurface, | 137 base::BindRepeating(&CompositorFrameSinkSupport::WillDrawSurface, |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 begin_frame_source_->RemoveObserver(this); | 263 begin_frame_source_->RemoveObserver(this); |
263 } | 264 } |
264 | 265 |
265 void CompositorFrameSinkSupport::RequestCopyOfSurface( | 266 void CompositorFrameSinkSupport::RequestCopyOfSurface( |
266 std::unique_ptr<CopyOutputRequest> request) { | 267 std::unique_ptr<CopyOutputRequest> request) { |
267 DCHECK(surface_factory_); | 268 DCHECK(surface_factory_); |
268 surface_factory_->RequestCopyOfSurface(std::move(request)); | 269 surface_factory_->RequestCopyOfSurface(std::move(request)); |
269 } | 270 } |
270 | 271 |
271 } // namespace cc | 272 } // namespace cc |
OLD | NEW |