OLD | NEW |
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 Loading... |
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::DidNotProduceFrame(const BeginFrameAck& ack) { |
| 114 DCHECK(!ack.has_damage); |
| 115 DCHECK_LE(BeginFrameArgs::kStartingFrameNumber, ack.sequence_number); |
| 116 support_->DidNotProduceFrame(ack); |
| 117 } |
| 118 |
113 void DirectCompositorFrameSink::DisplayOutputSurfaceLost() { | 119 void DirectCompositorFrameSink::DisplayOutputSurfaceLost() { |
114 is_lost_ = true; | 120 is_lost_ = true; |
115 client_->DidLoseCompositorFrameSink(); | 121 client_->DidLoseCompositorFrameSink(); |
116 } | 122 } |
117 | 123 |
118 void DirectCompositorFrameSink::DisplayWillDrawAndSwap( | 124 void DirectCompositorFrameSink::DisplayWillDrawAndSwap( |
119 bool will_draw_and_swap, | 125 bool will_draw_and_swap, |
120 const RenderPassList& render_passes) { | 126 const RenderPassList& render_passes) { |
121 // This notification is not relevant to our client outside of tests. | 127 // This notification is not relevant to our client outside of tests. |
122 } | 128 } |
(...skipping 22 matching lines...) Expand all Loading... |
145 void DirectCompositorFrameSink::WillDrawSurface( | 151 void DirectCompositorFrameSink::WillDrawSurface( |
146 const LocalSurfaceId& local_surface_id, | 152 const LocalSurfaceId& local_surface_id, |
147 const gfx::Rect& damage_rect) { | 153 const gfx::Rect& damage_rect) { |
148 // TODO(staraz): Implement this. | 154 // TODO(staraz): Implement this. |
149 } | 155 } |
150 | 156 |
151 void DirectCompositorFrameSink::OnNeedsBeginFrames(bool needs_begin_frame) { | 157 void DirectCompositorFrameSink::OnNeedsBeginFrames(bool needs_begin_frame) { |
152 support_->SetNeedsBeginFrame(needs_begin_frame); | 158 support_->SetNeedsBeginFrame(needs_begin_frame); |
153 } | 159 } |
154 | 160 |
155 void DirectCompositorFrameSink::OnDidFinishFrame(const BeginFrameAck& ack) { | |
156 // If there was damage, SubmitCompositorFrame includes the ack. | |
157 if (!ack.has_damage) | |
158 support_->BeginFrameDidNotSwap(ack); | |
159 } | |
160 | |
161 } // namespace cc | 161 } // namespace cc |
OLD | NEW |