| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 frame.metadata.begin_frame_ack.sequence_number = | 139 frame.metadata.begin_frame_ack.sequence_number = |
| 140 BeginFrameArgs::kStartingFrameNumber; | 140 BeginFrameArgs::kStartingFrameNumber; |
| 141 } | 141 } |
| 142 // |has_damage| is not transmitted. | 142 // |has_damage| is not transmitted. |
| 143 frame.metadata.begin_frame_ack.has_damage = true; | 143 frame.metadata.begin_frame_ack.has_damage = true; |
| 144 | 144 |
| 145 BeginFrameAck ack = frame.metadata.begin_frame_ack; | 145 BeginFrameAck ack = frame.metadata.begin_frame_ack; |
| 146 surface_factory_->SubmitCompositorFrame( | 146 surface_factory_->SubmitCompositorFrame( |
| 147 local_surface_id, std::move(frame), | 147 local_surface_id, std::move(frame), |
| 148 base::Bind(&CompositorFrameSinkSupport::DidReceiveCompositorFrameAck, | 148 base::Bind(&CompositorFrameSinkSupport::DidReceiveCompositorFrameAck, |
| 149 weak_factory_.GetWeakPtr())); | 149 weak_factory_.GetWeakPtr()), |
| 150 base::BindRepeating(&CompositorFrameSinkSupport::WillDrawSurface, |
| 151 weak_factory_.GetWeakPtr())); |
| 150 | 152 |
| 151 // TODO(eseckler): The CompositorFrame submitted below might not be activated | 153 // TODO(eseckler): The CompositorFrame submitted below might not be activated |
| 152 // right away b/c of surface synchronization. We should only send the | 154 // right away b/c of surface synchronization. We should only send the |
| 153 // BeginFrameAck to DisplayScheduler when it is activated. This also means | 155 // BeginFrameAck to DisplayScheduler when it is activated. This also means |
| 154 // that we need to stay an active BFO while a CompositorFrame is pending. | 156 // that we need to stay an active BFO while a CompositorFrame is pending. |
| 155 // See https://crbug.com/703079. | 157 // See https://crbug.com/703079. |
| 156 if (begin_frame_source_) | 158 if (begin_frame_source_) |
| 157 begin_frame_source_->DidFinishFrame(this, ack); | 159 begin_frame_source_->DidFinishFrame(this, ack); |
| 158 } | 160 } |
| 159 | 161 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 begin_frame_source_->RemoveObserver(this); | 274 begin_frame_source_->RemoveObserver(this); |
| 273 } | 275 } |
| 274 | 276 |
| 275 void CompositorFrameSinkSupport::RequestCopyOfSurface( | 277 void CompositorFrameSinkSupport::RequestCopyOfSurface( |
| 276 std::unique_ptr<CopyOutputRequest> request) { | 278 std::unique_ptr<CopyOutputRequest> request) { |
| 277 DCHECK(surface_factory_); | 279 DCHECK(surface_factory_); |
| 278 surface_factory_->RequestCopyOfSurface(std::move(request)); | 280 surface_factory_->RequestCopyOfSurface(std::move(request)); |
| 279 } | 281 } |
| 280 | 282 |
| 281 } // namespace cc | 283 } // namespace cc |
| OLD | NEW |