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_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 Loading... |
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<BeginFrameSource> |
| 78 SurfaceManager::CreatePrimaryBeginFrameSource() { |
| 79 return framesink_manager_.CreatePrimaryBeginFrameSource(); |
| 80 } |
| 81 |
77 std::unique_ptr<Surface> SurfaceManager::CreateSurface( | 82 std::unique_ptr<Surface> SurfaceManager::CreateSurface( |
78 base::WeakPtr<CompositorFrameSinkSupport> compositor_frame_sink_support, | 83 base::WeakPtr<CompositorFrameSinkSupport> compositor_frame_sink_support, |
79 const LocalSurfaceId& local_surface_id) { | 84 const LocalSurfaceId& local_surface_id) { |
80 DCHECK(thread_checker_.CalledOnValidThread()); | 85 DCHECK(thread_checker_.CalledOnValidThread()); |
81 DCHECK(local_surface_id.is_valid() && compositor_frame_sink_support); | 86 DCHECK(local_surface_id.is_valid() && compositor_frame_sink_support); |
82 | 87 |
83 SurfaceId surface_id(compositor_frame_sink_support->frame_sink_id(), | 88 SurfaceId surface_id(compositor_frame_sink_support->frame_sink_id(), |
84 local_surface_id); | 89 local_surface_id); |
85 | 90 |
86 // If no surface with this SurfaceId exists, simply create the surface and | 91 // If no surface with this SurfaceId exists, simply create the surface and |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 std::vector<SurfaceId> children(iter->second.begin(), iter->second.end()); | 548 std::vector<SurfaceId> children(iter->second.begin(), iter->second.end()); |
544 std::sort(children.begin(), children.end()); | 549 std::sort(children.begin(), children.end()); |
545 | 550 |
546 for (const SurfaceId& child_id : children) | 551 for (const SurfaceId& child_id : children) |
547 SurfaceReferencesToStringImpl(child_id, indent + " ", str); | 552 SurfaceReferencesToStringImpl(child_id, indent + " ", str); |
548 } | 553 } |
549 } | 554 } |
550 #endif // DCHECK_IS_ON() | 555 #endif // DCHECK_IS_ON() |
551 | 556 |
552 } // namespace cc | 557 } // namespace cc |
OLD | NEW |