| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 void AddSurfaceReferences(const std::vector<SurfaceReference>& references); | 140 void AddSurfaceReferences(const std::vector<SurfaceReference>& references); |
| 141 | 141 |
| 142 // Removes all surface references in |references| then runs garbage | 142 // Removes all surface references in |references| then runs garbage |
| 143 // collection to delete unreachable surfaces. | 143 // collection to delete unreachable surfaces. |
| 144 void RemoveSurfaceReferences(const std::vector<SurfaceReference>& references); | 144 void RemoveSurfaceReferences(const std::vector<SurfaceReference>& references); |
| 145 | 145 |
| 146 scoped_refptr<SurfaceReferenceFactory> reference_factory() { | 146 scoped_refptr<SurfaceReferenceFactory> reference_factory() { |
| 147 return reference_factory_; | 147 return reference_factory_; |
| 148 } | 148 } |
| 149 | 149 |
| 150 bool using_surface_references() const { | |
| 151 return lifetime_type_ == LifetimeType::REFERENCES; | |
| 152 } | |
| 153 | |
| 154 private: | 150 private: |
| 155 friend class SurfaceManagerRefTest; | 151 friend class SurfaceManagerRefTest; |
| 156 | 152 |
| 157 using SurfaceIdSet = std::unordered_set<SurfaceId, SurfaceIdHash>; | 153 using SurfaceIdSet = std::unordered_set<SurfaceId, SurfaceIdHash>; |
| 158 | 154 |
| 159 void RecursivelyAttachBeginFrameSource(const FrameSinkId& frame_sink_id, | 155 void RecursivelyAttachBeginFrameSource(const FrameSinkId& frame_sink_id, |
| 160 BeginFrameSource* source); | 156 BeginFrameSource* source); |
| 161 void RecursivelyDetachBeginFrameSource(const FrameSinkId& frame_sink_id, | 157 void RecursivelyDetachBeginFrameSource(const FrameSinkId& frame_sink_id, |
| 162 BeginFrameSource* source); | 158 BeginFrameSource* source); |
| 163 | 159 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 temp_references_; | 262 temp_references_; |
| 267 | 263 |
| 268 base::WeakPtrFactory<SurfaceManager> weak_factory_; | 264 base::WeakPtrFactory<SurfaceManager> weak_factory_; |
| 269 | 265 |
| 270 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); | 266 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); |
| 271 }; | 267 }; |
| 272 | 268 |
| 273 } // namespace cc | 269 } // namespace cc |
| 274 | 270 |
| 275 #endif // CC_SURFACES_SURFACE_MANAGER_H_ | 271 #endif // CC_SURFACES_SURFACE_MANAGER_H_ |
| OLD | NEW |