| 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 #ifndef CC_SURFACES_SURFACE_MANAGER_H_ | 5 #ifndef CC_SURFACES_SURFACE_MANAGER_H_ |
| 6 #define CC_SURFACES_SURFACE_MANAGER_H_ | 6 #define CC_SURFACES_SURFACE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 explicit SurfaceManager(LifetimeType lifetime_type = LifetimeType::SEQUENCES); | 54 explicit SurfaceManager(LifetimeType lifetime_type = LifetimeType::SEQUENCES); |
| 55 ~SurfaceManager(); | 55 ~SurfaceManager(); |
| 56 | 56 |
| 57 #if DCHECK_IS_ON() | 57 #if DCHECK_IS_ON() |
| 58 // Returns a string representation of all reachable surface references. | 58 // Returns a string representation of all reachable surface references. |
| 59 std::string SurfaceReferencesToString(); | 59 std::string SurfaceReferencesToString(); |
| 60 #endif | 60 #endif |
| 61 | 61 |
| 62 void SetDependencyTracker( | 62 void SetDependencyTracker(SurfaceDependencyTracker* dependency_tracker); |
| 63 std::unique_ptr<SurfaceDependencyTracker> dependency_tracker); | 63 SurfaceDependencyTracker* dependency_tracker() { return dependency_tracker_; } |
| 64 SurfaceDependencyTracker* dependency_tracker() { | |
| 65 return dependency_tracker_.get(); | |
| 66 } | |
| 67 | 64 |
| 68 void RequestSurfaceResolution(Surface* pending_surface); | 65 void RequestSurfaceResolution(Surface* pending_surface); |
| 69 | 66 |
| 70 std::unique_ptr<Surface> CreateSurface( | 67 std::unique_ptr<Surface> CreateSurface( |
| 71 base::WeakPtr<CompositorFrameSinkSupport> compositor_frame_sink_support, | 68 base::WeakPtr<CompositorFrameSinkSupport> compositor_frame_sink_support, |
| 72 const SurfaceInfo& surface_info); | 69 const SurfaceInfo& surface_info); |
| 73 | 70 |
| 74 // Destroy the Surface once a set of sequence numbers has been satisfied. | 71 // Destroy the Surface once a set of sequence numbers has been satisfied. |
| 75 void DestroySurface(std::unique_ptr<Surface> surface); | 72 void DestroySurface(std::unique_ptr<Surface> surface); |
| 76 | 73 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 FrameSinkManagerClient* client); | 131 FrameSinkManagerClient* client); |
| 135 void UnregisterFrameSinkManagerClient(const FrameSinkId& frame_sink_id); | 132 void UnregisterFrameSinkManagerClient(const FrameSinkId& frame_sink_id); |
| 136 | 133 |
| 137 // Associates a |source| with a particular namespace. That namespace and | 134 // Associates a |source| with a particular namespace. That namespace and |
| 138 // any children of that namespace with valid clients can potentially use | 135 // any children of that namespace with valid clients can potentially use |
| 139 // that |source|. | 136 // that |source|. |
| 140 void RegisterBeginFrameSource(BeginFrameSource* source, | 137 void RegisterBeginFrameSource(BeginFrameSource* source, |
| 141 const FrameSinkId& frame_sink_id); | 138 const FrameSinkId& frame_sink_id); |
| 142 void UnregisterBeginFrameSource(BeginFrameSource* source); | 139 void UnregisterBeginFrameSource(BeginFrameSource* source); |
| 143 | 140 |
| 141 // Returns a stable BeginFrameSource that forwards BeginFrames from the first |
| 142 // available BeginFrameSource. |
| 143 BeginFrameSource* GetPrimaryBeginFrameSource(); |
| 144 |
| 144 // Register a relationship between two namespaces. This relationship means | 145 // Register a relationship between two namespaces. This relationship means |
| 145 // that surfaces from the child namespace will be displayed in the parent. | 146 // that surfaces from the child namespace will be displayed in the parent. |
| 146 // Children are allowed to use any begin frame source that their parent can | 147 // Children are allowed to use any begin frame source that their parent can |
| 147 // use. | 148 // use. |
| 148 void RegisterFrameSinkHierarchy(const FrameSinkId& parent_frame_sink_id, | 149 void RegisterFrameSinkHierarchy(const FrameSinkId& parent_frame_sink_id, |
| 149 const FrameSinkId& child_frame_sink_id); | 150 const FrameSinkId& child_frame_sink_id); |
| 150 void UnregisterFrameSinkHierarchy(const FrameSinkId& parent_frame_sink_id, | 151 void UnregisterFrameSinkHierarchy(const FrameSinkId& parent_frame_sink_id, |
| 151 const FrameSinkId& child_frame_sink_id); | 152 const FrameSinkId& child_frame_sink_id); |
| 152 | 153 |
| 153 // Returns the top level root SurfaceId. Surfaces that are not reachable | 154 // Returns the top level root SurfaceId. Surfaces that are not reachable |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 // same FrameSinkId. A SurfaceId can be reconstructed with: | 282 // same FrameSinkId. A SurfaceId can be reconstructed with: |
| 282 // SurfaceId surface_id(key, value[index]); | 283 // SurfaceId surface_id(key, value[index]); |
| 283 // The LocalSurfaceIds are stored in the order the surfaces are created in. If | 284 // The LocalSurfaceIds are stored in the order the surfaces are created in. If |
| 284 // a reference is added to a later SurfaceId then all temporary references up | 285 // a reference is added to a later SurfaceId then all temporary references up |
| 285 // to that point will be removed. This is to handle clients getting out of | 286 // to that point will be removed. This is to handle clients getting out of |
| 286 // sync, for example the embedded client producing new SurfaceIds faster than | 287 // sync, for example the embedded client producing new SurfaceIds faster than |
| 287 // the embedding client can use them. | 288 // the embedding client can use them. |
| 288 std::unordered_map<FrameSinkId, std::vector<LocalSurfaceId>, FrameSinkIdHash> | 289 std::unordered_map<FrameSinkId, std::vector<LocalSurfaceId>, FrameSinkIdHash> |
| 289 temporary_reference_ranges_; | 290 temporary_reference_ranges_; |
| 290 | 291 |
| 291 std::unique_ptr<SurfaceDependencyTracker> dependency_tracker_; | 292 SurfaceDependencyTracker* dependency_tracker_ = nullptr; |
| 292 | 293 |
| 293 base::WeakPtrFactory<SurfaceManager> weak_factory_; | 294 base::WeakPtrFactory<SurfaceManager> weak_factory_; |
| 294 | 295 |
| 295 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); | 296 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); |
| 296 }; | 297 }; |
| 297 | 298 |
| 298 } // namespace cc | 299 } // namespace cc |
| 299 | 300 |
| 300 #endif // CC_SURFACES_SURFACE_MANAGER_H_ | 301 #endif // CC_SURFACES_SURFACE_MANAGER_H_ |
| OLD | NEW |