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