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/surface.h" | 5 #include "cc/surfaces/surface.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 bool referenced_surfaces_changed = | 91 bool referenced_surfaces_changed = |
92 (referenced_surfaces_ != new_referenced_surfaces); | 92 (referenced_surfaces_ != new_referenced_surfaces); |
93 referenced_surfaces_ = new_referenced_surfaces; | 93 referenced_surfaces_ = new_referenced_surfaces; |
94 std::vector<uint32_t> satisfies_sequences; | 94 std::vector<uint32_t> satisfies_sequences; |
95 if (current_frame_) | 95 if (current_frame_) |
96 current_frame_->metadata.satisfies_sequences.swap(satisfies_sequences); | 96 current_frame_->metadata.satisfies_sequences.swap(satisfies_sequences); |
97 if (referenced_surfaces_changed || !satisfies_sequences.empty()) { | 97 if (referenced_surfaces_changed || !satisfies_sequences.empty()) { |
98 // Notify the manager that sequences were satisfied either if some new | 98 // Notify the manager that sequences were satisfied either if some new |
99 // sequences were satisfied, or if the set of referenced surfaces changed | 99 // sequences were satisfied, or if the set of referenced surfaces changed |
100 // to force a GC to happen. | 100 // to force a GC to happen. |
101 factory_->manager()->DidSatisfySequences( | 101 factory_->manager()->DidSatisfySequences(surface_id_.id_namespace(), |
102 SurfaceIdAllocator::NamespaceForId(surface_id_), &satisfies_sequences); | 102 &satisfies_sequences); |
103 } | 103 } |
104 } | 104 } |
105 | 105 |
106 void Surface::RequestCopyOfOutput( | 106 void Surface::RequestCopyOfOutput( |
107 std::unique_ptr<CopyOutputRequest> copy_request) { | 107 std::unique_ptr<CopyOutputRequest> copy_request) { |
108 if (current_frame_ && | 108 if (current_frame_ && |
109 !current_frame_->delegated_frame_data->render_pass_list.empty()) { | 109 !current_frame_->delegated_frame_data->render_pass_list.empty()) { |
110 std::vector<std::unique_ptr<CopyOutputRequest>>& copy_requests = | 110 std::vector<std::unique_ptr<CopyOutputRequest>>& copy_requests = |
111 current_frame_->delegated_frame_data->render_pass_list.back() | 111 current_frame_->delegated_frame_data->render_pass_list.back() |
112 ->copy_requests; | 112 ->copy_requests; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 if (current_frame_) { | 198 if (current_frame_) { |
199 for (const auto& render_pass : | 199 for (const auto& render_pass : |
200 current_frame_->delegated_frame_data->render_pass_list) { | 200 current_frame_->delegated_frame_data->render_pass_list) { |
201 for (const auto& copy_request : render_pass->copy_requests) | 201 for (const auto& copy_request : render_pass->copy_requests) |
202 copy_request->SendEmptyResult(); | 202 copy_request->SendEmptyResult(); |
203 } | 203 } |
204 } | 204 } |
205 } | 205 } |
206 | 206 |
207 } // namespace cc | 207 } // namespace cc |
OLD | NEW |