| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 // Set of valid surface ID namespaces. When a namespace is removed from | 120 // Set of valid surface ID namespaces. When a namespace is removed from |
| 121 // this set, any remaining sequences with that namespace are considered | 121 // this set, any remaining sequences with that namespace are considered |
| 122 // satisfied. | 122 // satisfied. |
| 123 std::unordered_set<uint32_t> valid_surface_id_namespaces_; | 123 std::unordered_set<uint32_t> valid_surface_id_namespaces_; |
| 124 | 124 |
| 125 // Begin frame source routing. Both BeginFrameSource and SurfaceFactoryClient | 125 // Begin frame source routing. Both BeginFrameSource and SurfaceFactoryClient |
| 126 // pointers guaranteed alive by callers until unregistered. | 126 // pointers guaranteed alive by callers until unregistered. |
| 127 struct ClientSourceMapping { | 127 struct ClientSourceMapping { |
| 128 ClientSourceMapping(); | 128 ClientSourceMapping(); |
| 129 ClientSourceMapping(const ClientSourceMapping& other); |
| 129 ~ClientSourceMapping(); | 130 ~ClientSourceMapping(); |
| 130 bool is_empty() const { return !client && !children.size(); } | 131 bool is_empty() const { return !client && !children.size(); } |
| 131 // The client that's responsible for creating this namespace. Never null. | 132 // The client that's responsible for creating this namespace. Never null. |
| 132 SurfaceFactoryClient* client; | 133 SurfaceFactoryClient* client; |
| 133 // The currently assigned begin frame source for this client. | 134 // The currently assigned begin frame source for this client. |
| 134 BeginFrameSource* source; | 135 BeginFrameSource* source; |
| 135 // This represents a dag of parent -> children mapping. | 136 // This represents a dag of parent -> children mapping. |
| 136 std::vector<uint32_t> children; | 137 std::vector<uint32_t> children; |
| 137 }; | 138 }; |
| 138 std::unordered_map<uint32_t, ClientSourceMapping> namespace_client_map_; | 139 std::unordered_map<uint32_t, ClientSourceMapping> namespace_client_map_; |
| 139 // Set of which sources are registered to which namespace. Any child | 140 // Set of which sources are registered to which namespace. Any child |
| 140 // that is implicitly using this namespace must be reachable by the | 141 // that is implicitly using this namespace must be reachable by the |
| 141 // parent in the dag. | 142 // parent in the dag. |
| 142 std::unordered_map<BeginFrameSource*, uint32_t> registered_sources_; | 143 std::unordered_map<BeginFrameSource*, uint32_t> registered_sources_; |
| 143 | 144 |
| 144 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); | 145 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); |
| 145 }; | 146 }; |
| 146 | 147 |
| 147 } // namespace cc | 148 } // namespace cc |
| 148 | 149 |
| 149 #endif // CC_SURFACES_SURFACE_MANAGER_H_ | 150 #endif // CC_SURFACES_SURFACE_MANAGER_H_ |
| OLD | NEW |