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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // Referenced surface IDs that aren't currently known to the surface manager | 42 // Referenced surface IDs that aren't currently known to the surface manager |
43 // or do not have an active CompsotiorFrame block this frame. | 43 // or do not have an active CompsotiorFrame block this frame. |
44 for (const SurfaceId& surface_id : | 44 for (const SurfaceId& surface_id : |
45 pending_frame.metadata.activation_dependencies) { | 45 pending_frame.metadata.activation_dependencies) { |
46 Surface* surface_dependency = surface_manager_->GetSurfaceForId(surface_id); | 46 Surface* surface_dependency = surface_manager_->GetSurfaceForId(surface_id); |
47 if (!surface_dependency || !surface_dependency->HasActiveFrame()) | 47 if (!surface_dependency || !surface_dependency->HasActiveFrame()) |
48 blocked_surfaces_from_dependency_[surface_id].insert( | 48 blocked_surfaces_from_dependency_[surface_id].insert( |
49 surface->surface_id()); | 49 surface->surface_id()); |
50 } | 50 } |
51 | 51 |
52 if (!blocked_surfaces_by_id_.count(surface->surface_id())) | 52 blocked_surfaces_by_id_.insert(surface->surface_id()); |
53 blocked_surfaces_by_id_.insert(surface->surface_id()); | |
54 | 53 |
55 if (needs_deadline && !frames_since_deadline_set_) | 54 if (needs_deadline && !frames_since_deadline_set_) |
56 frames_since_deadline_set_ = 0; | 55 frames_since_deadline_set_ = 0; |
57 } | 56 } |
58 | 57 |
59 void SurfaceDependencyTracker::OnSurfaceActivated(Surface* surface) { | 58 void SurfaceDependencyTracker::OnSurfaceActivated(Surface* surface) { |
60 blocked_surfaces_by_id_.erase(surface->surface_id()); | 59 blocked_surfaces_by_id_.erase(surface->surface_id()); |
61 NotifySurfaceIdAvailable(surface->surface_id()); | 60 NotifySurfaceIdAvailable(surface->surface_id()); |
62 } | 61 } |
63 | 62 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 // A blocked surface may have been garbage collected during dependency | 190 // A blocked surface may have been garbage collected during dependency |
192 // resolution. | 191 // resolution. |
193 DCHECK(!blocked_surfaces_by_id_.count(blocked_surface_by_id)); | 192 DCHECK(!blocked_surfaces_by_id_.count(blocked_surface_by_id)); |
194 continue; | 193 continue; |
195 } | 194 } |
196 blocked_surface->NotifySurfaceIdAvailable(surface_id); | 195 blocked_surface->NotifySurfaceIdAvailable(surface_id); |
197 } | 196 } |
198 } | 197 } |
199 | 198 |
200 } // namespace cc | 199 } // namespace cc |
OLD | NEW |