| 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/surface_dependency_tracker.h" | 5 #include "cc/surfaces/surface_dependency_tracker.h" |
| 6 | 6 |
| 7 #include "cc/surfaces/surface.h" | 7 #include "cc/surfaces/surface.h" |
| 8 #include "cc/surfaces/surface_info.h" | 8 #include "cc/surfaces/surface_info.h" |
| 9 #include "cc/surfaces/surface_manager.h" | 9 #include "cc/surfaces/surface_manager.h" |
| 10 | 10 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 blocked_surfaces_.erase(surface_id); | 108 blocked_surfaces_.erase(surface_id); |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 | 111 |
| 112 if (blocked_surfaces_.empty()) | 112 if (blocked_surfaces_.empty()) |
| 113 frames_since_deadline_set_.reset(); | 113 frames_since_deadline_set_.reset(); |
| 114 | 114 |
| 115 pending_surfaces_.erase(surface); | 115 pending_surfaces_.erase(surface); |
| 116 surface->RemoveObserver(this); | 116 surface->RemoveObserver(this); |
| 117 | 117 |
| 118 // TODO(fsamuel): We should consider removing this surface as a dependency on | 118 // Pretend that the discarded surface's SurfaceId is now available to unblock |
| 119 // other surfaces. This dependency will be removed when the deadline hits | 119 // dependencies because we now know the surface will never activate. |
| 120 // anyway but maybe we should try to actiate these frames early (see | 120 NotifySurfaceIdAvailable(surface->surface_id()); |
| 121 // https://crbug.com/689725). | |
| 122 } | 121 } |
| 123 | 122 |
| 124 void SurfaceDependencyTracker::OnSurfaceActivated(Surface* surface) { | 123 void SurfaceDependencyTracker::OnSurfaceActivated(Surface* surface) { |
| 125 surface->RemoveObserver(this); | 124 surface->RemoveObserver(this); |
| 126 pending_surfaces_.erase(surface); | 125 pending_surfaces_.erase(surface); |
| 127 NotifySurfaceIdAvailable(surface->surface_id()); | 126 NotifySurfaceIdAvailable(surface->surface_id()); |
| 128 } | 127 } |
| 129 | 128 |
| 130 void SurfaceDependencyTracker::OnSurfaceDependenciesChanged( | 129 void SurfaceDependencyTracker::OnSurfaceDependenciesChanged( |
| 131 Surface* surface, | 130 Surface* surface, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 // have a deadline. | 173 // have a deadline. |
| 175 if (blocked_surfaces_.empty()) | 174 if (blocked_surfaces_.empty()) |
| 176 frames_since_deadline_set_.reset(); | 175 frames_since_deadline_set_.reset(); |
| 177 | 176 |
| 178 // Tell each surface about the availability of its blocker. | 177 // Tell each surface about the availability of its blocker. |
| 179 for (Surface* blocked_pending_surface : blocked_pending_surface_set) | 178 for (Surface* blocked_pending_surface : blocked_pending_surface_set) |
| 180 blocked_pending_surface->NotifySurfaceIdAvailable(surface_id); | 179 blocked_pending_surface->NotifySurfaceIdAvailable(surface_id); |
| 181 } | 180 } |
| 182 | 181 |
| 183 } // namespace cc | 182 } // namespace cc |
| OLD | NEW |