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 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 void CompositorFrameSinkSupport::EvictFrame() { | 62 void CompositorFrameSinkSupport::EvictFrame() { |
63 surface_factory_.EvictSurface(); | 63 surface_factory_.EvictSurface(); |
64 } | 64 } |
65 | 65 |
66 void CompositorFrameSinkSupport::SetNeedsBeginFrame(bool needs_begin_frame) { | 66 void CompositorFrameSinkSupport::SetNeedsBeginFrame(bool needs_begin_frame) { |
67 needs_begin_frame_ = needs_begin_frame; | 67 needs_begin_frame_ = needs_begin_frame; |
68 UpdateNeedsBeginFramesInternal(); | 68 UpdateNeedsBeginFramesInternal(); |
69 } | 69 } |
70 | 70 |
| 71 void CompositorFrameSinkSupport::DidFinishFrame(const BeginFrameAck& ack) { |
| 72 if (begin_frame_source_) |
| 73 begin_frame_source_->DidFinishFrame(this, ack); |
| 74 } |
| 75 |
71 void CompositorFrameSinkSupport::SubmitCompositorFrame( | 76 void CompositorFrameSinkSupport::SubmitCompositorFrame( |
72 const LocalSurfaceId& local_surface_id, | 77 const LocalSurfaceId& local_surface_id, |
73 CompositorFrame frame) { | 78 CompositorFrame frame) { |
74 ++ack_pending_count_; | 79 ++ack_pending_count_; |
75 | 80 |
76 surface_factory_.SubmitCompositorFrame( | 81 surface_factory_.SubmitCompositorFrame( |
77 local_surface_id, std::move(frame), | 82 local_surface_id, std::move(frame), |
78 base::Bind(&CompositorFrameSinkSupport::DidReceiveCompositorFrameAck, | 83 base::Bind(&CompositorFrameSinkSupport::DidReceiveCompositorFrameAck, |
79 weak_factory_.GetWeakPtr())); | 84 weak_factory_.GetWeakPtr())); |
80 } | 85 } |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 else | 224 else |
220 begin_frame_source_->RemoveObserver(this); | 225 begin_frame_source_->RemoveObserver(this); |
221 } | 226 } |
222 | 227 |
223 void CompositorFrameSinkSupport::RequestCopyOfSurface( | 228 void CompositorFrameSinkSupport::RequestCopyOfSurface( |
224 std::unique_ptr<CopyOutputRequest> request) { | 229 std::unique_ptr<CopyOutputRequest> request) { |
225 surface_factory_.RequestCopyOfSurface(std::move(request)); | 230 surface_factory_.RequestCopyOfSurface(std::move(request)); |
226 } | 231 } |
227 | 232 |
228 } // namespace cc | 233 } // namespace cc |
OLD | NEW |