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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 const CompositorFrame& current_frame) { | 209 const CompositorFrame& current_frame) { |
210 // If there is no SurfaceDependencyTracker installed then the |current_frame| | 210 // If there is no SurfaceDependencyTracker installed then the |current_frame| |
211 // does not block on anything. | 211 // does not block on anything. |
212 if (!factory_->manager()->dependency_tracker()) { | 212 if (!factory_->manager()->dependency_tracker()) { |
213 blocking_surfaces_.clear(); | 213 blocking_surfaces_.clear(); |
214 return; | 214 return; |
215 } | 215 } |
216 | 216 |
217 base::flat_set<SurfaceId> new_blocking_surfaces; | 217 base::flat_set<SurfaceId> new_blocking_surfaces; |
218 | 218 |
219 for (const SurfaceId& surface_id : | 219 for (const SurfaceId& surface_id : current_frame.metadata.embedded_surfaces) { |
220 current_frame.metadata.referenced_surfaces) { | |
221 Surface* surface = factory_->manager()->GetSurfaceForId(surface_id); | 220 Surface* surface = factory_->manager()->GetSurfaceForId(surface_id); |
222 // If a referenced surface does not have a corresponding active frame in the | 221 // If a referenced surface does not have a corresponding active frame in the |
223 // display compositor, then it blocks this frame. | 222 // display compositor, then it blocks this frame. |
224 if (!surface || !surface->HasActiveFrame()) | 223 if (!surface || !surface->HasActiveFrame()) |
225 new_blocking_surfaces.insert(surface_id); | 224 new_blocking_surfaces.insert(surface_id); |
226 } | 225 } |
227 | 226 |
228 // If this Surface has a previous pending frame, then we must determine the | 227 // If this Surface has a previous pending frame, then we must determine the |
229 // changes in dependencies so that we can update the SurfaceDependencyTracker | 228 // changes in dependencies so that we can update the SurfaceDependencyTracker |
230 // map. | 229 // map. |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 frame->metadata.latency_info.swap(*latency_info); | 338 frame->metadata.latency_info.swap(*latency_info); |
340 return; | 339 return; |
341 } | 340 } |
342 std::copy(frame->metadata.latency_info.begin(), | 341 std::copy(frame->metadata.latency_info.begin(), |
343 frame->metadata.latency_info.end(), | 342 frame->metadata.latency_info.end(), |
344 std::back_inserter(*latency_info)); | 343 std::back_inserter(*latency_info)); |
345 frame->metadata.latency_info.clear(); | 344 frame->metadata.latency_info.clear(); |
346 } | 345 } |
347 | 346 |
348 } // namespace cc | 347 } // namespace cc |
OLD | NEW |