Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(566)

Side by Side Diff: cc/surfaces/surface_manager.h

Issue 2731743002: Decouple FrameSink Hierarchy registration from SurfaceFactoryClient registration (Closed)
Patch Set: Fixed Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/surfaces/surface_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 // this set, any remaining sequences with that namespace are considered 244 // this set, any remaining sequences with that namespace are considered
245 // satisfied. 245 // satisfied.
246 std::unordered_set<FrameSinkId, FrameSinkIdHash> valid_frame_sink_ids_; 246 std::unordered_set<FrameSinkId, FrameSinkIdHash> valid_frame_sink_ids_;
247 247
248 // Begin frame source routing. Both BeginFrameSource and SurfaceFactoryClient 248 // Begin frame source routing. Both BeginFrameSource and SurfaceFactoryClient
249 // pointers guaranteed alive by callers until unregistered. 249 // pointers guaranteed alive by callers until unregistered.
250 struct FrameSinkSourceMapping { 250 struct FrameSinkSourceMapping {
251 FrameSinkSourceMapping(); 251 FrameSinkSourceMapping();
252 FrameSinkSourceMapping(const FrameSinkSourceMapping& other); 252 FrameSinkSourceMapping(const FrameSinkSourceMapping& other);
253 ~FrameSinkSourceMapping(); 253 ~FrameSinkSourceMapping();
254 bool is_empty() const { return !client && children.empty(); } 254 bool has_children() const { return !children.empty(); }
255 // The client that's responsible for creating this namespace. Never null.
256 SurfaceFactoryClient* client;
257 // The currently assigned begin frame source for this client. 255 // The currently assigned begin frame source for this client.
258 BeginFrameSource* source; 256 BeginFrameSource* source;
259 // This represents a dag of parent -> children mapping. 257 // This represents a dag of parent -> children mapping.
260 std::vector<FrameSinkId> children; 258 std::vector<FrameSinkId> children;
261 }; 259 };
260
261 std::unordered_map<FrameSinkId, SurfaceFactoryClient*, FrameSinkIdHash>
262 clients_;
263
262 std::unordered_map<FrameSinkId, FrameSinkSourceMapping, FrameSinkIdHash> 264 std::unordered_map<FrameSinkId, FrameSinkSourceMapping, FrameSinkIdHash>
263 frame_sink_source_map_; 265 frame_sink_source_map_;
264 266
265 // Tracks references from the child surface to parent surface. If there are 267 // Tracks references from the child surface to parent surface. If there are
266 // zero entries in the set for a SurfaceId then nothing is referencing the 268 // zero entries in the set for a SurfaceId then nothing is referencing the
267 // surface and it can be garbage collected. 269 // surface and it can be garbage collected.
268 std::unordered_map<SurfaceId, SurfaceIdSet, SurfaceIdHash> 270 std::unordered_map<SurfaceId, SurfaceIdSet, SurfaceIdHash>
269 child_to_parent_refs_; 271 child_to_parent_refs_;
270 // Tracks references from the parent surface to child surface. Is the inverse 272 // Tracks references from the parent surface to child surface. Is the inverse
271 // of |child_to_parent_refs_|. 273 // of |child_to_parent_refs_|.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 std::unique_ptr<SurfaceDependencyTracker> dependency_tracker_; 308 std::unique_ptr<SurfaceDependencyTracker> dependency_tracker_;
307 309
308 base::WeakPtrFactory<SurfaceManager> weak_factory_; 310 base::WeakPtrFactory<SurfaceManager> weak_factory_;
309 311
310 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); 312 DISALLOW_COPY_AND_ASSIGN(SurfaceManager);
311 }; 313 };
312 314
313 } // namespace cc 315 } // namespace cc
314 316
315 #endif // CC_SURFACES_SURFACE_MANAGER_H_ 317 #endif // CC_SURFACES_SURFACE_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/surfaces/surface_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698