| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 reference_tracker_.UpdateReferences(local_surface_id, | 67 reference_tracker_.UpdateReferences(local_surface_id, |
| 68 active_referenced_surfaces); | 68 active_referenced_surfaces); |
| 69 | 69 |
| 70 UpdateSurfaceReferences(last_surface_id, local_surface_id); | 70 UpdateSurfaceReferences(last_surface_id, local_surface_id); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void CompositorFrameSinkSupport::ReturnResources( | 73 void CompositorFrameSinkSupport::ReturnResources( |
| 74 const ReturnedResourceArray& resources) { | 74 const ReturnedResourceArray& resources) { |
| 75 if (resources.empty()) | 75 if (resources.empty()) |
| 76 return; | 76 return; |
| 77 | |
| 78 if (!ack_pending_count_ && client_) { | 77 if (!ack_pending_count_ && client_) { |
| 79 client_->ReclaimResources(resources); | 78 client_->ReclaimResources(resources); |
| 80 return; | 79 return; |
| 81 } | 80 } |
| 82 | 81 |
| 83 std::copy(resources.begin(), resources.end(), | 82 std::copy(resources.begin(), resources.end(), |
| 84 std::back_inserter(surface_returned_resources_)); | 83 std::back_inserter(surface_returned_resources_)); |
| 85 } | 84 } |
| 86 | 85 |
| 87 void CompositorFrameSinkSupport::SetBeginFrameSource( | 86 void CompositorFrameSinkSupport::SetBeginFrameSource( |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 begin_frame_source_->RemoveObserver(this); | 272 begin_frame_source_->RemoveObserver(this); |
| 274 } | 273 } |
| 275 | 274 |
| 276 void CompositorFrameSinkSupport::RequestCopyOfSurface( | 275 void CompositorFrameSinkSupport::RequestCopyOfSurface( |
| 277 std::unique_ptr<CopyOutputRequest> request) { | 276 std::unique_ptr<CopyOutputRequest> request) { |
| 278 DCHECK(surface_factory_); | 277 DCHECK(surface_factory_); |
| 279 surface_factory_->RequestCopyOfSurface(std::move(request)); | 278 surface_factory_->RequestCopyOfSurface(std::move(request)); |
| 280 } | 279 } |
| 281 | 280 |
| 282 } // namespace cc | 281 } // namespace cc |
| OLD | NEW |