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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 surface_returned_resources_.clear(); | 206 surface_returned_resources_.clear(); |
207 } | 207 } |
208 | 208 |
209 void CompositorFrameSinkSupport::WillDrawSurface( | 209 void CompositorFrameSinkSupport::WillDrawSurface( |
210 const LocalSurfaceId& local_surface_id, | 210 const LocalSurfaceId& local_surface_id, |
211 const gfx::Rect& damage_rect) { | 211 const gfx::Rect& damage_rect) { |
212 if (client_) | 212 if (client_) |
213 client_->WillDrawSurface(local_surface_id, damage_rect); | 213 client_->WillDrawSurface(local_surface_id, damage_rect); |
214 } | 214 } |
215 | 215 |
216 void CompositorFrameSinkSupport::ForceReclaimResources() { | |
217 DCHECK(surface_factory_); | |
218 surface_factory_->ClearSurface(); | |
219 } | |
220 | |
221 void CompositorFrameSinkSupport::ClaimTemporaryReference( | 216 void CompositorFrameSinkSupport::ClaimTemporaryReference( |
222 const SurfaceId& surface_id) { | 217 const SurfaceId& surface_id) { |
223 surface_manager_->AssignTemporaryReference(surface_id, frame_sink_id_); | 218 surface_manager_->AssignTemporaryReference(surface_id, frame_sink_id_); |
224 } | 219 } |
225 | 220 |
226 CompositorFrameSinkSupport::CompositorFrameSinkSupport( | 221 CompositorFrameSinkSupport::CompositorFrameSinkSupport( |
227 CompositorFrameSinkSupportClient* client, | 222 CompositorFrameSinkSupportClient* client, |
228 const FrameSinkId& frame_sink_id, | 223 const FrameSinkId& frame_sink_id, |
229 bool is_root, | 224 bool is_root, |
230 bool handles_frame_sink_id_invalidation) | 225 bool handles_frame_sink_id_invalidation) |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 begin_frame_source_->RemoveObserver(this); | 269 begin_frame_source_->RemoveObserver(this); |
275 } | 270 } |
276 | 271 |
277 void CompositorFrameSinkSupport::RequestCopyOfSurface( | 272 void CompositorFrameSinkSupport::RequestCopyOfSurface( |
278 std::unique_ptr<CopyOutputRequest> request) { | 273 std::unique_ptr<CopyOutputRequest> request) { |
279 DCHECK(surface_factory_); | 274 DCHECK(surface_factory_); |
280 surface_factory_->RequestCopyOfSurface(std::move(request)); | 275 surface_factory_->RequestCopyOfSurface(std::move(request)); |
281 } | 276 } |
282 | 277 |
283 } // namespace cc | 278 } // namespace cc |
OLD | NEW |