| 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> | |
| 10 | 9 |
| 11 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
| 12 #include "cc/scheduler/begin_frame_source.h" | 11 #include "cc/scheduler/begin_frame_source.h" |
| 13 #include "cc/surfaces/compositor_frame_sink_support_client.h" | 12 #include "cc/surfaces/compositor_frame_sink_support_client.h" |
| 14 #include "cc/surfaces/display.h" | 13 #include "cc/surfaces/display.h" |
| 15 #include "cc/surfaces/surface.h" | 14 #include "cc/surfaces/surface.h" |
| 16 #include "cc/surfaces/surface_manager.h" | 15 #include "cc/surfaces/surface_manager.h" |
| 17 #include "cc/surfaces/surface_reference.h" | 16 #include "cc/surfaces/surface_reference.h" |
| 18 | 17 |
| 19 namespace cc { | 18 namespace cc { |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 DCHECK(it->is_valid()); | 165 DCHECK(it->is_valid()); |
| 167 surface_manager_->UnregisterFrameSinkHierarchy(frame_sink_id_, | 166 surface_manager_->UnregisterFrameSinkHierarchy(frame_sink_id_, |
| 168 child_frame_sink_id); | 167 child_frame_sink_id); |
| 169 child_frame_sinks_.erase(it); | 168 child_frame_sinks_.erase(it); |
| 170 } | 169 } |
| 171 | 170 |
| 172 void CompositorFrameSinkSupport::ForceReclaimResources() { | 171 void CompositorFrameSinkSupport::ForceReclaimResources() { |
| 173 surface_factory_.ClearSurface(); | 172 surface_factory_.ClearSurface(); |
| 174 } | 173 } |
| 175 | 174 |
| 175 void CompositorFrameSinkSupport::ClaimTemporaryReference( |
| 176 const SurfaceId& surface_id) { |
| 177 surface_manager_->AssignTemporaryReference(surface_id, frame_sink_id_); |
| 178 } |
| 179 |
| 176 void CompositorFrameSinkSupport::ReferencedSurfacesChanged( | 180 void CompositorFrameSinkSupport::ReferencedSurfacesChanged( |
| 177 const LocalSurfaceId& local_surface_id, | 181 const LocalSurfaceId& local_surface_id, |
| 178 const std::vector<SurfaceId>* active_referenced_surfaces, | 182 const std::vector<SurfaceId>* active_referenced_surfaces, |
| 179 const std::vector<SurfaceId>* pending_referenced_surfaces) { | 183 const std::vector<SurfaceId>* pending_referenced_surfaces) { |
| 180 if (!surface_manager_->using_surface_references()) | 184 if (!surface_manager_->using_surface_references()) |
| 181 return; | 185 return; |
| 182 | 186 |
| 183 SurfaceId last_surface_id = reference_tracker_.current_surface_id(); | 187 SurfaceId last_surface_id = reference_tracker_.current_surface_id(); |
| 184 | 188 |
| 185 // Populate list of surface references to add and remove based on reference | 189 // Populate list of surface references to add and remove based on reference |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 else | 255 else |
| 252 begin_frame_source_->RemoveObserver(this); | 256 begin_frame_source_->RemoveObserver(this); |
| 253 } | 257 } |
| 254 | 258 |
| 255 void CompositorFrameSinkSupport::RequestCopyOfSurface( | 259 void CompositorFrameSinkSupport::RequestCopyOfSurface( |
| 256 std::unique_ptr<CopyOutputRequest> request) { | 260 std::unique_ptr<CopyOutputRequest> request) { |
| 257 surface_factory_.RequestCopyOfSurface(std::move(request)); | 261 surface_factory_.RequestCopyOfSurface(std::move(request)); |
| 258 } | 262 } |
| 259 | 263 |
| 260 } // namespace cc | 264 } // namespace cc |
| OLD | NEW |