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

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

Issue 2811813004: Surface Synchronization: Distinguish between dependencies and references (Closed)
Patch Set: Addressed Vlad's comments Created 3 years, 8 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_REFERENCED_SURFACE_TRACKER_H_ 5 #ifndef CC_SURFACES_REFERENCED_SURFACE_TRACKER_H_
6 #define CC_SURFACES_REFERENCED_SURFACE_TRACKER_H_ 6 #define CC_SURFACES_REFERENCED_SURFACE_TRACKER_H_
7 7
8 #include <unordered_set> 8 #include <unordered_set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 23 matching lines...) Expand all
34 return references_to_remove_; 34 return references_to_remove_;
35 } 35 }
36 36
37 // Update the references for a CompositorFrame. If |local_surface_id| has 37 // Update the references for a CompositorFrame. If |local_surface_id| has
38 // changed then new references will be generated for everything in 38 // changed then new references will be generated for everything in
39 // |referenced_surfaces|. Otherwise a diff from the referenced surfaces in the 39 // |referenced_surfaces|. Otherwise a diff from the referenced surfaces in the
40 // last frame will be computed. This should be called once per 40 // last frame will be computed. This should be called once per
41 // CompositorFrame. 41 // CompositorFrame.
42 void UpdateReferences( 42 void UpdateReferences(
43 const LocalSurfaceId& local_surface_id, 43 const LocalSurfaceId& local_surface_id,
44 const std::vector<SurfaceId>* active_referenced_surfaces, 44 const std::vector<SurfaceId>* active_referenced_surfaces);
45 const std::vector<SurfaceId>* pending_referenced_surfaces);
46 45
47 private: 46 private:
48 // Updates |referenced_surfaces_| based on a |new_referenced_surfaces| from a 47 // Updates |referenced_surfaces_| based on a |new_referenced_surfaces| from a
49 // CompositorFrame. Populates |references_to_add_| and |references_to_remove_| 48 // CompositorFrame. Populates |references_to_add_| and |references_to_remove_|
50 // based on the difference between the sets. 49 // based on the difference between the sets.
51 void ProcessNewReferences(const std::unordered_set<SurfaceId, SurfaceIdHash>& 50 void ProcessNewReferences(const std::unordered_set<SurfaceId, SurfaceIdHash>&
52 new_referenced_surfaces); 51 new_referenced_surfaces);
53 52
54 // Adds reference from |current_surface_id_| to |surface_id|. 53 // Adds reference from |current_surface_id_| to |surface_id|.
55 void AddSurfaceReference(const SurfaceId& surface_id); 54 void AddSurfaceReference(const SurfaceId& surface_id);
(...skipping 15 matching lines...) Expand all
71 // CompositorFrame has been submitted and the surfaces are no longer needed by 70 // CompositorFrame has been submitted and the surfaces are no longer needed by
72 // |current_surface_id_|. 71 // |current_surface_id_|.
73 std::vector<SurfaceReference> references_to_remove_; 72 std::vector<SurfaceReference> references_to_remove_;
74 73
75 DISALLOW_COPY_AND_ASSIGN(ReferencedSurfaceTracker); 74 DISALLOW_COPY_AND_ASSIGN(ReferencedSurfaceTracker);
76 }; 75 };
77 76
78 } // namespace cc 77 } // namespace cc
79 78
80 #endif // CC_SURFACES_REFERENCED_SURFACE_TRACKER_H_ 79 #endif // CC_SURFACES_REFERENCED_SURFACE_TRACKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698