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

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

Issue 2880023002: cc::SurfaceDependencyTracker should not crash when a Display goes away (Closed)
Patch Set: Fix LayerTreeHostImpl unit tests 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/surface_manager.h ('k') | cc/surfaces/surface_manager_unittest.cc » ('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 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_manager.h" 5 #include "cc/surfaces/surface_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <queue> 10 #include <queue>
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 SurfaceReferencesToStringImpl(root_surface_id_, "", &str); 58 SurfaceReferencesToStringImpl(root_surface_id_, "", &str);
59 // Temporary references will have an asterisk in front of them. 59 // Temporary references will have an asterisk in front of them.
60 for (auto& map_entry : temporary_references_) 60 for (auto& map_entry : temporary_references_)
61 SurfaceReferencesToStringImpl(map_entry.first, "* ", &str); 61 SurfaceReferencesToStringImpl(map_entry.first, "* ", &str);
62 62
63 return str.str(); 63 return str.str();
64 } 64 }
65 #endif 65 #endif
66 66
67 void SurfaceManager::SetDependencyTracker( 67 void SurfaceManager::SetDependencyTracker(
68 std::unique_ptr<SurfaceDependencyTracker> dependency_tracker) { 68 SurfaceDependencyTracker* dependency_tracker) {
69 dependency_tracker_ = std::move(dependency_tracker); 69 dependency_tracker_ = dependency_tracker;
70 } 70 }
71 71
72 void SurfaceManager::RequestSurfaceResolution(Surface* pending_surface) { 72 void SurfaceManager::RequestSurfaceResolution(Surface* pending_surface) {
73 if (dependency_tracker_) 73 if (dependency_tracker_)
74 dependency_tracker_->RequestSurfaceResolution(pending_surface); 74 dependency_tracker_->RequestSurfaceResolution(pending_surface);
75 } 75 }
76 76
77 std::unique_ptr<Surface> SurfaceManager::CreateSurface( 77 std::unique_ptr<Surface> SurfaceManager::CreateSurface(
78 base::WeakPtr<CompositorFrameSinkSupport> compositor_frame_sink_support, 78 base::WeakPtr<CompositorFrameSinkSupport> compositor_frame_sink_support,
79 const SurfaceInfo& surface_info) { 79 const SurfaceInfo& surface_info) {
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 void SurfaceManager::RegisterBeginFrameSource( 424 void SurfaceManager::RegisterBeginFrameSource(
425 BeginFrameSource* source, 425 BeginFrameSource* source,
426 const FrameSinkId& frame_sink_id) { 426 const FrameSinkId& frame_sink_id) {
427 framesink_manager_.RegisterBeginFrameSource(source, frame_sink_id); 427 framesink_manager_.RegisterBeginFrameSource(source, frame_sink_id);
428 } 428 }
429 429
430 void SurfaceManager::UnregisterBeginFrameSource(BeginFrameSource* source) { 430 void SurfaceManager::UnregisterBeginFrameSource(BeginFrameSource* source) {
431 framesink_manager_.UnregisterBeginFrameSource(source); 431 framesink_manager_.UnregisterBeginFrameSource(source);
432 } 432 }
433 433
434 BeginFrameSource* SurfaceManager::GetPrimaryBeginFrameSource() {
435 return framesink_manager_.GetPrimaryBeginFrameSource();
436 }
437
434 void SurfaceManager::RegisterFrameSinkHierarchy( 438 void SurfaceManager::RegisterFrameSinkHierarchy(
435 const FrameSinkId& parent_frame_sink_id, 439 const FrameSinkId& parent_frame_sink_id,
436 const FrameSinkId& child_frame_sink_id) { 440 const FrameSinkId& child_frame_sink_id) {
437 framesink_manager_.RegisterFrameSinkHierarchy(parent_frame_sink_id, 441 framesink_manager_.RegisterFrameSinkHierarchy(parent_frame_sink_id,
438 child_frame_sink_id); 442 child_frame_sink_id);
439 } 443 }
440 444
441 void SurfaceManager::UnregisterFrameSinkHierarchy( 445 void SurfaceManager::UnregisterFrameSinkHierarchy(
442 const FrameSinkId& parent_frame_sink_id, 446 const FrameSinkId& parent_frame_sink_id,
443 const FrameSinkId& child_frame_sink_id) { 447 const FrameSinkId& child_frame_sink_id) {
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 std::vector<SurfaceId> children(iter->second.begin(), iter->second.end()); 549 std::vector<SurfaceId> children(iter->second.begin(), iter->second.end());
546 std::sort(children.begin(), children.end()); 550 std::sort(children.begin(), children.end());
547 551
548 for (const SurfaceId& child_id : children) 552 for (const SurfaceId& child_id : children)
549 SurfaceReferencesToStringImpl(child_id, indent + " ", str); 553 SurfaceReferencesToStringImpl(child_id, indent + " ", str);
550 } 554 }
551 } 555 }
552 #endif // DCHECK_IS_ON() 556 #endif // DCHECK_IS_ON()
553 557
554 } // namespace cc 558 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/surface_manager.h ('k') | cc/surfaces/surface_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698