| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 void AddSurfaceReferences(const std::vector<SurfaceReference>& references); | 149 void AddSurfaceReferences(const std::vector<SurfaceReference>& references); |
| 150 | 150 |
| 151 // Removes all surface references in |references| then runs garbage | 151 // Removes all surface references in |references| then runs garbage |
| 152 // collection to delete unreachable surfaces. | 152 // collection to delete unreachable surfaces. |
| 153 void RemoveSurfaceReferences(const std::vector<SurfaceReference>& references); | 153 void RemoveSurfaceReferences(const std::vector<SurfaceReference>& references); |
| 154 | 154 |
| 155 scoped_refptr<SurfaceReferenceFactory> reference_factory() { | 155 scoped_refptr<SurfaceReferenceFactory> reference_factory() { |
| 156 return reference_factory_; | 156 return reference_factory_; |
| 157 } | 157 } |
| 158 | 158 |
| 159 bool using_surface_references() const { |
| 160 return lifetime_type_ == LifetimeType::REFERENCES; |
| 161 } |
| 162 |
| 159 private: | 163 private: |
| 160 friend class SurfaceManagerRefTest; | 164 friend class SurfaceManagerRefTest; |
| 161 | 165 |
| 162 using SurfaceIdSet = std::unordered_set<SurfaceId, SurfaceIdHash>; | 166 using SurfaceIdSet = std::unordered_set<SurfaceId, SurfaceIdHash>; |
| 163 | 167 |
| 164 void RecursivelyAttachBeginFrameSource(const FrameSinkId& frame_sink_id, | 168 void RecursivelyAttachBeginFrameSource(const FrameSinkId& frame_sink_id, |
| 165 BeginFrameSource* source); | 169 BeginFrameSource* source); |
| 166 void RecursivelyDetachBeginFrameSource(const FrameSinkId& frame_sink_id, | 170 void RecursivelyDetachBeginFrameSource(const FrameSinkId& frame_sink_id, |
| 167 BeginFrameSource* source); | 171 BeginFrameSource* source); |
| 168 | 172 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 std::unique_ptr<SurfaceDependencyTracker> dependency_tracker_; | 277 std::unique_ptr<SurfaceDependencyTracker> dependency_tracker_; |
| 274 | 278 |
| 275 base::WeakPtrFactory<SurfaceManager> weak_factory_; | 279 base::WeakPtrFactory<SurfaceManager> weak_factory_; |
| 276 | 280 |
| 277 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); | 281 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); |
| 278 }; | 282 }; |
| 279 | 283 |
| 280 } // namespace cc | 284 } // namespace cc |
| 281 | 285 |
| 282 #endif // CC_SURFACES_SURFACE_MANAGER_H_ | 286 #endif // CC_SURFACES_SURFACE_MANAGER_H_ |
| OLD | NEW |