Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Side by Side Diff: cc/surfaces/surface_dependency_tracker.cc

Issue 2908473002: Revert of cc::SurfaceDependencyTracker should not crash when a Display goes away (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/surfaces/primary_begin_frame_source.cc ('k') | cc/surfaces/surface_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 blocked_surfaces_by_id_.insert(surface->surface_id()); 52 if (!blocked_surfaces_by_id_.count(surface->surface_id()))
53 blocked_surfaces_by_id_.insert(surface->surface_id());
53 54
54 if (needs_deadline && !frames_since_deadline_set_) 55 if (needs_deadline && !frames_since_deadline_set_)
55 frames_since_deadline_set_ = 0; 56 frames_since_deadline_set_ = 0;
56 } 57 }
57 58
58 void SurfaceDependencyTracker::OnSurfaceActivated(Surface* surface) { 59 void SurfaceDependencyTracker::OnSurfaceActivated(Surface* surface) {
59 blocked_surfaces_by_id_.erase(surface->surface_id()); 60 blocked_surfaces_by_id_.erase(surface->surface_id());
60 NotifySurfaceIdAvailable(surface->surface_id()); 61 NotifySurfaceIdAvailable(surface->surface_id());
61 } 62 }
62 63
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 // A blocked surface may have been garbage collected during dependency 191 // A blocked surface may have been garbage collected during dependency
191 // resolution. 192 // resolution.
192 DCHECK(!blocked_surfaces_by_id_.count(blocked_surface_by_id)); 193 DCHECK(!blocked_surfaces_by_id_.count(blocked_surface_by_id));
193 continue; 194 continue;
194 } 195 }
195 blocked_surface->NotifySurfaceIdAvailable(surface_id); 196 blocked_surface->NotifySurfaceIdAvailable(surface_id);
196 } 197 }
197 } 198 }
198 199
199 } // namespace cc 200 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/primary_begin_frame_source.cc ('k') | cc/surfaces/surface_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698