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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 // Remove existing CopyOutputRequests made on the Surface by the same | 114 // Remove existing CopyOutputRequests made on the Surface by the same |
115 // source. | 115 // source. |
116 base::EraseIf(copy_requests, | 116 base::EraseIf(copy_requests, |
117 [&source](const std::unique_ptr<CopyOutputRequest>& x) { | 117 [&source](const std::unique_ptr<CopyOutputRequest>& x) { |
118 return x->has_source() && x->source() == source; | 118 return x->has_source() && x->source() == source; |
119 }); | 119 }); |
120 } | 120 } |
121 copy_requests.push_back(std::move(copy_request)); | 121 copy_requests.push_back(std::move(copy_request)); |
122 } | 122 } |
123 | 123 |
124 void Surface::Reset() { | |
125 active_frame_.reset(); | |
126 pending_frame_.reset(); | |
127 blocking_surfaces_.clear(); | |
128 RunDrawCallbacks(); | |
129 } | |
130 | |
131 void Surface::NotifySurfaceIdAvailable(const SurfaceId& surface_id) { | 124 void Surface::NotifySurfaceIdAvailable(const SurfaceId& surface_id) { |
132 auto it = blocking_surfaces_.find(surface_id); | 125 auto it = blocking_surfaces_.find(surface_id); |
133 // This surface may no longer have blockers if the deadline has passed. | 126 // This surface may no longer have blockers if the deadline has passed. |
134 if (it == blocking_surfaces_.end()) | 127 if (it == blocking_surfaces_.end()) |
135 return; | 128 return; |
136 | 129 |
137 blocking_surfaces_.erase(it); | 130 blocking_surfaces_.erase(it); |
138 | 131 |
139 if (!blocking_surfaces_.empty()) | 132 if (!blocking_surfaces_.empty()) |
140 return; | 133 return; |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 frame->metadata.latency_info.swap(*latency_info); | 339 frame->metadata.latency_info.swap(*latency_info); |
347 return; | 340 return; |
348 } | 341 } |
349 std::copy(frame->metadata.latency_info.begin(), | 342 std::copy(frame->metadata.latency_info.begin(), |
350 frame->metadata.latency_info.end(), | 343 frame->metadata.latency_info.end(), |
351 std::back_inserter(*latency_info)); | 344 std::back_inserter(*latency_info)); |
352 frame->metadata.latency_info.clear(); | 345 frame->metadata.latency_info.clear(); |
353 } | 346 } |
354 | 347 |
355 } // namespace cc | 348 } // namespace cc |
OLD | NEW |