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 22 matching lines...) Expand all Loading... |
33 #include <string> | 33 #include <string> |
34 #endif | 34 #endif |
35 | 35 |
36 namespace cc { | 36 namespace cc { |
37 class BeginFrameSource; | 37 class BeginFrameSource; |
38 class CompositorFrame; | 38 class CompositorFrame; |
39 class FrameSinkManagerClient; | 39 class FrameSinkManagerClient; |
40 class Surface; | 40 class Surface; |
41 class SurfaceFactory; | 41 class SurfaceFactory; |
42 class SurfaceFactoryClient; | 42 class SurfaceFactoryClient; |
43 | |
44 namespace test { | |
45 class CompositorFrameSinkSupportTest; | 43 class CompositorFrameSinkSupportTest; |
46 } | |
47 | 44 |
48 class CC_SURFACES_EXPORT SurfaceManager { | 45 class CC_SURFACES_EXPORT SurfaceManager { |
49 public: | 46 public: |
50 enum class LifetimeType { | 47 enum class LifetimeType { |
51 REFERENCES, | 48 REFERENCES, |
52 SEQUENCES, | 49 SEQUENCES, |
53 }; | 50 }; |
54 | 51 |
55 explicit SurfaceManager(LifetimeType lifetime_type = LifetimeType::SEQUENCES); | 52 explicit SurfaceManager(LifetimeType lifetime_type = LifetimeType::SEQUENCES); |
56 ~SurfaceManager(); | 53 ~SurfaceManager(); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 162 |
166 scoped_refptr<SurfaceReferenceFactory> reference_factory() { | 163 scoped_refptr<SurfaceReferenceFactory> reference_factory() { |
167 return reference_factory_; | 164 return reference_factory_; |
168 } | 165 } |
169 | 166 |
170 bool using_surface_references() const { | 167 bool using_surface_references() const { |
171 return lifetime_type_ == LifetimeType::REFERENCES; | 168 return lifetime_type_ == LifetimeType::REFERENCES; |
172 } | 169 } |
173 | 170 |
174 private: | 171 private: |
175 friend class test::CompositorFrameSinkSupportTest; | 172 friend class CompositorFrameSinkSupportTest; |
176 friend class SurfaceManagerRefTest; | 173 friend class SurfaceManagerRefTest; |
177 | 174 |
178 using SurfaceIdSet = std::unordered_set<SurfaceId, SurfaceIdHash>; | 175 using SurfaceIdSet = std::unordered_set<SurfaceId, SurfaceIdHash>; |
179 | 176 |
180 // Garbage collects all destroyed surfaces that aren't live. | 177 // Garbage collects all destroyed surfaces that aren't live. |
181 void GarbageCollectSurfaces(); | 178 void GarbageCollectSurfaces(); |
182 | 179 |
183 // Returns set of live surfaces for |lifetime_manager_| is REFERENCES. | 180 // Returns set of live surfaces for |lifetime_manager_| is REFERENCES. |
184 SurfaceIdSet GetLiveSurfacesForReferences(); | 181 SurfaceIdSet GetLiveSurfacesForReferences(); |
185 | 182 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 std::unique_ptr<SurfaceDependencyTracker> dependency_tracker_; | 276 std::unique_ptr<SurfaceDependencyTracker> dependency_tracker_; |
280 | 277 |
281 base::WeakPtrFactory<SurfaceManager> weak_factory_; | 278 base::WeakPtrFactory<SurfaceManager> weak_factory_; |
282 | 279 |
283 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); | 280 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); |
284 }; | 281 }; |
285 | 282 |
286 } // namespace cc | 283 } // namespace cc |
287 | 284 |
288 #endif // CC_SURFACES_SURFACE_MANAGER_H_ | 285 #endif // CC_SURFACES_SURFACE_MANAGER_H_ |
OLD | NEW |