| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 void RegisterSurfaceIdNamespace(uint32_t id_namespace); | 55 void RegisterSurfaceIdNamespace(uint32_t id_namespace); |
| 56 | 56 |
| 57 // Invalidate a namespace that might still have associated sequences, | 57 // Invalidate a namespace that might still have associated sequences, |
| 58 // possibly because a renderer process has crashed. | 58 // possibly because a renderer process has crashed. |
| 59 void InvalidateSurfaceIdNamespace(uint32_t id_namespace); | 59 void InvalidateSurfaceIdNamespace(uint32_t id_namespace); |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 void GarbageCollectSurfaces(); | 62 void GarbageCollectSurfaces(); |
| 63 | 63 |
| 64 using SurfaceMap = std::unordered_map<SurfaceId, Surface*, SurfaceIdHash>; | 64 using SurfaceMap = std::unordered_map<SurfaceId, Surface*, SurfaceId::Hasher>; |
| 65 SurfaceMap surface_map_; | 65 SurfaceMap surface_map_; |
| 66 base::ObserverList<SurfaceDamageObserver> observer_list_; | 66 base::ObserverList<SurfaceDamageObserver> observer_list_; |
| 67 base::ThreadChecker thread_checker_; | 67 base::ThreadChecker thread_checker_; |
| 68 | 68 |
| 69 // List of surfaces to be destroyed, along with what sequences they're still | 69 // List of surfaces to be destroyed, along with what sequences they're still |
| 70 // waiting on. | 70 // waiting on. |
| 71 using SurfaceDestroyList = std::list<Surface*>; | 71 using SurfaceDestroyList = std::list<Surface*>; |
| 72 SurfaceDestroyList surfaces_to_destroy_; | 72 SurfaceDestroyList surfaces_to_destroy_; |
| 73 | 73 |
| 74 // Set of SurfaceSequences that have been satisfied by a frame but not yet | 74 // Set of SurfaceSequences that have been satisfied by a frame but not yet |
| 75 // waited on. | 75 // waited on. |
| 76 std::unordered_set<SurfaceSequence, SurfaceSequenceHash> satisfied_sequences_; | 76 std::unordered_set<SurfaceSequence, SurfaceSequenceHash> satisfied_sequences_; |
| 77 | 77 |
| 78 // Set of valid surface ID namespaces. When a namespace is removed from | 78 // Set of valid surface ID namespaces. When a namespace is removed from |
| 79 // this set, any remaining sequences with that namespace are considered | 79 // this set, any remaining sequences with that namespace are considered |
| 80 // satisfied. | 80 // satisfied. |
| 81 std::unordered_set<uint32_t> valid_surface_id_namespaces_; | 81 std::unordered_set<uint32_t> valid_surface_id_namespaces_; |
| 82 | 82 |
| 83 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); | 83 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 } // namespace cc | 86 } // namespace cc |
| 87 | 87 |
| 88 #endif // CC_SURFACES_SURFACE_MANAGER_H_ | 88 #endif // CC_SURFACES_SURFACE_MANAGER_H_ |
| OLD | NEW |