| 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 |
| 124 void Surface::NotifySurfaceIdAvailable(const SurfaceId& surface_id) { | 131 void Surface::NotifySurfaceIdAvailable(const SurfaceId& surface_id) { |
| 125 auto it = blocking_surfaces_.find(surface_id); | 132 auto it = blocking_surfaces_.find(surface_id); |
| 126 // This surface may no longer have blockers if the deadline has passed. | 133 // This surface may no longer have blockers if the deadline has passed. |
| 127 if (it == blocking_surfaces_.end()) | 134 if (it == blocking_surfaces_.end()) |
| 128 return; | 135 return; |
| 129 | 136 |
| 130 blocking_surfaces_.erase(it); | 137 blocking_surfaces_.erase(it); |
| 131 | 138 |
| 132 if (!blocking_surfaces_.empty()) | 139 if (!blocking_surfaces_.empty()) |
| 133 return; | 140 return; |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 frame->metadata.latency_info.swap(*latency_info); | 346 frame->metadata.latency_info.swap(*latency_info); |
| 340 return; | 347 return; |
| 341 } | 348 } |
| 342 std::copy(frame->metadata.latency_info.begin(), | 349 std::copy(frame->metadata.latency_info.begin(), |
| 343 frame->metadata.latency_info.end(), | 350 frame->metadata.latency_info.end(), |
| 344 std::back_inserter(*latency_info)); | 351 std::back_inserter(*latency_info)); |
| 345 frame->metadata.latency_info.clear(); | 352 frame->metadata.latency_info.clear(); |
| 346 } | 353 } |
| 347 | 354 |
| 348 } // namespace cc | 355 } // namespace cc |
| OLD | NEW |