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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 void CompositorFrameSinkSupport::RemoveChildFrameSink( | 162 void CompositorFrameSinkSupport::RemoveChildFrameSink( |
163 const FrameSinkId& child_frame_sink_id) { | 163 const FrameSinkId& child_frame_sink_id) { |
164 auto it = child_frame_sinks_.find(child_frame_sink_id); | 164 auto it = child_frame_sinks_.find(child_frame_sink_id); |
165 DCHECK(it != child_frame_sinks_.end()); | 165 DCHECK(it != child_frame_sinks_.end()); |
166 DCHECK(it->is_valid()); | 166 DCHECK(it->is_valid()); |
167 surface_manager_->UnregisterFrameSinkHierarchy(frame_sink_id_, | 167 surface_manager_->UnregisterFrameSinkHierarchy(frame_sink_id_, |
168 child_frame_sink_id); | 168 child_frame_sink_id); |
169 child_frame_sinks_.erase(it); | 169 child_frame_sinks_.erase(it); |
170 } | 170 } |
171 | 171 |
172 void CompositorFrameSinkSupport::ForceReclaimResources() { | |
173 surface_factory_.ClearSurface(); | |
174 } | |
175 | |
176 void CompositorFrameSinkSupport::ReferencedSurfacesChanged( | 172 void CompositorFrameSinkSupport::ReferencedSurfacesChanged( |
177 const LocalSurfaceId& local_surface_id, | 173 const LocalSurfaceId& local_surface_id, |
178 const std::vector<SurfaceId>* active_referenced_surfaces, | 174 const std::vector<SurfaceId>* active_referenced_surfaces, |
179 const std::vector<SurfaceId>* pending_referenced_surfaces) { | 175 const std::vector<SurfaceId>* pending_referenced_surfaces) { |
180 if (!surface_manager_->using_surface_references()) | 176 if (!surface_manager_->using_surface_references()) |
181 return; | 177 return; |
182 | 178 |
183 // Populate list of surface references to add and remove based on reference | 179 // Populate list of surface references to add and remove based on reference |
184 // surfaces in current frame compared with the last frame. The list of | 180 // surfaces in current frame compared with the last frame. The list of |
185 // surface references includes references from both the pending and active | 181 // surface references includes references from both the pending and active |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 else | 246 else |
251 begin_frame_source_->RemoveObserver(this); | 247 begin_frame_source_->RemoveObserver(this); |
252 } | 248 } |
253 | 249 |
254 void CompositorFrameSinkSupport::RequestCopyOfSurface( | 250 void CompositorFrameSinkSupport::RequestCopyOfSurface( |
255 std::unique_ptr<CopyOutputRequest> request) { | 251 std::unique_ptr<CopyOutputRequest> request) { |
256 surface_factory_.RequestCopyOfSurface(std::move(request)); | 252 surface_factory_.RequestCopyOfSurface(std::move(request)); |
257 } | 253 } |
258 | 254 |
259 } // namespace cc | 255 } // namespace cc |
OLD | NEW |